Rules

Secret ingredients to quality software

Do you use Live Unit Testing to see code coverage?

Last updated by Brady Stroud [SSW] on 07 Jul 2021 12:43 am (5 months ago) See History

Visual Studio 2017 introduces a new feature called Live Unit Testing. This gives the developer insight into code coverage of the file that they are working on, so they can quickly and easily see if there’s a unit test that covers the code they are working on.

lut codecoverage1
Figure: Enable it by selecting Test | Live Unit Testing | Start

lut codecoverage2
Figure: Bad Example – This method isn't covered by any unit tests, so the developer should consider writing a unit test for it

lut codecoverage3
Figure: The developer can right click and create a test immediately

lut codecoverage4
Figure: Good Example – Developer can see that the code is covered by 2 passing tests and one failing test

For more details see Joe Morris’s video on .NET Tooling Improvements Overview – Live Unit Testing

Adam CoganAdam Cogan

We open source. Powered by GitHub