Pathologically Eclectic Rubbish Lister | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Ideally, I'd want the subclass to inherit all the superclass tests. This is a source of confusion, in my mind at least, though dws touched on it earlier also. There are two "chains of inheritance", for want of a better term, involved in this discussion. We have the superclass & subclass chain, and we have the superclass tests and the possiblity of the tests for the subclass 'inheriting' those within the superclass. My view, based on my accumulated wisdom -- I use the term loosely -- from exposure to the various different methods I've used, is that using inheritance in the test chain, regardless of whether this is formal, language based inheritance, or cruder mechanisms by which the tests for the superclass would be run as a part of the testing cycle of the subclass, is bad practice. My reasoning is, as I cited above
On the tyres thing: Most analogies don't stand up to deep scrutiny. I'll hold my hand-up here and say that I got a long way into arguing with your crash-test scenario -- or rather the purpose of crash testing vehicles -- before throwing it away and "moving on" :) abigail used it to make the point that sub-systems aren't islands and there is intereactions between them. I used to make the point that he was correct, but that the different testing is required at different stages. By their very nature, analogies tend to be over-simplified, but discussing the true nature of the system used in the anaology is fruitless. If the analogy helps in making the point being broached, it served it's purpose. If it didn't, move on. Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham"When I'm working on a problem, I never think about beauty. I think only how to solve the problem. But when I have finished, if the solution is not beautiful, I know it is wrong." -Richard Buckminster Fuller If I understand your problem, I can solve it! Of course, the same can be said for you. In reply to Re: Tests (Safety) vs Contracts (Correctness)
by BrowserUk
|
|