|laziness, impatience, and hubris|
Why the test didn't come first.... (was: Re^2: What to test in a new module)by Bod (Priest)
|on Jan 29, 2023 at 21:14 UTC ( #11150025=note: print w/replies, xml )||Need Help??|
The Monastery has also taught you to write the tests first because the act of writing your tests changes and improves your module's design
You are quite correct - as usual...
However, I have extraordinary cognitive problems with doing this. Trying to work out what a module is going to do and how it will do it before writing a line of code is quite a leap of conceptualism for me. I do not doubt that I could learn this cognitive skill if coding and module design were my job but they are very much a sideline. At 55 my brain's plasticity is fading a little I notice which doesn't help.
Over in this node it was suggested that I might like to create a module for Well Known Binary (WKB) from the work I had already done to read one file. I started writing the tests for that module but it has ground to a halt because of the issue above.
Back to this "module"...
I don't think tests are necessary for bits of throw away code. Nor for simple scripts that are only intended to be used by me.
In Section Seekers of Perl Wisdom