About Us

Adding BDD to TFS 2010 Test Cases

by Mike Douglas 12. December 2011 19:33

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:

image

Figure 1 – Given, When, and Then definition

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 Deliveron Agile Process Template as part of the Deliveron Agile Delivery Process.  The Deliveron 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.

SNAGHTML3f2b686e
Figure 2 – BDD additions for TFS Test Case Work Item

image

Figure 3 – Expected result matches the “Then”

Customizing the TFS Test Case Work Item Templates (WIT)  to add these fields is straight forward.  Follow the steps in this post I did a couple years ago.  It was for TFS 2008 but the steps are the same in TFS 2010.

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 Deliveron Agile Delivery Process.

Customizing the Burndown Dashboard Report in The TFS 2010 Team Portal

by Mike Douglas 2. August 2011 20:00

The Team Project portal site in TFS 2010 is the collaboration hub for many activities that typically includes document libraries, team calendar,  wiki, reporting, and more.  TFS 2010 includes a number of reports that can be displayed on the portal using SSRS (using either SharePoint 2010 Foundation or SharePoint 2010 Enterprise) and Excel Services (using SharePoint 2010 Enterprise).    In this post, I will walk through customizing the report to display the burndown for the particular Iteration..

The first question I often receive is:

How do I customize the burndown dashboard report to fit my Sprint/Iteration?

When you display the project portal page and view the burndown dashboard report, you will notice that the default parameters don’t match the current iteration.  To update this, we can override the parameters being passed into the report through the URL.  I want to set Start Date, End Date, and Iteration parameters to display the correct data.

First, navigate to the page with the report

image

Click on the arrow and choose “Edit Web Part” to edit the parameters for the report.

image

On the right of the screen is the settings for the web part and report. The link is what needs to be modified.

http://tfsserver/ReportServer/Pages/ReportViewer.aspx?%2fTfsReports%2fBP%2fTeamProject%2fDashboards%2f
Burndown&rs:Command=Render&rc:Toolbar=false&StartDateParam=07/05/2011&EndDateParam=07/26/2011

To Determine the properties to add or change, you can go to the report itself and look at the properties available. In this example, we want to update the Start Date and End Date and add the Iteration. To find out what the name of the Iteration parameter is, go to the following URL to see the properties.

http://tfsserver/Reports/Pages/Folder.aspx?ItemPath=%2fTfsReports%2fBP%2fTeamProject%2fDashboards&ViewMode=List

Choose the Manage option in the context menu of the report

image

In the settings screen, choose the Parameters tab and find the parameter you are looking for. This is the name we will add to the URL above. In this instance, it is IterationParam

image

The format of the IterationParam parameter wasn’t intuitive.  The item is a multi-select checkbox list.  So it wouldn’t take a simple text value such as “Iteration 01”.

SNAGHTML561b382

To figure out the format of value, I used the report viewer to set the value of the Iteration and exported the report as an Atom feed.  Then I opened the Atom XML and to pull out the value of the Iteration Param that it created.  Below is what the link looks like with the IterationParam value added.

http://tfsserver/ReportServer/Pages/ReportViewer.aspx?%2fTfsReports%2fBP%2fTeamProject%2fDashboards
%2fBurndown&rs:Command=Render&rc:Toolbar=false&IterationParam=%5BWork%20Item%5D.%5B
Iteration%20Hierarchy%5D.%5BIteration1%5D.%26%5B7130920747760410946%5D%26%5B-4689172157298829814%5D&
StartDateParam=07/06/2011&EndDateParam=07/26/2011

Finally paste this URL into the link in the web part and save. This is ready to display.

Mike Douglas