From: phlip_cpp@... (Phlip) Date: 2001-12-20T06:48:00+09:00 Subject: [ruby-talk:28993] Re: Why writing tests first can't work. > While much of the reason for this problem is the shear stupidity... I thought it was caused by "sheer stupidity"... > It should be pointed out that by XP criteria the tests are the specs > and that if those lines of code caused the tests to run successfully, > then the code is up to spec, and the code is not an oddity. The rules (presented for anyone who actually cares what they are): "The right design for the software at any given time is the one that 1. Runs all the tests 2. Has no duplicated logic. 3. States every intention important to the programmers. 4. Has the fewest possible classes & methods." Code may easily suck but pass item 1. That's why the others exist. Code that back-patches to cover over a bug (in any way conceivable) violates 2. and 4. This is an absolutely correct example of "emergent design". Overly anal architects may spend their time adding rules, such as "No backpatching to cover bugs." But a set of reduced instructions beats a set of deliberately enhanced ones every time. -- Phlip phlip_cpp@yahoo.com http://www.greencheese.org/AndNowaNitelyLitelyUrbanOne -- Who needs a degree when we have Web e-search engines? --