3

We are using cobertura to show our unit test coverage, we have only just started using it (Im new to running this team) and our current unit test coverage is very low, rather than just go in and find areas where we need to get this coverage up I want to start it off by enforcing that all new user stories have over 80% coverage.

cobertura can show me the unit test coverage on areas affected by that user story but as far as I am aware it cant show me what the actual unit test coverage is for that story.

Bear in mind I come from a QA background, I have managed development teams a few times but dont have the actual coding experience.

thanks

Shaun Wilde
  • 8,228
  • 4
  • 36
  • 56

3 Answers3

2

Since user stories don't map directly to code (there will be many parts of the code shared between stories, and often the code for a user story is distributed throughout the application), this is generally impossible.

Michael Borgwardt
  • 342,105
  • 78
  • 482
  • 720
0

Yes you can get code coverage specific to user story but I do not think that there is any out of the box solution available.

You can find code changed for a user story from SCM repository commits and map it to code coverage tool output to find the percentage of code covered for your user story.

Saurabh Juneja
  • 1,187
  • 1
  • 8
  • 12
0

This is the traditional distinction between line coverage and functional coverage. It is interesting to achieve a high line coverage (your target of 80% seems like a good starting point), but this is not enough: what matters is functional coverage, and there is no automated tool that will properly measure that.

For more details, please see my answer here, which covers that.

Community
  • 1
  • 1
Guillaume
  • 22,694
  • 14
  • 56
  • 70