After seen Sandi Metz’s The magic tricks of testing advice on testing, you will want to test the way she does.



This is the basic idea:

  • The public methods of your class (the public API), must be tested
  • The private methods don’t need be tested

Summary of tests to do:

  • The incoming query methods, test the result
  • The incoming command methods, test the direct public side effects
  • The outgoing command methods, expect to send
  • Ignore: send to self, command to self, and queries to others

Taken from the slides of the conference.