liveBook · Manning

Test-driven development

As explained in 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.

Test-driven development (TDD) structures implementation around a failing test: define behavior from a requirement or acceptance criterion, write the test, implement until it passes, then tidy the code. The cycle belongs to the inner loop of coding, testing, running, and debugging. section 1.2.1 section 2.3.3

Use the workflow to obtain fast feedback while developing a change:

  • Translate the requirement or acceptance criteria into an executable test. section 2.3.3
  • Run the test so its failure establishes the missing behavior. section 1.2.1
  • Implement the smallest change that makes the test pass, then clean up without changing the behavior. section 1.2.1
  • Keep the test suite quick and reliable; decide whether external dependencies should be mocked or provided as real or containerized services. section 1.3.4

Validating an appointment endpoint

An integration test creates an appointment with a category, posts it to /appointments, expects a successful response, and verifies that the returned body is an Appointment. Equivalent examples use Go and Java test workflows.

How Developer Experience on Kubernetes covers it

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 it assumes
Assumes a defined requirement and basic ability to write and run automated tests, while grounding the workflow in acceptance criteria.
What you can do after
Apply it via an inner-loop workflow that validates behavior early and helps prevent regressions.
How it connects
Connects TDD with acceptance criteria, behavior-driven development, continuous integration, continuous delivery, and the inner loop.

Also explained in

Compare how 23 books explain test-driven development →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Developer Experience on Kubernetes. The section links point to the parts of the book it draws on.