All Projects → TNG → Jgiven

TNG / Jgiven

Licence: apache-2.0
Behavior-Driven Development in plain Java

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Jgiven

Cucumberjvmexamples
Cucumber JVM with Selenium Java
Stars: ✭ 98 (-69.28%)
Mutual labels:  tdd, test-automation, bdd
List Of Testing Tools And Frameworks For .net
✅ List of Automated Testing (TDD/BDD/ATDD/SBE) Tools and Frameworks for .NET
Stars: ✭ 303 (-5.02%)
Mutual labels:  tdd, bdd, test-driven-development
Bandit
Human-friendly unit testing for C++11
Stars: ✭ 240 (-24.76%)
Mutual labels:  tdd, bdd, test-driven-development
Aruba
Test command-line applications with Cucumber-Ruby, RSpec or Minitest. The most up to date documentation can be found on Cucumber.Pro (https://app.cucumber.pro/projects/aruba)
Stars: ✭ 900 (+182.13%)
Mutual labels:  tdd, bdd, test-driven-development
Mockito Scala
Mockito for Scala language
Stars: ✭ 231 (-27.59%)
Mutual labels:  tdd, test-automation, test-driven-development
bdd-for-all
Flexible and easy to use library to enable your behavorial driven development (BDD) teams to easily collaborate while promoting automation, transparency and reporting.
Stars: ✭ 42 (-86.83%)
Mutual labels:  tdd, bdd, test-automation
bdd-for-c
A simple BDD library for the C language
Stars: ✭ 90 (-71.79%)
Mutual labels:  tdd, bdd, test-driven-development
TddCourse
Kod źródłowy do kursu TDD na blogu dariuszwozniak.NET.
Stars: ✭ 18 (-94.36%)
Mutual labels:  tdd, test-driven-development
Lest
A modern, C++11-native, single-file header-only, tiny framework for unit-tests, TDD and BDD (includes C++98 variant)
Stars: ✭ 316 (-0.94%)
Mutual labels:  tdd, bdd
Awesome Unit Testing Swift
A curated collection of awesome blog articles, books, talks, podcasts, tools/frameworks and examples.
Stars: ✭ 272 (-14.73%)
Mutual labels:  tdd, test-driven-development
apple-mango
Python BDD Pattern
Stars: ✭ 18 (-94.36%)
Mutual labels:  tdd, bdd
karate-runner
VSCode Extension for Karate
Stars: ✭ 23 (-92.79%)
Mutual labels:  bdd, test-automation
showroom
Universal development and automated test environment for web components
Stars: ✭ 89 (-72.1%)
Mutual labels:  tdd, bdd
flake8-aaa
A Flake8 plugin that checks Python tests follow the Arrange-Act-Assert pattern
Stars: ✭ 51 (-84.01%)
Mutual labels:  tdd, test-driven-development
neodymium-library
A test automation library based on common other best practice open source libraries. It adds missing functionalities but does not reinvent the wheel. Just glues stuff together nicely and adds some sprinkles.
Stars: ✭ 70 (-78.06%)
Mutual labels:  bdd, test-automation
Everydayrails Rspec 2017
Sample source for the 2017 edition of Everyday Rails Testing with RSpec.
Stars: ✭ 280 (-12.23%)
Mutual labels:  tdd, bdd
featurebook
A command line tool (and Node.js library) for generating beautiful system specifications from Gherkin source files.
Stars: ✭ 40 (-87.46%)
Mutual labels:  bdd, test-automation
community-edition
Zebrunner is a Test Automation Management Tool
Stars: ✭ 171 (-46.39%)
Mutual labels:  test-automation, test-driven-development
apitest
Apitest is declarative api testing tool with JSON-like DSL.
Stars: ✭ 88 (-72.41%)
Mutual labels:  tdd, test-automation
cucumber
Cucumber testing framework for Rust. Fully native, no external test runners or dependencies.
Stars: ✭ 322 (+0.94%)
Mutual labels:  tdd, bdd

Build Status Coverage Status Apache License 2.0 Maven Central Join the chat at https://gitter.im/TNG/JGiven Javadocs Open Source Helpers

JGiven

JGiven is a developer-friendly and pragmatic BDD tool for Java. Developers write scenarios in plain Java using a fluent, domain-specific API, JGiven generates reports that are readable by domain experts.

Why another BDD tool?

Behavior-Driven Development (BDD) is a development method where business analysts, developers, and testers describe the behavior of a software product in a common language and notation. Behavior is typically described in terms of scenarios, which are written in the Given-When-Then notation. The common language and notation is one cornerstone of BDD. The other cornerstone is that the defined scenarios are executable, form a comprehensive test suite, and a living documentation for the software product.

In classical BDD tools for Java like JBehave or Cucumber scenarios are written in plain text files. This allows non-developers to write scenarios, because no programming knowledge is required. To make scenarios executable, developers write so-called step-implementations. To bind plain text to step implementations regular expressions are used. For developers maintaining these executable scenarios has a high overhead that is not required if tests would be directly written in a programming language.

Beside the classical BDD tools there are a number of tools for Java to write BDD tests in a programming language like Groovy (easyb) or Scala (ScalaTest). To our knowledge, however, there is no BDD tool where scenarios can be written in plain Java.

Finally, there are specification testing frameworks like Spock (Groovy) or LambdaBehave which are very developer-centric and good for unit-testing, but the generated reports are not in Given-When-Then form and are not easily readable by non-developers.

BDD with JGiven

  • Scenarios are written in standard Java code using a fluent, domain-specific API (no extra language like Scala or Groovy needed, no IDE plugin needed)
  • Java method names and parameters are parsed during test execution (no extra annotations needed)
  • Scenarios are executed by either JUnit or TestNG (no extra test runner needed)
  • Scenarios consist of so-called stages, which share state by injection, providing a modular way of writing Scenarios.
  • JGiven generates scenario reports for business owners and domain experts

Example


@Test
public void a_pancake_can_be_fried_out_of_an_egg_milk_and_flour() {
    given().an_egg().
        and().some_milk().
        and().the_ingredient( "flour" );

    when().the_cook_mangles_everything_to_a_dough().
        and().the_cook_fries_the_dough_in_a_pan();

    then().the_resulting_meal_is_a_pancake();
}

The above test can be executed like any JUnit test. During the execution, JSON files are generated that can then be used afterwards to generate test reports. By default, a plain text report is shown in the console, which would look as follows:

Scenario: a pancake can be fried out of an egg milk and flour

  Given an egg
    And some milk
    And the ingredient flour
   When the cook mangles everything to a dough
    And the cook fries the dough in a pan
   Then the resulting meal is a pancake

In addition, you can generate a HTML Report.

Getting Started

  1. Start by reading the documentation section on JGiven's website.
  2. See the talk on JGiven held on the TNG Big TechDay

License

JGiven is published under the Apache License 2.0, see https://www.apache.org/licenses/LICENSE-2.0 for details.

Contributing

See CONTRIBUTING

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].