问题
I am looking for the way to automate the following task.
Given the coverage report, find out which tests cover particular method / function. Even better if I can specify specific class and line number.
The running time is not very imoprtant as long as it could be done within few hours. I am thinking of running each test one by one and collecting the coverage records in a database. Just wandering if there is someone out there who faced a similar problem and has a ready made solution.
Our project is medium sized with about 100 unit test cases.
P.S. To clarify our project is Java based, but I am also looking to see what other platforms have in this regard.
回答1:
OpenCover (.NET Code Coverage) already supports this feature for MSTest, NUnit and xUnit (other test frameworks can be added). Running time is only fractionally longer than running normally.
来源:https://stackoverflow.com/questions/16346224/reverse-test-coverage