Re:The evil unit test.
by jrockway on Monday January 30, 2012 @05:12PM
(#3530856)
Many people write bad tests. So stop doing that, but don't stop writing tests. The reason why every public method should be tested is because changing how a public methods works is going to break everything using that public method. If you must make a change, fix the test along with the method. It broke to remind you to fix the consumers of your API.
Good tests don't depend on implementation. Your tests should tests interfaces instead of objects and anything implementing the interface should pass the tests. If it doesn't, your interface is wrong or your test is wrong.
Good tests don't depend on implementation. Your tests should tests interfaces instead of objects and anything implementing the interface should pass the tests. If it doesn't, your interface is wrong or your test is wrong.