TDD and multi-threading

Monday, March 28, 2011

According to good TDD practices a test should describe (and eventually test) a behavior and not the implementation. Because of that, one thing that is tricky to do in TDD is to write tests for a multi-threaded component. One can argue that multi-threading is a non-functional requirement, and therefore shouldn’t be covered by behavior tests, but only by load-tests. I don’t subscribe to this approach for few reasons: As I’ll show below, it is possible to describe a multi-threaded problem as a functional requirement. Load tests are non-deterministic Load tests usually take long to run, and therefore aren’t being run very...
no comments