Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

One mock to far

395 views

Published on

Published in: Technology
  • Be the first to comment

  • Be the first to like this

One mock to far

  1. 1. A MOCK TOO FAR ... milipski michal-lipski Pragmatists.pl
  2. 2. UNIT TEST test of small fragment of code that represents some functionality Run in isolation from external dependencies and other system functionalities
  3. 3. REFACTORING Changing structure of code without affecting its behavior
  4. 4. STUB MOCK For replacing a method with code that returns a specified result. For validating our expectation about methods calls that object should receive
  5. 5. STUB For replacing a method with code that returns a specified result. STATE TESTING MOCK For validating our expectation about methods calls that object should receive BEHAVIORAL TESTING
  6. 6. Command
  7. 7. Command Query
  8. 8. Command Incoming Query
  9. 9. Command Incoming Outgoing Query
  10. 10. Incoming Command
  11. 11. Incoming Command
  12. 12. https://github.com/michal­lipski/comand­query­and­mocks/tree /master/src/test/java/incoming_command
  13. 13. Command Incoming Outgoing assert on public state change Query
  14. 14. Incoming Query
  15. 15. https://github.com/michal­lipski/comand­query­and­mocks/tree/m aster/src/test/java/incoming_query
  16. 16. Command Incoming Outgoing Query assert on public state change assert on returned value
  17. 17. Outgoing Command
  18. 18. https://github.com/michal­lipski/comand­query­and­mocks/tree/ master/src/test/java/outgoing_command
  19. 19. Command Query Incoming assert on public state change assert on returned value Outgoing verify mock
  20. 20. Outgoing Query
  21. 21. https://github.com/michal­lipski/comand­query­and­mocks/tree/m aster/src/test/java/outgoing_query
  22. 22. Command Incoming Outgoing Query assert on public state change assert on returned value verify mock stub or avoid
  23. 23. Command Incoming Outgoing Query assert on public state change assert on returned value verify mock stub or avoid

×