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

Rethinking Testing for React Applications

Rethinking Testing for React Applications

Avatar for Tommy Graves

Tommy Graves

March 20, 2019
Tweet

More Decks by Tommy Graves

Other Decks in Programming

Transcript

  1. • High level discussion of what testing is for •

    Three antipatterns that tests can fall into • The big reveal: a testing pattern that avoids those antipatterns !3 A quick overview
  2. • To prevent defects in new code • To ensure

    changes don't break existing functionality • To document the intention of the authors of a section of code • To drive the implementation of code? !4 Why do we test?
  3. !16 The testing pyramid Unit Tests: • Fast • Deterministic

    • Easy to write • Easy to diagnose • Isolated confidence Integration Tests: • Slow • Flaky • Hard to write • Hard to diagnose • Overall confidence
  4. !17 Mocks are trade-offs Mocks make tests: • Faster •

    More deterministic • Easier to write • Easier to diagnose • Less confidence-giving
  5. !21 • Testing implementation details instead of behavior • Testing

    the code instead of the application • Testing in isolation (for isolation's sake) The three antipatterns
  6. !26