From: Kent Beck Date: 2001-12-12T09:23:56+09:00 Subject: [ruby-talk:28294] Re: John Roth dolt ( Re: A challenge to proponents of Unit Testing. ) Kent Beck wrote in message news:9v4dab$m80$1@suaar1ab.prod.compuserve.com... > The earlier note that I ignored ill-formed triangles (5,5,11) is absolutely > correct. I missed those test cases. I'll post the updated code and tests > later. The test is: TriangleTest>>testIrrational [self evaluate: 1 side: 2 side: 3] on: Exception do: [:ex | ^self]. self fail The fix is: TriangleTest>>evaluate: aNumber1 side: aNumber2 side: aNumber3 | sides | sides := SortedCollection with: aNumber1 with: aNumber2 with: aNumber3. sides first <= 0 ifTrue: [self fail]. (sides at: 1) + (sides at: 2) <= (sides at: 3) ifTrue: [self fail]. ^sides asSet size Which points out that the original test for scalenes is not well formed, so we change the data to: TriangleTest>>testScalene self assert: (self evaluate: 2 side: 3 side: 4) = 3 More test cases, anyone? Kent