我们有一个有10年历史的Winforms应用程序,在UI层有一个巨大的代码库。通过NUnit或MS测试编写单元测试用例将是一场噩梦。
所以我们选择了UI自动化而不是白盒测试。
现在困难的部分是,我们需要源代码的代码覆盖率信息。
有没有什么方法可以让我得到源代码的执行/ UI自动化的覆盖率?
在此之前,非常感谢您。
发布于 2015-12-22 22:35:03
Visual Studio有一个内置的代码覆盖率度量工具。有两个选项。
中所述的命令行工具
- Use `vsinstr -coverage <myassembly.exe>` to instrument target binaries.
- Use `start vsperfmon -coverage -output: mytestrun.coverage` to start collecting coverage data.
- After the tests are finished just open `.coverage` file in Visual Studio (coverage should be perfectly highlighted in the source code editor as well).
https://stackoverflow.com/questions/34286811
复制相似问题