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

Writing testable code

Writing testable code

Rodrigo Boniatti

November 30, 2019
Tweet

More Decks by Rodrigo Boniatti

Other Decks in Programming

Transcript

  1. Conditionals • Smell: • High cyclomatic complexity score; • How

    to solve? • Replace Conditional with Polymorphism;
  2. Life cycle events • Smell: • Hide code behavior; •

    No execution order; • How to solve? • Single flow;
  3. Principles of testing • Test in isolation; • A lot

    of setup == smell; • Hard to test == smell;