Test-Driven Development

A practice where tests are created before the implementation begins, so work is checked continuously as it progresses and teams strive for zero defects.

Key Points

  • Write a test first, see it fail, implement the minimum code to pass, then refactor (red-green-refactor).
  • Tests act as executable requirements that guide design and clarify scope.
  • Encourages small, incremental changes with fast feedback and fewer defects.
  • Works best with automated unit tests and continuous integration for rapid validation.

Example

On a payments feature, the team writes unit tests for handling invalid cards and approving valid transactions before any code exists. The tests fail at first. Developers then add only the logic needed to make the tests pass, run the suite in the CI pipeline, and refactor the code while keeping all tests green.

PMP Example Question

Which practice requires creating automated tests before writing the production code, ensuring continuous validation and minimal defects during development?

  1. Continuous Integration
  2. Test-Driven Development
  3. Code Reviews
  4. Kanban WIP Limits

Correct Answer: B - writing tests before coding (Test-Driven Development)

Explanation: TDD mandates writing failing tests first, then adding only enough code to pass them, which provides constant feedback and lowers defect rates.

Project Management with AI: From Initiation to Closing

Build a practical project management process from initiation to closing with our Project Management: From Initiation to Closing with AI course. Learn how to move from informal project coordination to a structured, repeatable approach using PMBOK-aligned workflows, real examples, and professional templates.

This hands-on course follows a complete project lifecycle. You will learn how to write a project charter, define scope, build a work breakdown structure, develop a schedule, estimate costs, manage risks, engage stakeholders, execute the work, monitor performance, and close the project properly.

You will also learn how to use AI tools to accelerate project management work. The course includes reusable prompts, downloadable templates, assignments, and worked examples that show how project documents connect from one stage to the next.

The course is designed for professionals, team leads, coordinators, analysts, and new project managers who need practical skills they can apply at work. Enroll now and build the confidence to manage projects with structure, clarity, and control.



Launch your Agile career!

HK School of Management helps you master Agile and Scrum—faster. Learn practical playbooks, AI-powered prompts, and real-world workflows to plan smarter, deliver sooner, and keep stakeholders aligned. For the price of lunch, you’ll get templates, tools, and step-by-step guidance to level up your projects. Backed by our 30-day money-back guarantee—zero risk, clear path to results.

Learn More