Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥

Writing testable code

Writing testable code

Avatar for Rodrigo Boniatti

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;