in reply to (How) Do you document/test your private subroutines?
I don't document private subs in POD because users read POD and private subs are not for users. They can be for devs, however, so I tend to document them where devs would look, ie. in comments in the source. As most private subs are pretty short this approach has few snags, IME.
To test or not to test depends on the purpose of the sub and the logic therein. If the public subs can be tested simply and give full coverage of the private subs then there's no real need for anything further. The more awkward/gnarly/horrendous ones do receive more special attention however - it can be helpful during dev and thereafter for regressions of course.
TBH, the work done to polish private subs like this is generally way down the list of priorities. It's not as if there are hard and fast rules which must be adhered to. Let's just say such documentation and tests are aspirations.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: (How) Do you document/test your private subroutines?
by stevieb (Canon) on Nov 06, 2018 at 23:58 UTC |