Dotnet Coverage for Manual Tests

Code coverage tools are a well known way to find untested code when working with automated tests. I have recently learned that these tools can also be used when performing manual tests. I know, it sounds obvious, but for some reason I have never even considered it. And it turns out that its incredible easy to do using dotnet-coverage. The official repository contains a few sweet examples.

Here is another one:

# Setup
git clone https://github.com/fwinkelbauer/chunkyard
cd chunkyard/src/Chunkyard
dotnet tool install --global dotnet-coverage
dotnet build

# Start coverage
dotnet-coverage collect --session-id my-session --server-mode --background --include-files **/*.dll

# Perform manual tests
dotnet run -- store --help
dotnet run -- store --repository example --paths . --preview

# Create coverage report "output.coverage"
dotnet-coverage shutdown my-session

Published: 2024-08-10