Are there any open source applications that are developed using test driven development that serve as models of how good unit testing should work?
I'd prefer to see examples in C# and .NET. (Note that I mentioned applications, not just libraries.)
I'm a mid-tier programmer who really wants to believe in and practice TDD. The app I work on in my day job is pretty complicated--about 1 million lines of code--and I would love to introduce more unit testing. We have some unit tests in place, but my efforts at TDD and with working on code that's already under test have not been encouraging.
In my admittedly limited experience, TDD seems to encourage a lot of complexity in the name of decoupling. The bits of the app that are hard to test--and which coincidentally tend to be critical--get pushed out to the periphery, into the realm of integration tests that may or may not ever get written. (I'm thinking of the usual suspects here, file system access, hydrating objects from a database, asynchronous web calls, etc.)
The code that's under test tends to involve lots of collaboration among objects, and maybe some simple flow logic, all of which happens in memory and which could arguably be written in a simpler, more understandable way if everything didn't have to be totally decoupled for testing.
I understand the techniques for mocking dependencies and such, but in my experience heavy use of mocking leads to very brittle tests. If my first instinct upon seeing a bunch of tests go red is, "Great, now I have to fix all the mocks," then my tests have become a drag rather than a safety net.
I'm trying to get past this mental barrier, and as part of that I'm reading Michael Feathers' book, Working Effectively with Legacy Code. I it hope will show me some of what I'm missing.
I'd also like to study some nontrivial .NET applications with good code coverage, maybe a content management system, or a CRUD app. The FitNesse testing framework that Uncle Bob talks about is something I'll probably look at, but it would be nice to see something written in the language I'm most familiar with.
Any suggestions or words of wisdom would be appreciated.