How do you calculate test coverage? To calculate test coverage, you can divide the number of lines covered by a test by the total number of lines in your application’s test code. Other useful terms and definition What is a good test coverage? What is 100% coverage in software testing? Is 100% test coverage a good idea?