I found [Open source projects with good quality tests](https://stackoverflow.com/questions/2893841/open-source-projects-with-good-quality-tests) but I wanted to ask something a bit different.

I'm having a hard time visualizing how to build production code using TDD practices, particularly for networked database-driven applications where big chunks of functionality are dependent on one or more external systems. The two main strategies I've seen discussed for accomplishing that are decoupling code from the systems in question and using mocks. However, my intuition is that doing either one properly would also be complex and error-prone.

I'd like to take a look at some real-life code that was built using test-driven development practices from the ground up. Such a project would have had to deal with such issues from very early on, and I think looking at the results would be instructive. Any examples out there, whether positive or negative?