Skip to content
Nicholas Smith edited this page Jan 20, 2015 · 1 revision

Behavior Driven Development

This project uses the JBehave library to facilitated automated testing.

Rather than regular unit testing , it is felt that a specification style of testing is more appropriate e.g. given this class expect this outcome in the parser.

This is largely due to the fact the main thing changing during testing is the source of class under test, with the expected outcomes being largely variations on a theme. As we’re into DRY let’s not maintain dozens of JUnit style tests repeating the same asserts.

So strictly speaking JBehave is for Behavior Driven Development defined with a given-when-then syntax. The key aspect however is the ability to define scenarios in plain text, and have the ability to reuse the same expectations then’s once defined in Java.

The other key aspects are that JBehave is POJO orientated and and not a large leap away from regular JUnit; which is perhaps more suitable for casual committers rather than something like Spock.

The test cases reside in the javaparser-test module.

Video Demo

A demonstration video is available to introduce testing with JBehave and the JavaParser

https://www.youtube.com/watch?v=IW5FsUGenNs

Contributing

If you would like to contribute to the project, but have a question about JBehave based testing please raise create a question in issues

Clone this wiki locally