Arif_Muhammad

Bringing BDD Scenario based testing approach to Integration testing

Blog Post created by Arif_Muhammad Employee on Sep 25, 2014

Many agile teams have started incorporating Behavior Driven Development into their practices. BDD has a systematic framework to stream-line the stories into Scenarios and forces teams to discuss and put in writing any of the acceptance criteria. Here is an example of the scenario and criteria

 

       Scenario: Money deposit activity for a given account

Given an account A with balance $100

When 50$ are deposited

New balance goes to $150

And When $50 is withdrawn

New balance goes back to $100

 

 

The formal acceptance criterion combined with Test Driven Development is helping bring emphasis on the importance of unit testing (remember the testing pyramid I discussed in my blog) as a key quality strategy. But there are many cases where unit testing at very focused code area alone is not enough specially where you want to test a full business workflow kind of scenario that spans across multiple application components and interfaces. That’s where CA Application Test Invoke and Verify framework become handy.

 

The question is can I take the Scenario and make it CA Application Test in such away that the test execution and results are easy to read and relate to the scenario test is validating. Yes you can, the trick is documenting your test case properly. Here is an example implementation of above scenario

test.jpg

Please note the names used for step as well as the assertions to improve the readability of the test and make it as close to the actual Scenario as possible.

 

Now if I run the test the trick is the results of this test should be presented in a fashion that you wont need to be CA Application Test expert to read the test results i.e. more something like following

result.jpg

 

That’s an interesting challenge. As part of CA Application Test 8.0 release our development team has been spending some time thinking about this. You could join us at CA world where we can show you some of that work.

 

Although above was a very simplistic example but you can easily extrapolate and apply it to implement a complete business workflow by using CA Application Test's Invoke/Verify framework across heterogeneous technologies. I will be interested in hearing your thoughts. Have you experimented BDD in your team? What are your experiences?

Outcomes