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

TDD for people who don't need it

TDD for people who don't need it

Chew Choon Keat

May 26, 2017
Tweet

More Decks by Chew Choon Keat

Other Decks in Programming

Transcript

  1. TDD Community • is irritating • shames people • doesn’t

    have your deadline warning: generalisation
  2. They say Tests • Gives you confidence to refactor •

    Helps you write better designed API • Serves as documentation • Untested code is legacy code warning: ymmv
  3. • Gives you confidence to refactor • Helps you write

    better designed API • Serves as documentation • Untested code is legacy code I have a YUGE confidence. They say Tests warning: ymmv
  4. • Gives you confidence to refactor • Helps you write

    better designed API • Serves as documentation • Untested code is legacy code I have a YUGE confidence. They say Tests warning: ymmv
  5. • Gives you confidence to refactor • Helps you write

    better designed API • Serves as documentation • Untested code is legacy code I have a YUGE confidence. My code is well designed. Unlike yours. They say Tests warning: ymmv
  6. • Gives you confidence to refactor • Helps you write

    better designed API • Serves as documentation • Untested code is legacy code I have a YUGE confidence. My code is well designed. Unlike yours. They say Tests warning: ymmv
  7. • Gives you confidence to refactor • Helps you write

    better designed API • Serves as documentation • Untested code is legacy code I have a YUGE confidence. My code is well designed. Unlike yours. My commit log is more awesome than your résumé They say Tests warning: ymmv
  8. • Gives you confidence to refactor • Helps you write

    better designed API • Serves as documentation • Untested code is legacy code I have a YUGE confidence. My code is well designed. Unlike yours. My commit log is more awesome than your résumé They say Tests warning: ymmv
  9. • Gives you confidence to refactor • Helps you write

    better designed API • Serves as documentation • Untested code is legacy code I have a YUGE confidence. My code is well designed. Unlike yours. My commit log is more awesome than your résumé Untested test is legacy code too They say Tests warning: ymmv
  10. "regression testing"? What's that? If it compiles, it is good,

    if it boots up it is perfect Linus God Himself
  11. We ♥ Code Too • Refactor & agonize over naming;

    like your first born • Write commit messages like the world care to read • Write inline docs that formats like professionals • Recite design patterns before bedtime
  12. They say Tests • Gives you confidence to refactor •

    Helps you write better designed API • Serves as documentation • Untested code is legacy code warning: ymmv
  13. They say Tests • Gives you confidence to refactor •

    Helps you write better designed API • Serves as documentation • Untested code is legacy code warning: ymmv YAGNI
  14. “I really like this approach of testing, it just walks

    you through: what’s the next step I have to do to get this working.” http://railscasts.com/episodes/275-how-i-test
  15. Requirements can sometimes come at different times, via different channels,

    evolving in response new information One copy; versioned
  16. ./edit_test.go:36: undefined: handleNewAddressRequest ./edit_test.go:47: undefined: addressFromMail ./edit_test.go:53: undefined: addressFromDB ./edit_test.go:59:

    undefined: visitLinkFromEmailTo ./edit_test.go:65: undefined: addressFromDB FAIL choonkeat/gopherconsg/changeemail [build failed]
  17. ./edit_test.go:36: undefined: handleNewAddressRequest ./edit_test.go:47: undefined: addressFromMail ./edit_test.go:53: undefined: addressFromDB ./edit_test.go:59:

    undefined: visitLinkFromEmailTo ./edit_test.go:65: undefined: addressFromDB FAIL choonkeat/gopherconsg/changeemail [build failed] Hungry? Go Where?
  18. ?

  19. Don’t WORRY • Testing “Right” • Testing All The Things

    — Rabbit hole • Discarding tests • Which test library to choose • Should I mock or stub or factory — I don’t know I don’t care
  20. end