End-to-End Debug Object Modeling – First Hard Problem in Building DDTJ: Day 4

Yesterday I got the second PR out of the door (and the 3rd although that was automated). Today wasn't as productive.

Winter just started in full force around these parts, and yesterday, everything was flooded. This slowed down some of my work, especially after my son's kindergarten was flooded and he had to stay home. Still, I could make progress thanks to the fact that the code now runs end to end. That means I can start debugging the whole thing by using the command line and setting a breakpoint in the backend. Very convenient.

Code Coverage vs Test Coverage — Which Is Better?

Make sure you stay covered!

Test Coverage and Code coverage are the most popular methodologies for measuring the effectiveness of the code. Though these terms are sometimes used interchangeably since their underlying principles are the same. But they are not as similar as you may think.

Many times, I have noticed the testing team and development team being confused over the use of these two terminologies. This is why I thought of coming up with an article to talk about the differences between code coverage and test coverage in detail.

ASP.NET Core Code Coverage Reports On Azure DevOps

After making ASP.NET Core code coverage reports work on a local box, I took it a step further and made code coverage reports available also on Azure DevOps. This blog post shows how to generate code coverage reports for .NET and ASP.NET Core applications on Azure DevOps.

Getting Started

This blog post expects that there is .NET or ASP.NET Core project with unit tests and code coverage reports. It also assumes the existence of an Azure DevOps build pipeline that is connected to a source code repository. It's covered well on a previous blog post about automated testing, "Code coverage reports for ASP.NET Core."

Code Coverage Reports for ASP.NET Core

Code coverage reports for ASP.NET Core projects are not provided out-of-the-box, but by using the right tools we can build decent code coverage reports. I needed code coverage reports in some of my projects and here is how I made things work using different free libraries and packages.

Getting Started

To get started, we need a test project and some NuGet packages. Test project can be a regular .NET Core library project. Adda reference to web application project and write some unit tests if you start with a new test project. We also need some NuGet packages to make things work:

Don’t Measure Unit Test Code Coverage

If you're using test-driven development, don't measure unit test code coverage. It's worse than a useless statistic; it will actively lead you astray.

What should you do instead? That depends on what you want to accomplish.

What If ”Rules” Applied In Our Daily Efforts?

Being a casual fan of professional sports, I probably favor (United States) football and hockey over any other options available to me. At this point in the National Football League (NFL), the final teams are gearing up for the "big game" to determine who is the champion for the season. I hesitate to say "world champion" since this is a statement that I have never understood. I mean, what other countries are actually participating this season?

At the heart of any sport, is a collection of rules. A rule book. Albeit quite involved, the goal is to establish guidelines for the sport and provide a central point where competitors can comprehend what is considered legal play and what is considered an infraction.