TeamCity Free for small team

Code Quality


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.

    Stats Code Coverage Click to enlarge

    The coverage statistics is available for projects using Ant and Ipr build runners.
    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.

    Syntax Highlighting Click to enlarge

    The Duplicates Finder for Java is powered by IntelliJ IDEA and will catch repetitive blocks of Java code in IntelliJ IDEA projects or projects being built by Maven2.
    Build Runners List

    TeamCity now integrates with FxCop runner for .NET projects code analysis.

    fxCop Build Runner

    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.

    Stats Code Duplicates Click to enlarge

    Search for Java inspections and duplicates are now powered by IntelliJ IDEA.

  • Server-side code inspection of Java, JSP, JavaScript, CSS code

    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.

    Stats Code Inspection Click to enlarge

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)
    Administration Run Risk Tests First

Problematic Tests tab shows tests which have failed recently, total number of test runs, failure rate, and other information.

Problematic Tests Tab Click to enlarge

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:

  • Grouping by suite/package/namespace/class with cumulative test duration
  • Filtering by test status (any, failed, ignored or successful)
  • Showing tests of a particular package
  • First Failed Tests Click to enlarge
  • New Test Details page, containing complete information and duration trend chart for a particular test.

    Test Statistics Page Click to enlarge

Statistics

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.

Time To Fix Tests Graph

Build Durations

Stats Build Duration Click to enlarge

Use this chart to monitor the duration of each build.

Success Rate

Stats Success Rate Click to enlarge

This chart tracks the build success rate over a selected period of time.

Per-test Duration

Test Duration Stats Graph Click to enlarge

This specific chart shows how much time each particular test took.

Test Count

Stats Test Count Click to enlarge

This chart displays the number of tests (JUnit, NUnit, TestNG) that the build passed, ignored, or failed.

Duplicates, Inspections, and Coverage Charts

Stats Code Duplicates Click to enlarge

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

Artifacts Size

Stats Artifacts Size Click to enlarge

This chart lets you track how the size of the build artifacts has changed over time.