Clean code in tests

PaweĊ‚ Fertyk


clean-tests.pfertyk.me

Why?

  • tests are not production code
  • you write them once
  • you read them only when something breaks

Because

  • tests are code (untested code)
  • you need to write them often
  • you need to read them often

Unclear names

Multiple assertions

Complicated fixtures

Confusing times

Questions?