Just another Perl shrine | |
PerlMonks |
Re^3: Test Driven Development, for software and for pancakesby stevieb (Canon) |
on Jul 23, 2017 at 23:14 UTC ( [id://1195849]=note: print w/replies, xml ) | Need Help?? |
I am going to provide a real-world example of why tests are very important, based on a situation I ran into today. I wanted to make some changes to my XS-based Bit::Manip distribution. One of my goals was to replace calls to stdint.h's pow() function with bit shift operations instead, to remove the reliance on the external library. With my full test suite in place, I could freely replace things like:
With:
...and not have to worry about a thing, because all I had to do was make the change, run the tests, and on fail, go back to the math. Once all tests passed, I knew I was good. Without a test suite, how would I ever know if I'm 100% accurate in my modification? I wouldn't be. Because all of my subs are covered entirely, I know that one change there didn't break anything within the sub its defined in, nor does the change break anything far away either.
In Section
Meditations
|
|