liveBook · Manning

Test-driven development

Also called TDD, test-first development, red-green-refactor cycle, test-driven approach, test-driven design

Test-driven development is a software development practice in which tests specify expected behavior and guide incremental implementation, typically being written before the corresponding code.

How 23 Manning books explain it

Test Driven: Practical TDD and Acceptance TDD for Java Developers

Test-driven development is a software development technique in which tests are written before the code they guide and verify.

How it is used
Guides incremental programming and design through tests written before production code.
How deep it goes
Explains the red-green-refactor cycle and works through test-first development, including web components and concurrent code.
Examples
Uses a variable-substitution template engine and a login servlet with simulated requests and responses.
What you can do after
Practice test-first development in small cycles, using passing tests to support refactoring.

Read how Test Driven: Practical TDD and Acceptance TDD for Java Developers explains test-driven development →

Effective Platform Engineering

Test-driven development is a software development approach in which tests are written to specify expected behavior before implementing the corresponding code.

How it is used
Uses tests to verify infrastructure requirements after deployment and detect configuration drift in nightly checks.
How deep it goes
Works through the failing-test, implementation, and refactoring cycle, then distinguishes module integration tests from acceptance-criteria checks.
Examples
Uses Karpenter subnet tags as acceptance criteria and proposes a fitness function that rejects service layers lacking tests.
What you can do after
Practice/perform it by writing a failing infrastructure test, applying code until it passes, and retaining the test for later checks.

Read how Effective Platform Engineering explains test-driven development →

Vibe Engineering

A development practice in which automated tests are written before the production code that satisfies them.

How it is used
Applies TDD to AI-generated code by defining correctness before implementation and verification before merge.
How deep it goes
Explains test-first ordering and its rationale, then extends the rhythm to feature contracts and verification gates.
Examples
Uses an ISBN-13 validator test suite covering valid formats, invalid checksums, length, and nonnumeric characters.
What you can do after
Apply test-first verification to AI-generated functions and evaluate whether broader feature contracts cover critical behavior.

Read how Vibe Engineering explains test-driven development →

The Art of Unit Testing 3e

A development technique in which a failing test is written before the production code that makes it pass, followed by refactoring or another test.

How it is used
Uses test-first development to build functionality incrementally while checking that tests detect missing behavior.
How deep it goes
Walks through the fail–pass–refactor cycle and its cautions, but stops short of an extended TDD treatment.
Examples
Illustrates the repeating cycle with a process figure and a test that should fail before functionality is added.
What you can do after
Practice/perform it by writing a failing test, making it pass through production code, and refactoring with tests running.

Read how The Art of Unit Testing 3e explains test-driven development →

Build High Value Software Systems

A development practice in which failing tests are written before implementation and then used to guide code until the tests pass.

How it is used
Defines correctness before implementation so failing tests guide the behavior built and expose misalignment early.
How deep it goes
Works through failing API tests and a shipping assertion, then gives unit-test quality criteria; stops short of a full implementation.
Examples
Shows a 501 API stub facing 200 and 404 tests, plus payment and domestic-shipping assertions.
What you can do after
Practice/perform test-first development by specifying failing behavior, implementing only what it requires, and maintaining fast, refactor-stable tests.

Read how Build High Value Software Systems explains test-driven development →

Web Components in Action

Test-driven development is a software development methodology in which tests are written alongside or before the implementation they validate.

How it is used
Uses tests alongside component implementation to verify discrete behavior and meaningful browser-visible outcomes.
How deep it goes
Explains unit-oriented testing, browser execution, test suites, assertions, and failing boundary cases without surveying testing broadly.
Examples
Tests a slider's initial value, JavaScript updates, rendered position, and maximum and minimum boundaries.
What you can do after
Apply TDD with Web Component Tester by organizing suites, writing assertions, and exposing missing component behavior.

Read how Web Components in Action explains test-driven development →

Learn Rust in a Month of Lunches

Test-driven development is a software development technique in which tests are written before implementation code and guide the implementation toward passing behavior.

How it is used
Uses tests written first to clarify desired behavior and guide implementation.
How deep it goes
Walks through writing failing tests, implementing behavior, adding cases, and considering refactoring, while leaving further cleanup undone.
Examples
Builds a subtraction calculator from tests for arithmetic, trailing characters, and invalid input.
What you can do after
Practice writing tests first and using failures to guide implementation and later changes.

Read how Learn Rust in a Month of Lunches explains test-driven development →

Build Financial Software with Generative AI (From Scratch)

Test-driven development is a software-development practice in which tests are written before or alongside implementation and guide short implementation cycles.

How it is used
Uses TDD to guide incremental financial-software development and verify hand-written and AI-generated code.
How deep it goes
Works through failing tests and minimal implementations, while also allowing a looser mix of testing and coding.
Examples
Uses ACH file reading, a batches API returning 404 before implementation, and a parser exception stored in a database.
What you can do after
Practice writing a failing test, adding the required logic, and rerunning the test during an incremental development cycle.

Read how Build Financial Software with Generative AI (From Scratch) explains test-driven development →

