From: "Robert C. Martin" Date: 2001-12-17T23:57:09+09:00 Subject: [ruby-talk:28780] Re: test-first On Sun, 16 Dec 2001 17:28:11 GMT, Daniel wrote: >Mr. Martin claims that XP "advocates writing tests that are so simple >that they can be eyeballed to work." I say that all your functions >should be written that way. In which case, the tests are superfluous >because we can just look at the function and know it works. (Assuming, >of course, that all the functions this one calls work. :-) The tests are a fast way to determine that the new code you just wrote hasn't broken any of the older code. Yes all functions should be written to be small and obvious; and there should be no coupling between them. But we know how difficult this is in practice; and that one small function will, in fact, cause failures in another from time to time. Thus, we write tests that find those failures rather than depend upon our eyeballs. 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