in reply to Re^4: "Accessors break encapsulation"
in thread "Accessors break encapsulation"?
Otherwise, you'll probably end up doing more work to manage all the code coverage cases. That is, you'll need to do the same code coverage, but you'll have to reason out how to get to each submethod, and ensure you pass it the right parameters to ensure all of it's children get called.
I find that this is rarely a problem in real world usage. This is probably a side effect of doing TDD. If I factor out a private method from a public method then the coverage of my test suite isn't going to change, and if I change my private method I'll always write a test first.
To put it another way, if you aren't exercising all of the code in your private methods why did you need to write them in the first place?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: "Accessors break encapsulation"
by tlm (Prior) on Jul 21, 2005 at 13:16 UTC | |
by simonm (Vicar) on Jul 21, 2005 at 15:44 UTC | |
by adrianh (Chancellor) on Jul 21, 2005 at 16:08 UTC | |
by tye (Sage) on Jul 21, 2005 at 21:25 UTC | |
by jplindstrom (Monsignor) on Jul 21, 2005 at 20:13 UTC |