Roy Osherove

View Original

Fifteen things I look for in an Isolation framework

  1. Is the framework strict or non strict by default? Hopefully non strict.
  2. Is everything called a mock? Hopefully not. a fake? mock/stub differentiation?
  3. Does it have recursive fakes? Hopefully.
  4. How good are the error messages?
  5. What is the test style? record replay?arrange-assert-act? arrange-act-assert? hopefully the latter.
  6. How simple are the matchers for expected parameters to write? 
  7. How easily can you create a mock logger that expects a string containing X at least once?
  8. How easily can you create a stub logger that simulates an exception, and a mock service that gets a message containing string if the logger throws. ([as specified here])
  9. Is the framework constrained or unconstrained? Important to know what it can and cannot do.
  10. Does stubbing a return value feel like setting an expectation? Hopefully not.
  11. When you verify - can you verify only a single specific call? hopefully. or do you have to verify all?
  12. Could you verify all if you wanted? hopefully not.
  13. Does the framework verify by default ? hopefully not.
  14. Does the framework encourage to verify all in the teardown? hopefully not.
  15. How easily can you verify you got an object with some properties or attributes?