From: Stefan Schmiedl Date: 2001-12-11T04:25:00+09:00 Subject: [ruby-talk:28129] Re: John Roth dolt ( Re: A challenge to proponents of Unit Testing. ) Joe Pallas (pallas at cs dot stanford dot edu) (2001-12-11 03:40): > Since you've implied that your function will always throw an exception > for bad arguments, let me point out that the MTFB of your function is > zero if given either of the inputs (5, 5, 11), which it will incorrectly > report to be an isosceles triangle, or (1, 3, 7), which it will > incorrectly report to be a scalene triangle. > I would definitely prefer to factor deciding the validity into a separate method which is tested separately. Classification is so much easier when you know the species. Besides, I understood the message which started this discussion, to classifiy a triangle described by its sides. So it is up to the environment to decide whether (5,5,11) is passed into classification (would be possible in non-Euclidean geometries I think). Or if Euclidean borderline cases as (5,5,10) are considered as triangles or not. Seeing it this way makes for smaller methods which I can easier understand. Of course, your mileage may vary. s. -- Stefan Schmiedl EDV-Beratung, Programmierung, Schulung Loreleystr. 5, 94315 Straubing, Germany Tel. (0 94 21) 74 01 06 Public Key: http://xss.de/stefan.public shhhh ... I can't hear my code!