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-Prompt Engineering for Strategic Leaders

Stop managing administration and start leading the future. This course is built specifically for managers and project professionals who want to automate chaos and drive strategic value using the power of artificial intelligence.

We don't teach you how to program Python; we teach you how to program productivity. You will master the AI-First Mindset and the 'AI Assistant' model to hand off repetitive work like status reports and meeting minutes so you can focus on what humans do best: empathy, negotiation, and vision.

Learn the 5 Core Prompt Elements-Role, Goal, Context, Constraints, and Output-to get high-quality results every time. You will build chained sequences for complex tasks like auditing schedules or simulating risks, while navigating ethics and privacy with human-in-the-loop safeguards.

Move from being an administrative manager to a high-value strategic leader. Future-proof your career today with practical, management-focused AI workflows that map to your real-world challenges. Enroll now and master the language of the future.



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