From: Universe Date: 2001-12-11T15:22:36+09:00 Subject: [ruby-talk:28180] Re: John Roth dolt ( Re: A challenge to proponents of Unit Testing. ) Robert C. Martin wrote: >On Mon, 10 Dec 2001 10:23:12 -0800, "Joe Pallas (pallas at cs dot >>2) Your test cases are specific to the implementation, and will not >>adequately test a different implementation. >That's correct. Unit tests are white box tests. They are fragile to >significant changes of design. Why? Why wouldn't unit testing only worry about robustly meeting behavioral requirements. >Acceptance tests, on the other hand, >are black box tests that are completely insensative to changes in >design. You need both kinds of tests. Please explain, why unit tests are white box, while acceptance - unit, or other? - are not. You all don't even get one of the big bennies of testing by units. Being able to plug working units together purely based upon behavioral design contract. Your units - being tested and doing the testing - appear to be writhing worm balls of LoD violating, encapsulation slap happiness. You better have courage with XP cause your sanity is going to be truly "encapsulatedly" tested (you don't care how one thinks rationally, just lose it). >>This means that some future refactoring may make your tests inadequate, >>but the coder doing the refactoring would rely on your tests and check >>in broken code. Am I the only one who thinks this happening is awful? >One would hope that the programmers who were making the change would >review the tests. All you have for this travesty is "one would hope"? > One would also hope that there was an acceptance >test or two that would catch the bug. But in the end, you are right, >there are some design changes that might produce bugs that could pass >through the tests. I don't consider this a severe problem for most >projects since the incidence is not likely to be high. Really? In which Bizzaro world? This goes against the most basic ideas and proven practices with regard to both encapsulation and testing. >>> If your unit tests are large and complicated, you have a design problem, not >>> a testing problem. >>Again, this can only be true if your testing is dictated by the design, >>*rather than by the requirements.* Then you *do* have a design problem Because we established up above that for unit tests, you "white box" test based upon unit implementation. ??? >>That's not just backwards, it is >>doubly dangerous in the XP milieu, where frequent changes to the design >>are encouraged, and the only validation of those changes comes from the >>pre-existing tests. >Again, remember that XP has two kinds of tests. White box unit tests >and black box acceptance tests. How does that obviate the dangers of your unit testing process in this regard? Elliott -- http://www.radix.net/~universe ~*~ Enjoy! ~*~ Hail OO Modelling! * Hail the Wireless Web! @Elliott 2001 my comments ~ newsgroups+bitnet quote ok