Unit testing part 7: Wiring it all up

This series of posts accompanies a talk I give about unit testing with the xUnit test framework. Any reader who saw my talk can use this as a reference, others can use this as a starting point to write even better maintainable and reliable code. In my talk, I highlight patterns that work well with easily testable code and combine it all into a working application. All code from these articles can be found in a repository on my GitHub account.

I now have some very beautiful code. Well written, fully tested, every part does what it’s supposed to do. Now what?

Continue reading

Unit testing part 6: The horrors of older code

This series of posts accompanies a talk I give about unit testing with the xUnit test framework. Any reader who saw my talk can use this as a reference, others can use this as a starting point to write even better maintainable and reliable code. In my talk, I highlight patterns that work well with easily testable code and combine it all into a working application. All code from these articles can be found in a repository on my GitHub account.

Every line of code I write from now on will have a dozen tests checking every possible behaviour. The problem is my legacy work project, it’s not written with tests in mind. Such a project is not easy to test. Great! Nothing is as fun as a challenge (even if I procrastinate a bit before tackling it).

Continue reading