From: Wilkes Joiner Date: 2001-12-03T11:09:41+09:00 Subject: [ruby-talk:27307] Re: Quantitative Unit-testing? (Re: John Roth dolt ( Re: A challenge to proponents of Unit Testing. ) Just my 2 cents... > I.e. how can we know nobody is > violating the contract/specification expressed by my > tests-code? > > > > Their tests run? > > Not necessarily. If all their tests run, it does not > mean these tests exercise my components in all the > same ways as the 'real application' will. Does documentation prevent someone from using your component improperly? > BTW. Are you saying that this is how we should > interpret unit tests, as specifications of each > individual component ? It is certainly more concrete and less ambiguous than documentation. Especially when you consider that a lot of programmers prefer writing code over writing "interface contracts". I have seen a few "specifications" that time and lack of maintenance have rendered not only obsolete but down right dangerous to use. > We do not know if *their* test-cases represent every > way their component is used in the real application, They almost certainly don't, but some tests are better than no tests, and running code is better than a document that says, "this is how it *should* run." > and we don't know if their test-cases call my > components at all. So I'd rather rely on 'my > software being correct' than assuming that a) their > test cases run and b) their test run all the code > that is run in the production application. OK, so how do you *know* that your software is correct? How do you know that you were able to do a perfect translation of the specification into running code? How do you know that the person using your component understood your specification perfectly? I must be missing something. - Wilkes Joiner __________________________________________________ Do You Yahoo!? Buy the perfect holiday gifts at Yahoo! Shopping. http://shopping.yahoo.com