$30 off During Our Annual Pro Sale. View Details »

Mocks, Stubs, Fakes, Dummies and Spies

Mocks, Stubs, Fakes, Dummies and Spies

Learn to makr your tests easier, fast and lean using mocks, stubs, fakes, dummies and spies.

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

Palestra apresentada em 8/04/17 no Agile Testers Conference RJ http://conferencia.agiletesters.com.br/riodejaneiro.html

raphaeldealmeida

April 08, 2017
Tweet

More Decks by raphaeldealmeida

Other Decks in Programming

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