From what I gather, my mantra for this class is going to be "test, test, test". Test this, test that. Test things you're not sure work, test things that you know will work. Test new, test old. Test. Test. Test. While this won't be hard to adapt to, it is definitely different than my normal "let's just get it written and hopefully it will work when I run it" mentality. If I want to be a more marketable programmer, I need a high deliverability rate. I don't want to be responsible for a project that falls flat and fails at the slightest hiccup. I especially don't want to be responsible for an error like the one that caused the launch failure for the Ariane 5 rocket. Something as simple as a floating point conversion can lead to sever economic loss. I am learning, however.
Today, while meeting to work on a project for a different class, my partner went straight to coding a solution he thought would work. To his surprise, and to my complete lack of surprise, it started to break down right out of the gate. So, before trying to go through the code line by line in order to determine what went wrong, I instead decided to scrap most of what we had accomplished and wrote a few unit tests to help guide us in reconstructing out solution. After writing the program around these test cases, we were able to achieve the correct answer in less time than it would have taken trying to fix the solution we had started with.
Anyways. Until next week...
No comments:
Post a Comment