Test Driven Design

TDD is a software development methodology where you write tests before you write the actual code. The process can be summarized in three primary steps:

  • Red: Write a failing test.
  • Green: Write the minimum code to make the test pass.
  • Refactor: Refine the written code while ensuring that the test still passes.

Simple example of TDD using PHP

The Requirement

Suppose you need to write a function that adds two numbers.

The rest of the content (7 read minutes) is restricted.

Please use your personal access token or register to access.

Create account or login