Kent Beck divides Extreme Programming Explained up into Values, Principles and Practices.
This will not be an in-depth review of the entire book, which is so packed with wisdom and nuggets of insight that it would quickly become a lengthy essay.
I’m instead going to focus specifically on Practices as a jumping off point, and how I believe they change in the AI world we now live in.
Test Driven Development
(Or, as it’s referred to in Extreme Programming Explained, Test-First Programming.)
I believe that TDD as a practice shines even brighter when writing code assisted by AI.
By writing a test before you write any code, you are essentially ‘prompting’ the AI code generator with exactly the functionality you want.
By keeping the context window very small and focused, you tend to keep the generated code quality high.
You also get immediate feedback via the tests if you stray off course.
The reduction in cognitive overload that TDD provides for humans also benefits AI.
Once you’ve got a couple of core tests down, having AI ‘autocomplete’ some of the extra cases is also a massive time saver - although of course, this way danger also lies.
If the AI is doing more than copy-pasting existing tests with small tweaks, you must check the output very carefully.
As is often the case, AI acts as an amplifier rather than an augmentor. Since I’m a seasoned TDD-er who already knows what I want to write, I’m essentially using AI as a superpowered autocomplete, hence the productivity gains are significant.
But I’d be curious to see how non-technical folks might be able to embrace the TDD mindset to get the most out of their vibe-coding forays.
In a sense, vibe coding is a form of exercise in TDD - ‘I want an app that texts me when my nearest cafe opens’ is a prompt, but it is also defining an expected outcome.
If non-technical folks could start off more granular, adding layers of functionality one small prompt at a time in the same way you’d write individual unit tests for code, they may get further through the last 30% than they currently do.
I’d love to hear from anyone who tries this or would like some help giving it a go.
Next time: Pair Programming.
Does Pair Programming make sense in the AI era?
Perhaps one of the most potent practices XP encourages, and also in my experience the most consistently underrated, is pair programming.