The Pieces Premise | #97

PawCast with GeePaw Hill - A podcast by GeePaw Hill

Categories:

The Pieces Premise says, "To get the whole thing to do what you want, start by getting each piece of it to do what you want. It's one of the basic underpinning of microtest TDD. The idea behind the pieces premise is actually pretty straightforward. All programs are divided into pieces, separate parts, each of which performs some behavior the program needs. If the pieces don't work, the whole won't work. I have seen a lot of struggling TDD efforts in my time. A great many of them start off well and end poorly, and it's very often because the Pieces Premise is not sufficiently understood by the would-be practitioners. Imagine a class. (Or a function, or a subroutine, or a module, or whatever level of decomposition you use in your environment.) Let's call it S, for "Simple". Its guts use only basic logic and primitives from your language. Classes like this are what we start nearly all first-time TDD'ers on. You write a test, you make it pass, you design it optimally. Rinse, lather, repeat. And when you do this, I'll be damned, you find that TDD is pretty cool. --- You can read the full transcription of this podcast over on GeePawHill.org. Any feedback, you can always tweet @GeePawHill on Twitter, or drop a voice message via the voice messages link here on Anchor. If you are interested in becoming more involved in the Change-Harvesting community, click here to learn how to join GeePaw's Camerata.