~/talk

Testing Your Tests With Code Coverage

Talkat ACCU 2021 Online · 2021-03-10..03-13· [testing]
slides:none on file

Build tests with coverage flags (GCC writes .gcno/.gcda alongside object files), run the test suite (coverage data is cumulative), then run gcov to generate per-file annotated sources that show line counts, hashes for never-executed lines, and a summary percentage. Example run shows 55.56% for a tiny class with uncalled functions g and h and an unused constructor parameter; fill gaps or document unreachable code. Integrate report generation into CI and fail or warn builds when coverage thresholds (e.g. gcov/genhtml) are not met.

AI-written summary · about

  1. 0:00Why bother testing? • Testing improves quality
  2. 2:02Example library/class
  3. 2:56Example test suite
  4. 4:45Generating coverage data
  5. 5:42New file - *.gcda
  6. 8:06Understanding the coverage report
  7. 11:03Benefits of checking code coverage
  8. 14:27Questions?
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.