A useful tool in projects with code testing is to be able to analyze how much of a C# script class is being tested. For example, is every method being tested with at least 1 set of test data? Unity now offers a Code Coverage feature, which we'll explore in this final code testing recipe. As shown in the following screenshot, Unity allows us to create a set of HTML pages for documenting the Code Coverage of tests against C# code. With this, we can see what percentage of our code is covered by tests, and even which lines of code are, and are not, covered by our tests:
Figure 13.31 – Code Coverage HTML report for the Player script class