DISQUS

andrewmccall.com: Some thoughts on unit tests

  • John Hunsley · 5 months ago
    Some rules I apply when writing unit test -

    1. Never write tests which rely on a resource outside of the code you're testing. i.e. Make mock objects for DAO's and stubs for external resources such as a web service end point.

    2. Only test business logic. There's no point writing a test case which tests getters and setters, as you've said, and no point testing that framework you are using does the job it is supposed to do, that should be tested within that framework project itself.
  • stack · 2 months ago
    Andrew: You mentioned making up mock objects for hbase. Can I see what you did? Trying to make the hbase tests run faster overall... Thanks. St.Ack