playbookCraftsmanship Low-Level~1 min readUpdated 2026-06-21#craftsmanship#tdd#testing#fuzzing#always-on

Craftsmanship Low-Level

Software craftsmanship — TDD, clean code, XP — was built in managed languages where a failing test is a red bar, not a corrupted heap. This always-on branch carries that discipline down to the metal: how do you do TDD when a bug can scribble over memory? What does a unit test look like in C? How do you review code where a missing free is a leak and a stray pointer is a crash? These are playbooks, not theory — the habits that keep bare-metal work honest.

The discipline doesn't get weaker as the language gets sharper — it gets more important. Tests, contracts, and sanitizers are how you stay fast in C without being reckless.

Planned playbooks

  • TDD in C/C++: the red-green-refactor loop, adapted
  • Testing frameworks: Unity (C), Catch2 and GoogleTest (C++)
  • Test doubles and seams in C
  • Contracts: assert, preconditions, and invariants
  • Defensive programming (without paranoia)
  • Fuzzing with libFuzzer and AFL++
  • Sanitizers as part of the test loop
  • Code review for memory-unsafe code
  • Refactoring legacy C safely (Feathers' techniques)
  • Clean code at the bare metal
  • Build hygiene: warnings-as-errors and CI for C/C++
  • SerenityOS as a disciplined-OS case study

Core sources

  • James Grenning — Test-Driven Development for Embedded C — the spine; TDD where it's hardest.
  • GoogleTest, Catch2, and Unity docs — the C/C++ testing frameworks.
  • Michael Feathers — Working Effectively with Legacy Code — seams and safe refactoring.
  • libFuzzer (llvm.org/docs/LibFuzzer.html) and AFL++ (aflplus.plus) — coverage-guided fuzzing.
  • SerenityOS (github.com/SerenityOS/serenity) — a from-scratch OS built with real engineering discipline.

Connects to: Pointers & Memory · Toolchain & Linking · Modern C++ · OS from Scratch