3

我有两个独立的 java maven 项目:一个是我的 web 应用程序本身,另一个是我的 web 的tellurium+selenium 自动化测试(我将这些测试移动到单独的项目中,因为它们的代码并不真正属于 web 应用程序项目代码并且不'不要使用我的 web 应用程序的 java 类,我也想重用这些测试的某些部分来测试我的其他 web 应用程序)。因此,我的测试所在的项目对我的 Web 应用程序一无所知,除了tellurium/selenium conf 文件(主机名、凭据、浏览器)。

所以问题是:有什么方法可以测量我的 Web 应用后端的代码覆盖率,该后端由位于单独项目中的碲/硒测试调用?

提前致谢。非常感谢任何帮助。

4

1 回答 1

0

EMMA 或 cobetura 可以检测您的类,以便在测试运行后创建覆盖率报告。

http://emma.sourceforge.net/reference/ch02s03.html

<instr>/instr is EMMA's offline class instrumentor. It adds bytecode
instrumentation to all classes found in an instrumentation path that
also pass through user-provided coverage filters. Additionally, it 
produces the class metadata file necessary for associating runtime 
coverage data with the original class definitions during coverage 
report generation.
于 2011-08-24T15:09:40.790 回答