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.

      Sponsored By:

      • PyCharm Professional: Try PyCharm Pro for 4 months and learn how PyCharm will save you time. Promo Code: TESTANDCODE22

      Links:

      • Coverage.py
      • pytest-cov
      ★ Support this podcast on Patreon ★
      ...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
      Software Engineering Radio - the podcast for professional software developers by se-radio@computer.org

      Software Engineering Radio - the podcast for professional software developers

      272 Listeners

      The Changelog: Software Development, Open Source by Changelog Media

      The Changelog: Software Development, Open Source

      283 Listeners

      Thoughtworks Technology Podcast by Thoughtworks

      Thoughtworks Technology Podcast

      41 Listeners

      Data Skeptic by Kyle Polich

      Data Skeptic

      483 Listeners

      Talk Python To Me by Michael Kennedy

      Talk Python To Me

      592 Listeners

      Software Engineering Daily by Software Engineering Daily

      Software Engineering Daily

      625 Listeners

      Soft Skills Engineering by Jamison Dance and Dave Smith

      Soft Skills Engineering

      269 Listeners

      Python Bytes by Michael Kennedy and Brian Okken

      Python Bytes

      213 Listeners

      Data Engineering Podcast by Tobias Macey

      Data Engineering Podcast

      142 Listeners

      Syntax - Tasty Web Development Treats by Wes Bos & Scott Tolinski - Full Stack JavaScript Web Developers

      Syntax - Tasty Web Development Treats

      981 Listeners

      Practical AI by Practical AI LLC

      Practical AI

      190 Listeners

      The Stack Overflow Podcast by The Stack Overflow Podcast

      The Stack Overflow Podcast

      64 Listeners

      The Real Python Podcast by Real Python

      The Real Python Podcast

      140 Listeners

      Oxide and Friends by Oxide Computer Company

      Oxide and Friends

      47 Listeners

      The Pragmatic Engineer by Gergely Orosz

      The Pragmatic Engineer

      52 Listeners