Download - Bdd java

Transcript

BDD and Java

By Franck Benault

Created 16/12/2016Last update 26/12/2016

BDD introduction

Junit are usually difficult to read

BDD The tests must be readable and understable

By developpers, testers but also by business expert

BDD links

My examples in Githubhttps://github.com/franck-benault/BDD-Examples

BDD global view

Goal of this presentation of BDD

GoalTo present the main BDD frameworks in JavaHistoric Cucumber/ Jbehave / Concordion

New onesJgiven

Senerity BDD

Show that Jgiven is a good choice

cucumber

Given When Then

Martin Fowlerhttp://martinfowler.com/bliki/GivenWhenThen.html

Specification By ExamplesGiven (an initial context)

When (action)

Then (expected result)

[And | But]

Cucumber-jvm

The reference in BDD

Cucumber exists in many languagesRuby, Groovy, JavaScript, php ...

Cucumber-jvm is the java version

The scenarios are writen in plain text (Gherkin syntaxe)

The tests are writen in Java

Regex in annotation makes the links between scenarios and tests

cucumber

Cucumber-jvm

Eclipse pluginFormat

Test runner

JGiven

AdvantagesPure java BDD frameworkAvoid duplication, beter maintenance

Good report

LimitationQuite recent (2014)

The text of the scenarios is generatedNot written

Conclusion

When will you start with BDD

When will you start with Jgiven?


Top Related