BDD in Action, Second Edition

Test-driven development is a software development technique in which automated tests are created before the implementation they verify.

How it is used
Uses tests written before implementation to specify, design, and verify component behavior while making changes safer.
How deep it goes
Details the failing-test, minimal-code, refactor cycle and shows test names, but does not walk through a complete implementation.
Examples
Contrasts broad bank-account test names with tests specifying particular transfer and fee behaviors.
What you can do after
Practice/perform it by writing a failing unit test, making it pass with minimal code, and refactoring.

Read how BDD in Action, Second Edition explains test-driven development →

Developer Experience on Kubernetes

Test-driven development is a software development technique in which a failing test is written before the implementation that makes it pass, followed by cleanup.

How it is used
Uses a failing test to guide feature implementation within the developer's inner loop.
How deep it goes
Defines the red-green-cleanup cycle and test-environment trade-offs, but stops short of detailed testing theory.
Examples
Demonstrates Go and Java integration tests for creating categorized appointments through an HTTP endpoint.
What you can do after
Apply it via an inner-loop workflow that validates behavior early and helps prevent regressions.

Read how Developer Experience on Kubernetes explains test-driven development →

Learn PowerShell Scripting in a Month of Lunches, Second Edition: Write and organize scripts and tools

Test-driven development is a software-development practice in which automated tests are written before the implementation they specify.

How it is used
Uses automated tests as executable specifications for designing tools and adding features before implementation.
How deep it goes
Explains the test-first cycle and regression value, but stops short of naming a testing framework or showing test code.
Examples
Uses Get-MachineInfo usage forms and optional failure logging as concrete specifications for command behavior.
What you can do after
Apply it via automated tests that define a feature, expose its initial failure, and guide implementation until behavior passes.

Read how Learn PowerShell Scripting in a Month of Lunches, Second Edition: Write and organize scripts and tools explains test-driven development →

Unit Testing Principles, Practices, and Patterns

Test-driven development is a software development process in which tests guide incremental implementation and refactoring.

How it is used
Guides each implementation change through a failing test, minimal passing code, and refactoring.
How deep it goes
Defines a repeatable three-stage loop and extends it to outside-in system design with mocks.
Examples
Uses failing tests, minimal implementations, passing-test protection, and collaborator expectations as concrete artifacts.
What you can do after
Build it incrementally through failing tests, minimal implementations, and protected refactoring.

Read how Unit Testing Principles, Practices, and Patterns explains test-driven development →

Effective Behavior-Driven Development

A software development technique in which automated tests are written before implementation code and guide the design of the code.

How it is used
Uses automated tests to drive implementation and shorten the feedback loop.
How deep it goes
Explains the Red/Green/Refactor cycle from a failing test through minimal implementation and refactoring.
Examples
Uses a failing automated test, just enough code to pass it, and a refactoring step as the recurring example.
What you can do after
Practice/perform the cycle by writing a failing test, implementing enough to pass, and refactoring before the next test.

Read how Effective Behavior-Driven Development explains test-driven development →

The AI Pocket Book

A development practice where tests are written for small units of behavior before or alongside code implementation.

How it is used
Positions validation as a central, tightly coupled part of delivering robust software.
How deep it goes
Explains units, edge cases, tests, passing implementations, and scope tradeoffs, but stops short of tools or frameworks.
Examples
Uses individual tests and persistent replacements for print-statement checks as practical examples.
What you can do after
Practice/perform TDD by turning anticipated failures and ad hoc checks into lasting tests.

Read how The AI Pocket Book explains test-driven development →

Go in Action, Second Edition

A test-driven workflow is a development process that begins with failing automated tests and incrementally implements code until the tests pass.

How it is used
Uses failing tests to define APIs, guide implementation, and enforce behavioral contracts.
How deep it goes
Demonstrates API design, failure-first tests, implementation steps, and passing verification, while stopping short of broader TDD theory.
Examples
Uses a Go Calculator, invalid operations, division by zero, stored results, and go test failure and success output.
What you can do after
Build it from scratch by specifying a Go API, writing failing tests, implementing behavior, and confirming the result with go test.

Read how Go in Action, Second Edition explains test-driven development →

The Coder Cafe

Test-driven development is a development approach in which tests guide implementation, typically by writing a failing test before the corresponding code.

How it is used
Uses tests to structure implementation, clarify behavior, and support safe refactoring.
How deep it goes
Defines the Red-Green-Refactor process, gives a sorting example, and weighs suitability without prescribing universal adoption.
Examples
Uses an array-sorting function with unsorted, sorted, one-element, and empty-array cases.
What you can do after
Practice/perform it by cycling from failing behavior tests through minimal implementation to refactoring.

Read how The Coder Cafe explains test-driven development →

Software Testing with Generative AI

Test-driven development is a software development practice in which failing checks are created before production code, code is added to make them pass, and the code is then refactored while checks remain passing.

