Upgrade to Pro — share decks privately, control downloads, hide ads and more …

How to write good tests?

How to write good tests?

Small talk that I gave to @debitoor guys about practices of writing tests.

Alexander Beletsky

April 12, 2013

More Decks by Alexander Beletsky

Other Decks in Programming


  1. How to write good tests?

  2. Honestly, I don’t know

  3. But, there are properties of good tests…

  4. … are written before code

  5. … are running very fast

  6. … are helping to find regressions

  7. Writing unit tests is not about code verification

  8. … it’s about code quality and design

  9. Think different Think TDD

  10. Could TDD be applied to everything?

  11. In short, yes code, requirements, ui

  12. Should TDD be applied to everything?

  13. Probably, no simple tasks, prototypes

  14. There are few techniques of writing tests

  15. Classic school Kent Beck, 90’s Inside-Out design Focusing on logic

  16. London school Jason Gorman, 00’s Outside-In design Focusing on collaboration

  17. What about integration tests?

  18. They are slow, hard to write, hard to setup… but

  19. … they usually caught most nasty bugs.

  20. None
  21. Maintaining test driven cycle

  22. None
  23. Acceptance test (PO communication) API (integration) tests Utils (units) tests

  24. Thanks, @alexbeletsky