With TeamCity's numerous code quality features you can be sure your code base is being thoroughly tested from the project's start helping you develop high caliber software.
Code Coverage, Inspections and Duplicates Search
TeamCity has an unparalleled variation of means for maintaining code quality:
- Analysis of Java code covered by unit tests
Measure the code coverage for your unit tests with EMMA, an open-source toolkit. TeamCity provides both summaries and detailed reports on code coverage. You can also download the code coverage results and analyze them in IntelliJ IDEA.
You can track your projects' classes, blocks, lines and methods covered by the tests using the code coverage statistical graph.
- Search for duplicated pieces of code for Java and .NET projects
Manually searching for code duplicates in big projects locally can take huge amounts of time, and it is almost impossible to constantly monitor the state of the code base.
TeamCity's solution is automated searching for code duplicates in .Net and Java code just like running a build. Select one of the Duplicates Finder runners and all of the integrated code is constantly checked for duplicates. The search is performed on a Build Agent and detailed reports are available in the web UI, where you can opt to show all or only newly discovered duplicates.
TeamCity now integrates with FxCop runner for .NET projects code analysis.
The .NET Duplicates Finder is based on ReSharper's capabilities and will catch similar code fragments of your C# and Visual Basic .NET code in Visual Studio 2003, 2005 and 2008 solutions. TeamCity supports C# up to version 2.0 and covers Visual Basic .NET up to version 8.0.
A statistical graph allows you to track the number of duplicates discovered in your code.
Search for Java inspections and duplicates are now powered by IntelliJ IDEA.
TeamCity uses a set of more than 600 IntelliJ IDEA's inspections which you can use to analyze:
- unused and unreachable code,
- declaration redundancies,
- performance issues,
- dead code.
Check out the results of your code analysis in a browser, and then navigate to a particular string of code in the IDE where you can suppress or resolve the inspection results.
Code inspection is available for Maven2 projects.
Tests Re-ordering and Test Details
TeamCity now identifies a set of tests which are likely to fail, and can run those tests first on the next build, allowing you to confirm potential fixes sooner thus reducing the feedback time.
You can choose to:
- run newly added and modified tests first (available with JUnit, TestNG using Ant/Ipr build runners)
- run recently failed tests first (available with JUnit, TestNG using Ant/Ipr build runners, and with NUnit using any .NET runner)
Problematic Tests tab shows tests which have failed recently, total number of test runs, failure rate, and other information.
Tests Results Analysis
TeamCity allows to investigate which tests/classes/packages take most of the build time. For each test, you can also see a graph which shows how test duration changes from build to build.
Build test report allows:
With statistical trends you can track the condition of your projects over time. The visual graphs include information about all the builds of a certain build configuration across all its history. You can:
- Select time range for each type of statistics
- Filter information by data series, for example, by Agent name or by result type
- View average values
- Filter out failed builds and show only the successful builds
- View a build summary information and navigate to the build results page
"Time to fix tests" Statistics
A new type of statistical data display: time it took to fix the build's tests.
This chart displays the number of tests (JUnit, NUnit, TestNG) that the build passed, ignored, or failed.
Duplicates, Inspections, and Coverage Charts
For those build configurations which have duplicates, inspections or coverage enabled, you can analyze the trends in:
- the amount of duplicated code
- the number of errors and warning found
- the number of unit tests