How it is used
Uses unit checks to guide incremental development and build quality into products.
How deep it goes
Explains the red/green/refactor procedure and its rationale, but stops short of detailed implementation code.
Examples
Demonstrates a timesheet manager feature involving projects, half-hour units, required inputs, and user-specific visibility.
What you can do after
Apply it to build incrementally testable features while preserving passing checks during refactoring.

Read how Software Testing with Generative AI explains test-driven development →

100 Java Mistakes and How to Avoid Them

Test-driven development is a software development methodology in which tests are written before the implementation code.

How it is used
Uses failure-first testing to validate that tests are active before implementation is considered correct.
How deep it goes
Defines the test-before-code rule and failure check, but does not develop a complete TDD workflow.
Examples
Uses missing @Test annotations, absent IDE Run icons, and weak assertNotNull or assertNotEquals calls as failure modes.
What you can do after
Diagnose ineffective tests by forcing failures and checking test recognition and assertion strength.

Read how 100 Java Mistakes and How to Avoid Them explains test-driven development →

Django in Action

Test-driven development is a software development approach in which tests are written before the implementation they verify.

How it is used
Uses tests to define a function’s interface and guide implementation before production code is written.
How deep it goes
Defines the test-first loop and completion rule, but does not provide implementation code or detailed testing procedures.
Examples
Uses function interfaces, unit tests, integration tests, behavioral tests, and UI tests as its concrete artifacts.
What you can do after
Apply TDD by writing a function’s tests first and implementing until those tests pass.

Read how Django in Action explains test-driven development →

Enterprise RAG

Test-driven development is a software development approach in which tests are written before implementation and guide coding until the tests pass.

How it is used
Uses expected RAG answers as tests that guide implementation and protect chatbot quality during development.
How deep it goes
Explains test definition, answer comparison, assertions, and continuous execution, but does not develop general TDD principles beyond automated evals.
Examples
Uses fictional book questions, expected answers, generated answers, a pytest test case, and a GitHub Actions workflow.
What you can do after
Apply it via pytest and GitHub Actions to build and continuously check an automated RAG evaluation system.

Read how Enterprise RAG explains test-driven development →

Pro ASP.NET Core 7, Tenth Edition

Test-driven development is a software development practice in which tests are written before the implementation they verify.

How it is used
Uses tests to define feature behavior before implementation and guide incremental application development.
How deep it goes
Explains the rationale and red-to-green cycle, but stops short of presenting detailed TDD variations or a complete test-first feature build.
Examples
Uses an ASP.NET Core controller, Product objects, IDataSource, and a fake data source to illustrate isolated tests.
What you can do after
Practice/perform test-first development with explicit success criteria and progressively broader feature coverage.

Read how Pro ASP.NET Core 7, Tenth Edition explains test-driven development →

Spec-Driven Development

Test-driven development is a software development practice in which an automated test is written before the implementation that makes it pass.

How it is used
Guides implementation tasks by using unit tests to drive design within architectural boundaries.
How deep it goes
Distinguishes inside-out unit-test-driven design from outside-in acceptance verification without spelling out a full TDD cycle.
Examples
Uses password-reset session invalidation as a test example and a URL-shortener task list as a workflow scenario.
What you can do after
Apply TDD by letting unit tests drive implementation design while respecting architectural boundaries.

Read how Spec-Driven Development explains test-driven development →

Tiny Python Projects: Learn coding and testing with puzzles and games

Test-driven development is a software development practice in which tests are written before implementation and repeatedly run to guide development and detect regressions.

How it is used
Uses a test suite as an integral part of writing programs and checking minimum correctness.
How deep it goes
Defines the red-green-refactor cycle and demonstrates it with a small function, but defers how to write tests generally.
Examples
Uses an add1() function, assertion cases for zero and signed values, and a Pytest test run.
What you can do after
Apply it via Pytest to implement small functions, verify expected behavior, and refactor with regression protection.

Read how Tiny Python Projects: Learn coding and testing with puzzles and games explains test-driven development →

Also covered in

What to know first

Related concepts

Questions about test-driven development

What is test-driven development?

Test-driven development is a software development practice in which tests specify expected behavior and guide incremental implementation, typically being written before the corresponding code.

Which Manning books explain test-driven development?

Test Driven: Practical TDD and Acceptance TDD for Java Developers, Effective Platform Engineering, Vibe Engineering, The Art of Unit Testing 3e, Build High Value Software Systems, Web Components in Action, Learn Rust in a Month of Lunches, Build Financial Software with Generative AI (From Scratch) and 15 more.

What should I know before learning test-driven development?

Manning books that teach test-driven development usually introduce software testing, unit test, contract and function first.

What is the difference between test-driven development and acceptance test-driven development?

Test-driven development is a software development practice in which tests specify expected behavior and guide incremental implementation, typically being written before the corresponding code. Acceptance test-driven development is a collaborative software development approach in which acceptance tests or criteria are defined before implementation and guide development.

What are the parts of test-driven development?

Test-driven development includes code step.

What is test-driven development also called?

Test-driven development is also called TDD, test-first development, red-green-refactor cycle, test-driven approach or test-driven design.

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.