这是我见到的一个搜集代码覆盖率工具最全的网站:http://c2.com/cgi/wiki?CodeCoverageTools
for Java:
- EMMA @ http://emma.sourceforge.net/ - OpenSource, instrumenting ClassLoader as well as offline instrumentor, ANT, fractional line coverage, block coverage
- Hansel @ http://hansel.sourceforge.net/ - OpenSource, instruments classes in ClassLoader, integrates with JavaUnit
- jcoverage @ http://www.jcoverage.com/ - OpenSource and ClosedSource versions, Ant task, line and branch coverage
- Cobertura @ http://cobertura.sourceforge.net/ - OpenSource, free, instruments class files, Ant tasks
- Clover @ http://www.cenqua.com/clover/ - ClosedSource (but free for use on OpenSource projects), integrates well with common Java IDEs
- GroboUtils @ http://groboutils.sourceforge.net - OpenSource, instruments class files, Ant tasks
- NoUnit @ http://nounit.sourceforge.net/ - OpenSource (GNU)
- Quilt @ http://quilt.sourceforge.net/ - OpenSource, JavaUnit, Ant, instrumenting ClassLoader
- Gretel @ http://sourceforge.net/projects/gretel - [old version of Hansel?]
- The "Java Test Coverage Tool" @ http://www.semanticdesigns.com/Products/TestCoverage/JavaTestCoverage.html - ClosedSource, Instruments Source, displays results superimposed on browsable source. US$200 as of 8/1/2004.
- JBlanket (Software Information) @ http://csdl.ics.hawaii.edu/Tools/JBlanket/ - a tool for assessing and improving method coverage of unit test cases. It is integrated with JUnit and Ant.
MutationTesting: (which isn't really CodeCoverage, but it's related)
- JesTer @ http://jester.sourceforge.net/ - changes your code, and then runs your tests. (If arbitrary changes to the code don't break the tests, then is your code sufficiently tested?)
for .NET (DotNet):
- OpenCover @ https://github.com/sawilde/opencover - OpenSource (MIT licence) A code coverage tool for .NET 2 and above, support for 32 and 64 processes with both branch and sequence points
- Clover.NET @ http://www.cenqua.com/clover.net/ - ClosedSource (but free for use on OpenSource projects), C# and VB.NET, statement, method and branch coverage, from command line, Visual Studio, and NAnt (preliminary mono support)
- NCover @ http://ncover.sourceforge.net/ - OpenSource, path coverage, NUnit, NAnt
- CoverageEye?.NET @ http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=881a36c6-6f45-4485-a94e-060130687151 - uses a COM component to leverage the .NET profiling API
- "DevPartner? Studio Professional Edition" @ http://www.compuware.com/products/devpartner/1563_ENG_HTML.htm - $$$
- "Perform Code Coverage Analysis with .NET to Ensure Thorough Application Testing", an MSDN article on building "A custom code coverage tool" @http://msdn.microsoft.com/msdnmag/issues/04/04/CodeCoverageAnalysis/default.aspx
- "C# Test Coverage Tool" @ http://www.semanticdesigns.com/Products/TestCoverage/CSharpTestCoverage.html - ClosedSource. Instruments Source, displays results superimposed on browsable source. US$250 as of 8/1/2004.
- "dotCover" http://www.jetbrains.com/dotcover/ Closed source, free license for OSS projects
C/C++:
- tcov = Sun Unix C profiler. See "tcov(1)" man page. It annotates (mangles) your source code to add instrumentation.
- gcov = GNU C/C++ equivalent of "tcov".
- Dynamic Code Coverage for Sun Solaris, Linux, and HP UX @ http://www.dynamic-memory.com/
- "C Test Coverage Tool" @ http://www.semanticdesigns.com/Products/TestCoverage/CTestCoverage.html - ClosedSource. Instruments Source, displays results superimposed on browsable source. US$400 as of 8/1/2004. ANSI, Microsoft Visual6 C, and GNU C dialects all supported.
- "C++ Test Coverage Tool" @ http://www.semanticdesigns.com/Products/TestCoverage/CppTestCoverage.html - ClosedSource. Instruments Source, displays results superimposed on browsable source. US$500 as of 8/1/2004. ANSI and Microsoft Visual6 C++ dialects all supported.
Perl:
- Devel::Cover @ http://search.cpan.org/dist/Devel-Cover/ - Statement, branch, path, expression and documentation coverage.
- Pod::Coverage @ http://search.cpan.org/dist/Pod-Coverage / - Documentation coverage (used by Devel::Cover)
- Test::Pod::Coverage @ http://search.cpan.org/dist/Test-Pod-Coverage - Testing framework wrapped around Pod::Coverage
- Devel::Coverage - older coverage module superseded by Devel::Cover
for Python:
- coverage.py @ http://www.ravenbrook.com/project/p4dti/master/test/coverage.py - Provides statement coverage data. Part of a larger project: OpenSource-style license is at bottom of source file.
- pylid - http://www.nullcube.com/software/pylid.html
- trace.py (part of Python's standard library)
for PHP:
- "PHP Test Coverage Tool" @ http://www.semanticdesigns.com/Products/TestCoverage/PHPTestCoverage.html - ClosedSource. Instruments Source, displays results superimposed on browsable source. PHP4 and PHP5 versions.