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

Raphael Almeida - Mocks, Stubs, Fakes, Dummies e Spies

Raphael Almeida - Mocks, Stubs, Fakes, Dummies e Spies

Aprenda a tornar seus testes mais simples, rápidos e enxutos com a sutilização de mocks, stubs, fakes, dummies e spies.

Agile Testers

April 08, 2017
Tweet

More Decks by Agile Testers

Other Decks in Technology

Transcript

  1. Who Am I? Raphael Almeida Developer since 2006 Co-founder of

    PHPRio, DojoRio, RubyOnRio … Community-a-holic
  2. Dummies Used whenever we need to pass irrelevant or never

    used arguments only to respect the method signature
  3. Verifying State We inspect the state of the tested object

    after it has been exercised and compare it to the expected state
  4. Verifying Behaviour We capture the indirect output of the tested

    object as they occur and compare them to the expected behavior
  5. Best Practices Don’t mock values Verify the context (easy or

    awkward) Use Fixtures with parsimony Coupling test to implementations