colinramsay.co.uk

Unit Testing SSRS Reports

12 Mar 2008

A big problem we're having on a current project is ensuring that reports generated by SSRS actually contain the right data. For example, we have some fairly complicated ranking and averaging going on in subtotal columns that can look right on first glance but will be wrong for edge cases. The other problem is that one "fix" can pretty easily result in a regression elsewhere.

My current thought is to simply use SSRS XML export on the reports and use that to run unit tests against. We could push known data to the database, export the report, and run asserts against the average and ranking values in the XML.

However, I'm not sure how happy SSRS will be with this approach; for example, how easy will it be to change the datasource on the fly for these tests? And obviously, when the reports get redesigned or changed, the unit tests could break. I think it's worth investigating; I wonder if anyone else has experience with such testing?

Feedback or questions on this post? Create an issue on GitHub.