Creating a Beautiful Overview of your Test Suite (using Report Unit)

The test runner inside Visual Studio is great while developing code. In this phase I only care if tests fail and when everything works, I don’t want to be bothered. However, if I need to create a report for someone that just wants to know the high-level view, then this tool is not good enough: Too much details and no visualisation.

To create a high-level report, I need to put in effort: Copy some numbers around, create an Excel file with some graphics and then paste that back into another document. That effort needs to be redone whenever a new report is required. A better solution is needed and with Report Unit I found one that works quiet well.

Report Unit uses the output of a test runner and creates a nice HTML report. It contains a useful visualisation and allows you to drill-down from the test-project down to the single test cases:

The effort you need to create such a report is minimal. All you need is a little batch file that calls your test runner, creates a result file and then pipe it through Report Unit. I use NUnit and want to create the report in the folder HTMLReport. These commands do exactly that for all my 3 test projects:

 

Some remarks on this solution:

  • One test project needs to add the Report Unit NuGet package (Install-Package ReportUnit) so that it is downloaded to the packages folder in your solution.
  • Keep an eye on the paths you use. I always use relative paths, so that I don’t depend on a specific location in the filesystem.
  • To add new projects, you simply copy one of the lines that call the test runner and modify it with the path to the new project.
  • It only works when the code is pre-compiled. Should this be a problem for you, then you could trigger a compilation at the top of the script.

As soon as you have this setup working, you no longer need to copy numbers around to create a beautiful high-level report for the management.

2 thoughts on “Creating a Beautiful Overview of your Test Suite (using Report Unit)”

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.