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

  • AI for GitHub Collaboration? Maybe Not So Much

    No doubt GitHub Copilot has been a boon for developers, but AI might not be the best tool for collaboration, according to developers weighing in on a recent social media post from the GitHub team.

  • Visual Studio 2022 Getting VS Code 'Command Palette' Equivalent

    As any Visual Studio Code user knows, the editor's command palette is a powerful tool for getting things done quickly, without having to navigate through menus and dialogs. Now, we learn how an equivalent is coming for Microsoft's flagship Visual Studio IDE, invoked by the same familiar Ctrl+Shift+P keyboard shortcut.

  • .NET 9 Preview 3: 'I've Been Waiting 9 Years for This API!'

    Microsoft's third preview of .NET 9 sees a lot of minor tweaks and fixes with no earth-shaking new functionality, but little things can be important to individual developers.

  • Data Anomaly Detection Using a Neural Autoencoder with C#

    Dr. James McCaffrey of Microsoft Research tackles the process of examining a set of source data to find data items that are different in some way from the majority of the source items.

  • What's New for Python, Java in Visual Studio Code

    Microsoft announced March 2024 updates to its Python and Java extensions for Visual Studio Code, the open source-based, cross-platform code editor that has repeatedly been named the No. 1 tool in major development surveys.

Subscribe on YouTube