It's perfectly possible to develop and maintain large, complex systems without 100% code coverage. Clearly some level of testing coverage between 0% and 100% is optimal. The case for it being 100% is, to my mind, extremely weak.
edit: In response to child post - That was my interpretation of this "It will make our work so much more efficient, motivating and a bit more professional."
It seems that I definitely need to improve my English. :)
Somethings need/should be unit tested, but most "glue" code benefits far more from investing time in robust error handling rather than testing.
There in lies the problem. It isn't unit test vs full up build an installer, and run the server. Those are just the two ends of the spectrum.
The only way to call it unit testing is if you make unit mean something completely different to what most people mean by unit. Yet it is automated testing that covers real functionality.
- Create integration test/stories - For each step in integration test - Add unit tests to make it pass, starting at the view layer and working backwards.
The level of unit testing required for each step depends on the complexity of the code. So what does unit testing get you over just performing integration tests? 2 things:
1) Documents and enforces expected behaviour for edge cases that you haven't written integration tests for - e.g. unusual error conditions
2) Isolates points of inflexion in your system - your stories/use cases will often rely on several components that have multiple logic paths. When you combine the branching logic from several components the combinatorial range of behaviour can be vast. By isolating units at the points of inflexion you are able to test a far smaller range of inputs/outputs so that you can achieve effective test coverage. You're quite correct that the units you tests are not necessarily aligned 1 to 1 with your classes. However, given that a well designed class will have a single responsibility this is often the case.
I think this is a great point and perhaps explains the low support for TDD on HN.
In my experience the properties of a TDD project are: consistent flow rate of business value, low regression rate, low QA cost (assuming integration tests). It's the consistent flow rate which is perhaps most interesting.
At the start of a non TDD project it's easy to achieve a high velocity without tests. As the length of time from the start of the project increases the velocity will inevitably decline due to the increased complexity of the project and the greater level of QA required. Over a longer period the project without tests is going to tend towards a slower velocity until eventuality it hits a wall and it's big rewrite time.
For a TDD project the velocity curve is going to be different. You're going to see a slower start but once a velocity has been established it tends to stay fairly flat or increase. The XP guys talk about hyper-productive teams, there's no guarantee but you're far more likely to hit this point with a TDD project.
Increasing the number of features a product has and the number of team members will only exaggerate these two velocity curves.
There's another factor here as well, the knowledge of TDD within a team. The greater the TDD experience the smaller the difference will be in the starting velocity. With enough experience the velocity hit becomes small enough that the two curves can cross over very quickly.
The choice of strategy then becomes: are the velocity curves likely to cross over before or after you achieve market fit? Not an easy question to answer and one which is easy to ignore when everyone is excited about just getting something built.
edit: not sure what happened to the parent post, here's a link to Kent Beck's comments about testing before market fit http://www.quora.com/What-kind-of-automated-testing-should-a...
1) How many projects have you worked on that were 100% test driven and written outside-in?
2) Do you have the knowledge to test any code, regardless of web APIs, filesystem etc.?
3) When you deploy an app without 100% coverage how can you be confident that there are no regressions?
4) When you add new functionality are you comfortable changing the existing code or do you try to leave it alone and build on top of it?