If something is numerical in nature always unit test

This is part of the Semicolon&Sons Code Diary - consisting of lessons learned on the job. You're in the testing category.

Last Updated: 2024-04-25

When I was building the social insurance calculator, there were about 8 branches through its somewhat complex logic. I built it without any unit testing, and later discovered, when someone emailed in no less, that it was incorrect.

Lesson learned: - It's far too easy to get false confidence in numerical code since it always compiles. Remain thorough and instead unit test the heck out of it before delivery.