2 May 2006 04:01
Re: New Articles on XProgramming.com
Ron Jeffries <ronjeffries <at> XProgramming.com>
2006-05-02 02:01:34 GMT
2006-05-02 02:01:34 GMT
On Sunday, April 30, 2006, at 9:34:29 PM, June Kim wrote: >> > Finally, I see some difference in your style of TDDing from me. I try >> > to remove duplications in tests and try to cut the cases as "aspects". >> > My analogy is "rice rolled in dried laver", as we call it in Korea >> > Kimbab. http://images.google.co.kr/images?q=kimbab&sa=N&tab=wi You >> > can slice a Kimbab roll into pieces with varying sizes but every piece >> > has rice, carrot, spinach, dried seaweed and all the same ingridients. >> > If you disassemble the roll instead, you can get all of the >> > ingridients separate. In the test cases of open, spare, and perfect, >> > each one is testing separating frames, scoring each frame, summing >> > frames, and etc. The problem is that when there is any need to change >> > the code, due to the permeated aspects across many test cases, the >> > tests could be fragile and you are forced to change many of them at >> > once. (Of course those tests are valuable as integration tests.) I >> > think many uniformal test cases are a smell. When test cases are >> > written in ingrideints tests(disassembly), those cases reads like the >> > rules(declarative) described in the original requirements. >> >> I would be delighted to see an example of that style of TDD, in a >> language I can understand such as Ruby, Java, C#. From the >> description, I'm not quite getting it. > Sorry for not being clear. > When you are tdding a fibonacci sequence generator, you could follow > the steps of: > assert fibo(0) == 1 > assert fibo(1) == 1 > assert fibo(2) == 2 > assert fibo(3) == 3 > assert fibo(4) == 5 > assert fibo(5) == 8 > each being its own test case. You could feel confident enough just > doing those sequences. > What I prefer is, following the original problem statement: > Fibonacci sequence is a sequence that starts from 1 1 and then add the > last two numbers to get next. > Now I would compose todo list as: > fibo starts from 1 1 > add last two numbers > fibo expands with the result above > and etc > The former example(fibo(n) == m) is showing uniformal test cases and I > think there is a bad smell. For each test case, you see add last two > and expand the sequence and the start is 1 1, all intermingled. Interesting ... I guess I'd like to see an example worked out, especially where the algorithm isn't entirely known in advance. For example I wonder how you'd use your style in TDDing bowling in a conventional language ... Thanks for the conversation and the help with J. Very interesting! Ron Jeffries www.XProgramming.com A man hears what he wants to hear, and disregards the rest. -- Paul Simon To Post a message, send it to: extremeprogramming <at> eGroups.com To Unsubscribe, send a blank message to: extremeprogramming-unsubscribe <at> eGroups.com ad-free courtesy of objectmentor.com
RSS Feed