Kick off your book project in 3 hours! Live workshop on Zoom. You’ll leave with a real book project, progress on your first chapter, and a clear plan to keep going. Saturday, May 2, 2026. Learn more…

Leanpub Header

Skip to main content

Lean TDD

TDD Without the Waste - version 0.6.1

Test Driven Development, TDD, changed the way we think about developing software. But somewhere in the last 25 years, much of the original message was lost and wasteful practices crept in.

Today, software projects move very quickly, especially with the addition of tools like AI assisted IDE copilots and agentic coding.

Does it still make sense to use TDD? Yes! Even more so today than ever before.

We still want to build quality software. And now more than ever, we need the guard rails of an automated testing suite to keep agents on track.

However, the approach we need to take with our test code is different. We need to trim the waste and focus just on the tests that tell us how the software behaves. We need to rethink TDD. Ironically, the best thing we can do is go back to TDD's original language, focus more on high level tests, and combine acceptance tests with developer tests. But honestly, that's what TDD was about all along.

TDD shouldn't slow you down. Lean TDD strips the waste from Test Driven Development and keeps what actually makes you faster. Whether you're using AI agents or coding by hand, flying solo or on a team, this book will help you ship faster, with fewer bugs, and stay agile.

Minimum price

$9.99

$14.99

You pay

$14.99

Author earns

$11.99
$
You can also buy this book with 1 book credit. Get book credits with a Reader Membership or an Organization Membership for your team.
PDF
EPUB
WEB
About

About

About the Book

TDD is supposed to make you faster. So why does it feel like extra work?

Because a lot of TDD advice adds waste — heavy mocking, testing every internal function in isolation, rigid micro-steps that slow you down instead of helping you ship. Lean TDD strips that away. Using Lean principles of identifying value and eliminating waste, this book rebuilds TDD into what it should have been all along: a way to develop code faster, catch bugs earlier, and refactor without fear.

You'll learn the different interpretations of TDD that have emerged over the past 25 years, see which practices actually help and which just add ceremony, and walk away with a pragmatic approach that works whether you're coding by hand or with AI, solo or on a team.

This is a short book. It's meant to change how you work, not sit on a shelf.

Author

About the Author

Brian Okken

Lead Software Engineer.

Find me at pythontest.com

Author of Python Testing with pytest

Host of Python Bytes, Test and Code, and Python People podcasts.

Contents

Table of Contents

Introduction

From Waterfall to Agile

  1. Waterfall
  2. Agile
  3. But are we agile?

Test Driven Development

  1. What is TDD?
  2. TDD Interpretations
  3. Clarification with “Canon TDD”
  4. Developer tests
  5. Understanding the Why of TDD
  6. Missing from TDD

Why write tests?

  1. 1. Quality
  2. 2. Agility / Flexibility
  3. 3. Efficiency
  4. 4. Learning
  5. 5. Design

Lean Software Development

  1. Why Lean is important for TDD
  2. Lean
  3. Lean Software Development
  4. Lean Principles
  5. Eliminate Waste
  6. Why consider types of waste?
  7. Tradeoffs
  8. Are Tests Waste?
  9. Don’t go crazy with waste reduction

TDD Interpretations

  1. Classical vs Mockist TDD
  2. BDD - Behavior Driven Development
  3. BDD with vegetables
  4. ATDD - Acceptance Test Driven Development
  5. Double loop TDD
  6. Bones-out
  7. Other Major Splits in TDD

Testing Pyramid, Trophy, and Other Shapes

  1. Testing Pyramid
  2. Misunderstandings of the Test Pyramid
  3. Flipped Pyramid
  4. Testing Trophy
  5. My Recommendation

Lean TDD

  1. The Steps
  2. Bones-out vs Top-Down or Bottom-Up
  3. What about more complex systems?
  4. Designing the system to allow using the Testing Trophy
  5. Using the Testing Trophy
  6. Static Analysis
  7. A single test suite

Applying Lean TDD in Practice

  1. Organizing the Test Suite
  2. Split the suite into smaller pieces
  3. Splitting up layers between people
  4. Make sure every test in the test suite is readable and runnable by anyone on the team
  5. Tests tell a story
  6. Remembering Lean
  7. Considerations for teams

Lean TDD and AI

  1. Keep an eye on test modifications
  2. Red/Green TDD
  3. Do you keep the unit tests generated by agents?
  4. Refactoring is even more important
  5. Keeping simple designs

Q&A

  1. But I like my unit tests
  2. Where does design happen?
  3. Do I really have to write the test first?
  4. Why only one test at a time?
  5. During refactoring, should I write more tests?
  6. Do I have to refactor all the time?
  7. How do I apply Lean TDD to an existing codebase with no tests?
  8. Are there cases where TDD shouldn’t be used?

Conclusion

  1. Try This Monday Morning
  2. Keep in Touch

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.

You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!

So, there's no reason not to click the Add to Cart button, is there?

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earned over $15 million writing, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub