Edsger W. Dijkstra wrote:Program testing can be used to show the presence of bugs, but never to show their absence!
Books: Pragmatic Unit Testing in Java, Agile Java, Modern C++ Programming with TDD, Essential Java Style, Agile in a Flash. Contributor, Clean Code.
John Czukkermann wrote:The more I thought about it though, the more I came to the realization that TDD, as defined, cannot be applied to unit testing unless you are superbly clairvoyant! Why? Well, if one of the criteria of unit testing is to test all code paths in a given unit of code (class, method, whatever), in order to apply TDD, one would have to know what the code paths are before the code was written, so you could create the tests to drive them. That's a really hard task for a typical mortal.
Books: Pragmatic Unit Testing in Java, Agile Java, Modern C++ Programming with TDD, Essential Java Style, Agile in a Flash. Contributor, Clean Code.
Jeff Langr wrote:
I've found that a mostly-test-driven approach has indeed been practical, on very large and very complex systems and many others of different stripes I've worked with in the past 15 years, and perhaps partly because it promotes *eschewing* methods with a high degree of complexity. Most complexity in software can and should be driven out in favor of small, composed methods and rare but isolated complex methods.
Books: Pragmatic Unit Testing in Java, Agile Java, Modern C++ Programming with TDD, Essential Java Style, Agile in a Flash. Contributor, Clean Code.
Consider Paul's rocket mass heater. |