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

Save the world: design for testability

Save the world: design for testability

Presentation by @lucasxas

GDG Aracaju

February 07, 2015
Tweet

More Decks by GDG Aracaju

Other Decks in Programming

Transcript

  1. About me Lucas Xavier @lucasxavier • Lucas Xavier - Software

    Engineer for five years - Test Specialist, UFPE - Bsc in Information Systems, UFS - Nonsense humour - Game of Thrones - Rock!
  2. Agenda • Value proposition • What’s testability? • Best practices

    • Anti-patterns • Unit Testing and TDD • Hands-on! Lucas Xavier @lucasxavier
  3. Value proposition • Design + coding + debugging + testing

    • Certainties in life • Death • Taxes • Bugs • Early feedback Lucas Xavier @lucasxavier
  4. What’s testability? • Repeatable • Easy to Write • Easy

    to Understand • Fast Lucas Xavier @lucasxavier
  5. What’s testability? • Components: • Control • Visibility • Operability

    • Simplicity • Understandability • Suitability • Stability Lucas Xavier @lucasxavier
  6. Best practices • Set up and teardown • KISS •

    Loose coupling • Dependency injection • Elimination of globals • Clear code Lucas Xavier @lucasxavier
  7. Anti-patterns • Unclear execution paths • Train Wrecks • Dependencies

    between test cases • Testing precise timing or performance • All-knowing oracles • Slow running tests Lucas Xavier @lucasxavier
  8. Unit Testing and TDD • Unit Testing • Test Driven

    Development • Unit Testing is a component of TDD Lucas Xavier @lucasxavier