in reply to "Accessors break encapsulation"?
Yes, the general rule really only applies to public accessors and mutators. From the outside, you should be telling an object what to do and then let the object change its own state.
should a test suite test only the published API, or should it also test private methods?
A test suite should aim for the highest practical code coverage. For every public method called, there are probably some underlieing private methods called. The test suite may then end up having complete coverage of the object without actually calling private methods.
"There is no shame in being self-taught, only in not trying to learn in the first place." -- Atrus, Myst: The Book of D'ni.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: "Accessors break encapsulation"
by etm117 (Pilgrim) on Jul 19, 2005 at 15:35 UTC | |
by simonm (Vicar) on Jul 19, 2005 at 16:29 UTC | |
by etm117 (Pilgrim) on Jul 19, 2005 at 16:44 UTC | |
by Anonymous Monk on Jul 20, 2005 at 21:42 UTC | |
by adrianh (Chancellor) on Jul 21, 2005 at 13:06 UTC | |
by tlm (Prior) on Jul 21, 2005 at 13:16 UTC | |
|