Have you tried calling the methods with a selection of arguments (eg for dec2Hours() try NaN, negative number, 0, max Double etc) to see what happens?
If the parameter's value is illegal you can take appropriate action such as throwing an Exception.
I kind of did that. I will complete with things such as NaN, null, etc.
Another question: in general do you recommend writing the test/-s frist and later putting methods together? I just wonder because I remember having read this somewhere.
Another question: in general do you recommend writing the test/-s frist and later putting methods together? I just wonder because I remember having read this somewhere.
It's a good habit to get into.
Do I always do this? No.
Do I sometimes regret not doing it? Yes.
I have a knack for fixing things like this ... um ... sorry ... here is a consilitory tiny ad:
a bit of art, as a gift, that will fit in a stocking