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.

AI for Project Managers — Build Plans Faster, Lead Better

Turn messy inputs into structured project plans in minutes. If you are a project manager tired of spending hours on documentation, this course shows you how to use AI to work faster while staying fully in control.

This is not a generic AI course. You will learn how to use AI as a practical co-pilot to build real project artifacts—charters, WBS, schedules, risk registers, and executive reports—using structured, reliable prompt frameworks.

You will also learn how to keep your project aligned across scope, schedule, cost, and risk, and how to interpret performance data like Earned Value Management to support better decisions and communication.

Everything is designed for immediate use. You get ready-to-use prompt templates and workflows you can apply right away in your projects. Watch the video to see how it works and start building your first AI-supported project plan.



Take Control of Project Performance!

HK School of Management helps you go beyond status reports and gut feelings. In this advanced course, you’ll master Earned Value Management (EVM) to objectively measure progress, forecast outcomes, and take corrective action with confidence. Learn how WBS quality drives performance, how control accounts really work, and how to use EAC, TCPI, and variance analysis to make smarter decisions—before projects drift off track. Built around real-world examples and hands-on exercises, this course gives you practical tools you can apply immediately. Backed by our 30-day money-back guarantee—low risk, high impact for serious project professionals.

Learn More