From: David B Lightstone Date: 2001-12-08T23:57:06+09:00 Subject: [ruby-talk:27936] Re: John Roth dolt ( Re: A challenge to proponents of Unit Testing. ) "Robert C. Martin" wrote in message news:6nj21uo76gu2nfq92di0736dr4uags667k@4ax.com... > On 7 Dec 2001 02:04:08 -0800, stephen.hill@motorola.com (Steve Hill) > wrote: > > >What tests would you write for a function that takes 3 numbers (the > >side lengths of a triangle) , and returns whether the triangle is > >equilateral, scalene or isoceles. > > Set sides; // data structure allows no duplicates. > sides.add(a); > sides.add(b); > sides.add(c); > return sides; // 1 = equilateral, 2=isoceles, 3=scalene. > > What am I missing? Fault poorly defined enumerate, case NOT_A_TRIANGLE Failure to consider the default requirement of all applications - Bullet Proofing Take a problem, view it differently, and unknowingly change it. Your analysis is perfectly correct for your simplified problem. It just isn't the problem which was origninally presented > > > Robert C. Martin | "Uncle Bob" | Software Consultants > Object Mentor Inc. | rmartin@objectmentor.com | We'll help you get > PO Box 5757 | Tel: (800) 338-6716 | your projects done. > 565 Lakeview Pkwy | Fax: (847) 573-1658 | www.objectmentor.com > Suite 135 | | www.XProgramming.com > Vernon Hills, IL, | Training and Mentoring | www.junit.org > 60061 | OO, XP, Java, C++, Python| > > "One of the great commandments of science is: > 'Mistrust arguments from authority.'" -- Carl Sagan