From: "Robert C. Martin" Date: 2001-12-09T03:37:23+09:00 Subject: [ruby-talk:27958] Re: John Roth dolt ( Re: A challenge to proponents of Unit Testing. ) On Sat, 08 Dec 2001 00:35:43 -0600, Robert C. Martin wrote: >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.length(); // 1 = equilateral, 2=isoceles, 3=scalene. ^^^^^^^^^--oops. > >What am I missing? > > >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 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