BLOG
Adding BDD to TFS 2010 Test Cases
Team Foundation Server 2010 provides functionality for testing applications with built in support for test plan and test case management. In our Agile/Scrum projects, we define all of the Test Cases in our planning meeting to define done for each User Story. When starting new projects, team members often ask is how to format the Test Cases so they are clear. One way we have found to be very useful is to use the same format as found in Behavior Driven Development(BDD). BDD uses a format for communicating Test Cases called Gherkin. The Gherkin format follows the pattern below:

Just like the User Story format (As a [user], I want to be able to do [business process], so that [business value]), we have found the Gherkin format is very useful for teams learning Agile. In fact, these Test Cases can be written for Acceptance/Functional tests and for Unit Tests. When we work with customers and our own projects we install our customized Lunavi Agile Process Template as part of the Lunavi Agile Delivery Process. The Lunavi Agile Process Template is a slightly customized version of the MSF for Agile 5.0 process template. In the Test Case work item, we have added fields for Given, When, and Then. The “Then” should also match the expected result in the test steps.


Customizing the TFS Test Case Work Item Templates (WIT) to add these fields is straight forward. In summary, use Test Cases to define done of the User Story and use BDD and Gherkin for the language of the Test Case. Feel free to contact us if you have any questions about these changes or about the Lunavi Agile Delivery Process.