From: Ryan Leavengood Date: 2005-05-07T04:09:10+09:00 Subject: Re: Typo-checking instead of static typing Ben Giddings wrote: > > My question is this. If the "Ruby Way" to find this bug is by unit tests, > what suite of tests would be recommended for this snippet of code? Keep > in mind, that the original code is only 8 lines long. > > Is it realistic to expect that someone would write more than 8 lines of > unit tests? Absolutely. In fact, this should be the norm. When you consider edge cases and a good sampling of non-edge cases, the unit test can quickly outgrow the code being tested. It may seem like a lot of work, but that work continues to pay off everytime you run the tests, especially after code changes or refactorings. Ryan