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"...
It didn't start out as a module. It started as a bit of throw away code to build an array. It then turned into a sub in a small script for my own very limited use. Then, and only then, did I think it might be helpful to other people as it is a relatively general building block.
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.
Do you think otherwise?
In reply to Why the test didn't come first.... (was: Re^2: What to test in a new module)
by Bod
in thread What to test in a new module
by Bod
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |