From: Panu Viljamaa Date: 2001-12-03T08:20:33+09:00 Subject: [ruby-talk:27300] Re: Quantitative Unit-testing? (Re: John Roth dolt ( Re: A challenge to proponents of Unit Testing. ) Ron Jeffries wrote: > On Sun, 02 Dec 2001 16:05:40 -0500, Panu Viljamaa > wrote: >If we start system building from tests first, we could declare that the tests *are* the "Specification" of the system. Then the question turns into: "How can we know all assumptions other components make about my component are expressed by my unit tests?". 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. BTW. Are you saying that this is how we should interpret unit tests, as specifications of each individual component ? We do not know if *their* test-cases represent every way their component is used in the real application, 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. Note that their test cases are explicitly meant to "unit-test" their component, not *my* component, nor what happens when their component is integrated with my component. If you're doing 'continuous integration', this may not seem such a big problem, because a flaw in one component may hide a flaw in another. But continuous integration then is not really very "component-based development". Unit testing and integration testing seem to be merged into one, right ? It's a bit like saying: "Its fine with us as long as the airplane flies. We need not make sure our components are of the highest quality, or even know how high quality they are. The airplane flies! ". -Panu Viljamaa