The 2009 Advent Calendar Wrap Up

So I hope I showed you a way to BDD/TDD a thread safe solution without slow pesky tests that needs a number of helper threads to verify thread safety. Also, you're not guaranteed that your code is thread safe just because of your tests when you use threads to try and break your code. You can use something like Chess to find such bugs but having tests that consistently verifies thread safety is much better IMHO.

And did we create better code this way (because BDD/TDD is about writing better code, right)? I think the separation of concerns between the ImportantObject, ImportantProvider and the Transaction are pretty neat. The introduction of MutexWrapper might be questionable for some people but it illustrates how different concerns should be separated and by doing so you can test more things in a simple way.

For your convenience here is a summary of all links and the final version of the code.

Comments (0)

Skip to main content