本文介绍了哪些工具可用于使用浏览器自动化测试来计算代码覆盖率的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个用ASP.NET MVC 3编写的网站。我整理了一些针对该网站的浏览器自动化测试。我想使用同一组测试来计算网站代码的代码覆盖率。

I have a website written in ASP.NET MVC 3. I have put together some browser automation tests that target this website. I want to use this same set of tests to calculate the code coverage of the website code.

我知道NCover会做这种工作,但是根据我的知识,有两个问题。首先,NCover给出了框架代码和我的代码的代码覆盖率数字。二,这很昂贵。

I know that NCover does this kind of work but based on my knowledge there are two issues. One, NCover gives code coverage figures for both framework's code and my code. Two, it's costly.

推荐答案

NCover具有,您可以使用它们忽略框架代码。

NCover has filters that you can use to ignore the framework code.

您还可以使用或可以获取这些指标,它们既是开源的又是免费的-它们还具有过滤器。

You could also use OpenCover or PartCover to get these metrics and they are both open source and free - they also have filters.

将它们连接到IIS很难,但是如果用于自动化测试,则可以针对IIS express运行测试-更加容易。

Hooking them into IIS is tricky but if it is for automation tests then you can run your tests against IIS express - much easier.

这篇关于哪些工具可用于使用浏览器自动化测试来计算代码覆盖率的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-27 02:12