SuperAPI AI Directory

test-driven-development

Coding & development

View repository

Updated 10-15 19:57

About this skill

Test-Driven Development

The Cycle

Red

Write a test that describes the behavior you want. Run it. It should fail.

Green

Write the minimum code to make the test pass.

Refactor

Make the code good. Tests must still pass.

Test Quality

A good test:

  • Tests behavior, not implementation
  • Has one clear assertion
  • Has a descriptive name
  • Is independent
  • Is fast