altcover.visualizer 8.8.53 (2024)

A global tool for displaying code coverage in a number of formats (NCover 1.x, OpenCover, LCov, Cobertura, coverlet,...), using the the cross-platform AvaloniaUI toolkit

altcover.visualizer 8.8.53 (1)

User Guide

Full wiki page here

Here's the simple naming of parts

altcover.visualizer 8.8.53 (2)

The recently accessed list is a drop-down for quick access to coverage files of current interest. The Refresh option is there for reloading the file you're currently examining e.g. after doing another test run.

The tree view opens with just the node for the coverage file shown. Drill down to the method of interest and double-click to load the appropriate source file.

The tree view shows the structure of the assemblies in the report, including virtual groupings for modules (classes that only contain classes, so have no presence in the XML reports), for properties (get_ and/or set_), and for events (add_ and/or remove_). Also where a type is just a function (i.e. only has an Invoke method), there is separate icon for that.

Colouring

A painter's algorithm approach is used -- first the whole source file is drawn, then the covered sections, then the un-covered ones, and finally any special cases. This approach ensures that the uncovered code is shown explicitly and is not obscured when some of the line, or a multi-line enclosing sequence point, happens to be covered : it's the unflattering view for engineers, rather than the sea of green for managers.

If the coverage file contains branch information, then an icon is shown in the left margin, in red-on-white for uncovered, black-on-yellow for partial coverage and black-on-pale green for complete coverage, with the details in tool-tip text for that icon.

The source is rendered by default in grey-on-whitesmoke; covered sequence-points are painted a medium blue, and then uncovered code is painted in crimson.

With coverage generated from AltCover with the --showstatic option, normally ignored code like auto-properties is shown in the report, and if not covered will appear as black, and with the --showGenerated option other code marked as [GeneratedCode] or [CompilerGenerated] shows as gold if not covered.

altcover.visualizer 8.8.53 (3)

For purposes of demonstration, one test method here has been manually decorated with the [GeneratedCode] attribute; if the system under test uses code generation, marking it as such should be standard practice.

Source display font

From v7.1.783, this visualizer version also offers some limited font selection for source display

altcover.visualizer 8.8.53 (4)

  • On Windows, this uses the native FontChooser() API, restricting to monospace fonts (the default is "Courier New Normal 10")
  • Otherwise if the Tcl/Tk wish shell (assumed to be Tcl/Tk v8.6 or later) is on the PATH, the toolbar-icon is also shown. In the latter case, this spawns wish as a separate process to use its cross-platform font selection support; terminating the process when either a font selection is made (e.g. via Okor Apply), or the selection dialog is dismissed. There are no APIs there to restrict the font chooser to monospace fonts, so choose wisely (the default is "Monospace Normal 10")

Continuous Integration

BuildGitHub altcover.visualizer 8.8.53 (5)altcover.visualizer 8.8.53 (6)
Test coverageCoveralls altcover.visualizer 8.8.53 (7)

Other NuGet Packages in this suite

  • General purpose install -- excludes the dotnet test API with FAKE and CAKE integration and the AvaloniaUI visualizer
  • API install -- excludes the visualizer in all forms
  • dotnet global tool install -- excludes the visualizer in all forms
  • FAKE build task utilities -- just AltCover related helper types for FAKE scripts (v5.23.0 or later), only in this package
  • Cake build task utilities -- just AltCover related helper types for Cake scripts (v2.0.0 or later), only in this package

This package has no dependencies.

This build from https://github.com/SteveGilham/altcover/tree/dad881f0e4bc930314670bd35e509764f2ecb9f3

Q. Never mind the fluff -- how do I get started?
A. Start with the Quick Start guide : https://github.com/SteveGilham/altcover/wiki/QuickStart-Guide and
read the FAQ : https://github.com/SteveGilham/altcover/wiki/FAQ

8.8.53 (Habu series release 29)
•[BUGFIX] Fix summary data for --outputFile option
•[BUGFIX] Fix interaction of --zipFile prepare option and --outputFile collect option
•[BUGFIX] Issue #220 - improve dependency resolution to the GAC

8.8.21 (Habu series release 28)
•[BREAKING; BUGFIX] Issue #206 : Update to net6+ for dotnet test integration and respect the $(IsTestProject) setting from the Microsoft.NET.Test.Sdk package.
•Simplify the use of the AltCover MSBuild tasks via the associated package-level .targets file by not even including the VSTest integration unless both '$(AltCover)' == 'true' AND '$(IsTestProject)' == 'true'.
•Mitigate instances of System.IO.IOException: The process cannot access the file '[coverage report]' because it is being used by another process.
•Explicitly add GAC locations to the paths inspected for dependency resolution

8.8.10 (Habu series release 27)
•[BUGFIX] Add Json member to the report format enumerations for the typesafe API and for the InvokeAltCover cmdlet.
•[BUGFIX] Issue #214 : patch Mono.Cecil to use FIPS compliant algorithm
•[Enhancement] Discussion #206, maybe also Issue #203 : Option --portable and equivalent APIs to place the coverage report file and related coverage data in the same folder as the recorder assembly, wherever that might be, allowing the whole instrumented folder structure to be moved into another file structure (e.g. different machine, different OS).

8.7.3 (Habu series release 26)
•[Enhancement] Discussion 202 : More careful tidying of temporary .runsettings files, fixing long-standing errors of both commission and omission.
•[Enhancement] Discussion 199 : Add /p:AltCoverOutputRoot=[path] and associated APIs for dotnet test command line creation. The [path] is a directory to be used instead of $(TargetDir) for the relative placing of the instrumented or saved files. The use-case here is when $(TargetDir) is close to MAX_PATH and the generated sub-folders would overflow that limit.

For previous releases (8.6.125 and earlier) go here -- https://github.com/SteveGilham/altcover/blob/master/ReleaseNotes%20-%20Previously.md

altcover.visualizer 8.8.53 (2024)
Top Articles
Latest Posts
Article information

Author: Otha Schamberger

Last Updated:

Views: 6590

Rating: 4.4 / 5 (55 voted)

Reviews: 94% of readers found this page helpful

Author information

Name: Otha Schamberger

Birthday: 1999-08-15

Address: Suite 490 606 Hammes Ferry, Carterhaven, IL 62290

Phone: +8557035444877

Job: Forward IT Agent

Hobby: Fishing, Flying, Jewelry making, Digital arts, Sand art, Parkour, tabletop games

Introduction: My name is Otha Schamberger, I am a vast, good, healthy, cheerful, energetic, gorgeous, magnificent person who loves writing and wants to share my knowledge and understanding with you.