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

One mock too far

One mock too far

Avatar for Michal Lipski

Michal Lipski

January 28, 2014

Other Decks in Programming

Transcript

  1. UNIT TEST test of small fragment of code that represents

    some functionality Run in isolation from external dependencies and other system functionalities
  2. MOCK STUB For replacing a method with code that returns

    a specified result. For validating our expectation about methods calls that object should receive
  3. MOCK STUB For replacing a method with code that returns

    a specified result. For validating our expectation about methods calls that object should receive STATE TESTING BEHAVIORAL TESTING
  4. Command Query Incoming assert on public state change assert on

    returned value Outgoing verify mock stub or avoid
  5. Command Query Incoming assert on public state change assert on

    returned value Outgoing verify mock stub or avoid