Test & Code

118: Code Coverage and 100% Coverage


Listen Later

Code Coverage or Test Coverage is a way to measure what lines of code and branches in your code that are utilized during testing. 
 Coverage tools are an important part of software engineering. 

But there's also lots of different opinions about using it. 

  • Should you try for 100% coverage? 
  • What code can and should you exclude? 
  • What about targets?

I've been asked many times what I think about code coverage or test coverage.
 This episode is a train of thought brain dump on what I think about code coverage.

We'll talk about:

  • how I use code coverage to help me write source code
  • line coverage and branch coverage
  • behavior coverage
  • using tests to ask and answer questions about the system under test
  • how to target coverage just to the code you care about
  • excluding code
  • good reasons and bad reasons to exclude code

And also the Pareto Principle or 80/20 rule, and the law of diminishing returns and how that applies (or doesn't) to test coverage.


Links:

  • Coverage.py
  • pytest-cov



...more
View all episodesView all episodes
Download on the App Store

Test & CodeBy Brian Okken

  • 4.7
  • 4.7
  • 4.7
  • 4.7
  • 4.7

4.7

70 ratings


More shows like Test & Code

View all
Radiolab by WNYC Studios

Radiolab

43,838 Listeners

Software Engineering Daily by Software Engineering Daily

Software Engineering Daily

623 Listeners

Heavy Networking by Packet Pushers

Heavy Networking

327 Listeners

Talk Python To Me by Michael Kennedy

Talk Python To Me

585 Listeners

Python Bytes by Michael Kennedy and Brian Okken

Python Bytes

215 Listeners

Darknet Diaries by Jack Rhysider

Darknet Diaries

8,035 Listeners

The Real Python Podcast by Real Python

The Real Python Podcast

142 Listeners

Unexplainable by Vox

Unexplainable

2,308 Listeners

Network Automation Nerds by Packet Pushers

Network Automation Nerds

3 Listeners