From: Steve F. <st...@m3...> - 2002-09-02 19:01:22
|
From: "Oren Gross" <og...@me...> > The biggest problem with Mock Objects, is that it assumes that each tested > method, receives the mockable object as a parameter. I know that designers > believe that this is the right way to do stuff, but: > 1. It is not always possible. > 2. Sometimes you test old code. > 3. This argument is questionable. Not exactly, our point is that the mockable object should be substitutable _somehow_, maybe during construction, maybe via a setter, maybe as a parameter. If you're working with horrible old code, then introducing interfaces that can be mocked is often the only way to test chunks of functionality. S. |