Skip to content

Test Driven Development (TDD)


Leonardo's Handy Dandy TDD Rules

taken from here:- www.thedigitalcatonline.com/blog/2020/09/10/tdd-in-python-with-pytest-part-1/

  1. Test first, code later
  2. Add the reasonably minimum amount of code to pass the test
  3. You should only have at most one failing test at a time
  4. Write code that passes the test. Doesn't matter how messy or ugly it is. Get the test passing first, then you can refactor your code.
  5. A test should fail when you add it. If it doesn't, ask yourself why you are adding it.
  6. Never refactor without tests.