TDD

Run Once, Run Away (RORA) Even Bites Pros

TDD Pro-Tip: RORA (Run Once, Run Away) is insidious, and although I am an old-guard agilist, I still have to actively resist its charms every day. Alright, well, look, I figured out after some helpful application of 2×4’s to the head, that I needed to phrase these pro-tips as advice to me, even when, as occasionally, in my heart of hearts, I thought of it as advice for you. This is not one of those cases. I’ve been working on […]

Run Once, Run Away (RORA) Even Bites Pros See Full Post

Steering Around The Pyramid Problem

TDD Pro-Tip: An important steerability force for me is in my strategies for sidestepping the pyramid problem. There are a lot of ways we could describe this "pyramid problem". Perhaps the most straightforward way is to ask how much code is "in play" during a test. At some point, and it varies by codebase, the answer becomes "a lot". When it does, you’re encountering the pyramid problem. I call it the pyramid problem because I see code as great big

Steering Around The Pyramid Problem See Full Post

TDD Pro-Tip: Make Hard Problems Collections Of Toy Problems

Because TDD’ing little toy problems is so easy, I try to turn my big real-world problems into collections of them. Yeah, it’s the steering premise rearing it’s ugly head again, though maybe from a different angle than we’ve undertaken before. (The short premises video is here) A lot of folks claim that TDD is just fine as long as you don’t work on their kind of problem. They mean that their daily bread is made from problems that are VERY

TDD Pro-Tip: Make Hard Problems Collections Of Toy Problems See Full Post

Refactor Your Tests

TDD Pro-Tip: I spend considerable effort making it possible not only to implement a test I want, but to make that test easy to read, to write, to run, and to debug. I’ve talked a lot about five premises of TDD. The money premise, the steering premise, and the chaining premise all get involved when we come to the coding of the tests. We do TDD to ship more value faster, the money premise. What makes it able to do

Refactor Your Tests See Full Post

Geekery Pro-Tip: Think Less, Sense More

Geekery Pro-Tip: I frequently remind myself: Think Less, Sense More. It’s advice I give to me all over the place, from the most technical parts of the sociotechnical fractal to the most social parts of it. It’s an odd thing to say, so we better dig in to it a little. I’ve recently come from a conference. This was a good one for me, full of old friends and new, smart crazy passionate people coming together to figure out what

Geekery Pro-Tip: Think Less, Sense More See Full Post

TDD Pro-Tip: Design Until Nervous Optimism

TDD Pro-Tip: Before I write the first test in a new context, I usually design until I get to a state of "Nervous Optimism". A couple of days ago, I was party to some drinking geekery with my colleagues at a hookah bar restaurant dance club. It was the end of a long day, and we were unwinding and being pretty silly. My three partners in crime mobbed on "Evil Hangman", a fun little game. And I sat off to

TDD Pro-Tip: Design Until Nervous Optimism See Full Post

TDD Pro-Tip: Stay Aware Of Testing Data

TDD Pro-Tip: I stay very aware of my testing context’s data, and specifically of what data is opaque and what data is transparent. Those terms, transparent and opaque, need a little explanation. Sometimes the code I’m testing doesn’t vary based on the entirety of its input. A trivial example, the function that validates the date of an order DOES NOT CARE what any other field in that order is or does. It only cares about the date field. I would

TDD Pro-Tip: Stay Aware Of Testing Data See Full Post

Pro-Tip (TDD): Focus on Our Branching Logic

TDD Pro-Tip: What we TDD most rigorously and faithfully is our branching logic. This is the insight one needs to start gaining TDD’s massive productivity benefit. All three terms are important, "our", "branching", and "logic", so let’s take them one at a time. Remember as we forge in to this: there is no free lunch, but if there were a free lunch, writing a test ain’t it. Every test we write costs something and benefits something. We need that benefit

Pro-Tip (TDD): Focus on Our Branching Logic See Full Post

TDD Pro-Tip: Wrap Containers Early & Often

TDD Pro-Tip: Wrap framework collection classes early and often. The Primitive Obsession smell is ubiquitous around collections, and not seeing and fixing it can greatly hamper productivity. In HollywoodSimulator, a common act of every Person is to spend time manipulating their little black book — the collection of the contacts they have. The first-pass way to represent this would be to use a framework collection class. In Java/Kotlin, that’s List<Person>. List<Person> is not a primitive, far from it, in Java

TDD Pro-Tip: Wrap Containers Early & Often See Full Post

TDD Pro-Tip: Test-Before Is Operationally Different

TDD Pro-Tip: Because the power of TDD is operational rather than artifactual, test-before provides several benefits over test-after. Sometimes folks propose the writing of tests after the code is written. The idea here is that the point of the game is to have the tests, and that it makes no difference whether we do them before we write the code or after. This idea is flawed: it centers TDD around the artifact — the made test — rather than the

TDD Pro-Tip: Test-Before Is Operationally Different See Full Post

Scroll to Top