Life, The Universe, and Everything

Clean Code, Episode 42 part 2

By Robert C. Martin

47 minJul 2016


Don't Panic.

Grab your towel and settle in, because this episode is a two-parter.

You knew it had to be this way, didn't you? I mean, 42!

"Life, the universe, and everything."

That's the question we are answering in this two-part episode. I've given this a lot of deep thought and this episode is the answer. Really. I mean it.

And I'm not going to fall back on the question of the question. No mice. No dolphins. No sperm whales and flower pots. No cat lullabies.

Nope. This time it is right. This time it will work, and no one will have to get nailed to anything. And no Vogons will wreck it all.

The answer will be given in the first few moments of the video. I promise. And it is the answer. Once you hear it, you'll know it.

The rest of the two part episode will be about how to apply that answer to software. To do that, we're going to look at a lot of code, a lot of coding, and a lot of testing techniques.

The focus of all that code will be Ward Cunningham's FIT framework.

Part 1

  1. The Answer—Short, sweet, but right.
  2. The Phases of Matter—Our obligatory science lecture discussing why matter (water in particular) exists in three different phases: solid, liquid, and gas.
  3. Code Coverage—Do you now how much of your project is covered by tests? Do you know how much should be covered by tests?
  4. Covering Action Fixture—A deep dive in which we cover some untested parts of Ward Cunningham's FIT framework with tests.

Part 2

  1. Mutation Testing—How do you know that the covering tests actually test anything? Here we use the PiTest tool to find parts of the code that are "covered" but aren't actually tested.
  2. Cleaning—Now that it's covered, and we know the coverage means something, let's clean it up.
  3. Semantic Stability—For software, this is the answer: Tests that truly stabilize the semantic behavior of the system.
  4. Conclusion—Tying things up in a pretty bow.