programs. applied.

Patch provides expert programming, training, and consulting services.

Latest blog posts

Notes on coverage

This post is a collection of notes and (slightly cleaned up) summary of the research that went into my talk Mastering MC/DC from First Principles at Techtown this year.

The history of code coverage

The idea of code coverage is actually quite old. The oldest reference I found is the 1963 paper Systematic Mistake Analysis of Digital Computer Programs. Going through its references I also found another gem, A Control System For Logical Block Diagnosis With Data Loading, from 1960. This paper describes a system for writing tests for programs and running them, and it is fascinating just how sharp the observations were and how they are still true today. Here are a few quotes.

Upcoming events, Techtown and Tokyo

In just a few short weeks it is time for the annual NDC Techtown conference where I this year will be giving the talk Mastering MC/DC from first principles. It is an excellent conference; the programme is splendid and I’m quite sure there will be many interesting conversations between sessions, I truly recommend attending. Do come see my talk and come chat with me.

I will be also be giving a lecture on MC/DC in Tokyo and will be in Japan 4th-10th. If you would like to meet up, maybe have lunch or talk business, please send me an email and we’ll figure something out.

Coverage suppression merged into GCC

A few days ago I pushed support for coverage suppression in GCC. Sometimes we write very defensive guards, especially in debug builds (like asserts), that are intended to never trigger because they signal a logic bug elsewhere. It’s hard to argue that defensive code and asserts isn’t excellent, but they paradoxically introduce a problem for coverage since we now introduce decisions and code paths that will never be exercised. The new #pragma GCC suppress_coverage and __attribute__((suppress_coverage)) address this problem. GCC could already ignore files for coverage (with -fprofile-filter-files and -fprofile-exclude-files), but this is more granular.