News

Test Code Coverage Tool Adds Complexity and Trends Analysis

NCover Inc. is releasing version 3.0 this week of its flagship code coverage analysis tooling for .NET. Targeted at automated build and test environments, the upgrade improves performance, profiling and reporting capabilities, according to the company.

The tooling consists of an NCover Explorer UI for developers, a build system console for the build developer and a reporting module aimed at project managers. NCover 3.0 improves performance in areas such as coverage loading. It also integrates branch coverage into the Explorer, improves method visit coverage and adds cyclomatic complexity, a metric that determines software complexity by calculating the number of independent paths in sections of the source code.

Often employed in Agile and test-driven development environments, code coverage analysis allows developers to monitor what percentage of their source code is actually touched by unit tests by measuring how many times a line of code is executed, among other metrics.

Visual Studio users are generally familiar with Microsoft's FxCop, which profiles code against the Design Guidelines for the .NET Framework. The static code analyzer PREfast is part of Visual Studio Team System.

Microsoft also provides Dynamic Link Libraries, which enable developers to build instrumentation and data collection into their build process in the Visual Studio 2008 Team System suite and the 2008 Developer and Test editions. Visual Studio Team System 2010 will add code analysis rule sets, gated check-in and advanced dataflow rules, several aimed at stopping SQL injections.

Test code coverage analysis can often result in confusion rather than conclusions, said Daniel Waldschmidt, NCover's technology evangelist. "Traditionally, code coverage was a number -- that's what it is in Team Foundation Server right now. What does it mean? Why? Numbers have context and the context shows how things really play out."

NCover extends what Visual Studio offers, he said, by providing a broader scope, employing different methodology and offering in-depth report generation. For example, developers can drag and drop Visual Studio coverage files into NCover Explorer and automatically create charts and graphs. NCover 3.0 offers 16 new reports and a "record trends" feature that can be used to automatically create HTML reports.

Visual Studio creates a hybrid build for code analysis. "We don't inject any code -- we do it all live for you," Waldschmidt said. The NCover analysis is done at the runtime layer, enabling the tooling to support any .NET language.

While code coverage analysis can show that unit tests have been executed on significant amounts of source code, it is not indicative of the quality of unit tests. Even achieving close to 100 percent code coverage on new code does not mean there won't be any bugs or security issues. These types of tools, however, do offer dev team managers a measure of how much of the code is actually tested and metrics on how that percentage is changing during the development and production cycles.

Getting developers to write unit tests -- let alone quality unit tests -- is another matter. Microsoft is now offering more tooling to steer developers in that direction with the Microsoft Test framework (MSTest), now available in Visual Studio 2008 Professional in addition to Visual Studio Team System and the emerging ASP.NET Model-View-Controller framework.  

NCover can be used with BullseyeCoverage for native code as well as build and testing tools such as open source NAnt and NUnit in addition to MSTest. The company works closely with Wintellect, a debugging and training consultancy and Microsoft Gold Certified Partner. NCover is in the process of becoming a Visual Studio Industry Partner, according to Waldschmidt.

The commercial product is available in Classic, Complete and Complete Bundle (team) editions. NCover 3.0 Complete, which supports services, Web apps and includes the new trends and reporting features, is $658 for a Professional license. A free community edition is also available.

About the Author

Kathleen Richards is the editor of RedDevNews.com and executive editor of Visual Studio Magazine.

comments powered by Disqus

Featured

  • Poisson Regression Using C#

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demo of Poisson regression, where the goal is to predict a count of things arriving, such as the number of telephone calls received in a 10-minute interval at a call center. When your source data is close to mathematically Poisson distributed, Poisson regression is simple and effective.

  • Cloud-Focused .NET Aspire 9.1 Released

    Along with .NET 10 Preview 1, Microsoft released.NET Aspire 9.1, the latest update to its opinionated, cloud-ready stack for building resilient, observable, and configurable cloud-native applications with .NET.

  • Microsoft Ships First .NET 10 Preview

    Microsoft shipped .NET 10 Preview 1, introducing a raft of improvements and fixes across performance, libraries, and the developer experience.

  • C# Dev Kit Previews .NET Aspire Orchestration

    Microsoft's dev team has been busy updating the C# Dev Kit, a Visual Studio Code extension that enhances the C# development experience by providing tools for managing, debugging, and editing C# projects.

  • Hands On: New VS Code Insiders Build Creates Web Page from Image in Seconds

    New Vision support with GitHub Copilot in the latest Visual Studio Code Insiders build takes a user-supplied mockup image and creates a web page from it in seconds, handling all the HTML and CSS.

Subscribe on YouTube

Upcoming Training Events