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

Maintainable test automation

Jo Van Eyck
September 26, 2017

Maintainable test automation

Test automation. Wat sommigen beschouwen als een enorme enabler/meerwaarde wordt op veel projecten stiefmoederlijk behandelt en aanzien als een "permanente kost".

Voor iedereen die de woorden "Jup, m'n feature is klaar, ik moet enkel de tests nog fixen!" al eens heeft durven uiten, voelt dat het anders/beter zou kunnen maar niet onmiddelijk ziet waar te beginnen.

De sessie behandelt o.a.:
* High-level goals van test automation
* Principes en technieken om test automation ROI interessant te houden
* Nitty-gritty patterns en code-voorbeelden om je geautomatiseerde tests beter onderhoudbaar te maken

Talk goals:
* Insight into what makes "good test automation"
* Provide practical take-aways attendees can immediately start using on the job

Jo Van Eyck

September 26, 2017
Tweet

More Decks by Jo Van Eyck

Other Decks in Technology

Transcript

  1. Talk goals: • Insight into what makes “good” test automation

    • Actionable tips you can use at work tomorrow Agenda: • Motivation • Goals of automation • Automation Strategies • Tactics: smells & patterns
  2. “I spend 50% of my time fixing unrelated tests” “Development

    is done, I just have to get tests green again” “Oh yeah, those tests turn red all the time. Don’t worry!” “Our test suite takes 12 hours to run” “We have separate ‘write tests’ stories on our task board”
  3. Goals of test automation “Good” test automation: 1. Improves quality

    2. Improves understandability 3. Reduces risk 4. Makes it easy to run/write/maintain tests 5. Provides fast feedback
  4. Goal 1: improve quality • External quality: • Correctness •

    Non-functionals • Internal quality: • Design quality
  5. Goal 4: easy to run/read/write/maintain • FIRST tests • Fast

    • Isolated • Repeatable • Self-checking • Timely
  6. What tests to write? Automate the heck out of this

    Automate + tooling Automate repeated + tooling Needs skill + human brain
  7. The deep synergy between testability and good design, Michael Feathers

    https://vimeo.com/15007792 “Tests turn design issues into concrete pain”
  8. The deep synergy between testability and good design, Michael Feathers

    https://vimeo.com/15007792 “Tests turn design issues into concrete pain”
  9. • Tests as documentation • Easier to • Read (no

    noise) • Write (DSL) • Maintain (less fragile)
  10. Test-per-method • Tests as documentation • Maintainable tests • Test

    grouping • Per class • Per feature • Per fixture Focus on behaviour, not implementation
  11. Fragile test • The 4 sensitivities: • Interface sensitivity •

    Data sensitivity • Context Sensitivitiy • Behaviour Sensititivy
  12. "Whenever you are tempted to type something into a print

    statement or a debugger expression, write it as a test instead.“ – Martin Fowler