From: tadamsmar@... (Tom Adams) Date: 2001-12-20T06:47:58+09:00 Subject: [ruby-talk:28990] Re: John Roth dolt ( Re: A challenge to proponents of Unit Testing. ) rbinder@rbsc.com (Bob Binder) wrote in message news:... > "Kent Beck" wrote in message news:<9v4dab$m80 > [snip] > > Use a sensible language where integers act like integers, not like 32-bit > > counter with rollover. If you want to write a Java version of the function, > > and show what happens with 2^31, feel free to write those test cases. > > > Surely there's a limit at some size -- could you report to us how many > milli-seconds and the value of i at which your Smalltalk of choice > complains if you do something like > > int i,j; > j=2; > maxInt=0x7FFFFFFF; > for(i=1;i > Please excuse my use of this barbaric tongue to state the > requirements, but I was never able to abide the mental contortion that > Smalltalk syntax imposed on my feeble brain. And please feel free to > run up maxInt to infinity and beyond, if my guess doesn't do the job. > > When you've found out what the limit L is in your environment, then > add 3 tests: {L,L,L},(L-1,L,L}, {L,L-1,L-2}. All are valid triangles > in the bounds of your representation, and should therefore be > correctly classified. > With the triangle problem, the function might run out of memory when it tries to sum two of the sides for very large integers. Ken Beck has not addressed this issue in his "comprehensive" set of test.