3 ms·
Basically, it’s a good chance to: 1.) Question whether that codepath should be gated to a particular day of the week. 2.) Assess the cost of that codepath fai
by hluska 7y ago
Basically, it’s a good chance to:
1.) Question whether that codepath should be gated to a particular day of the week.
2.) Assess the cost of that codepath failing (or failing to load). Does it have the potential to brick the project?
3.) How big could the bug be? If software tells me it’s “just another manic Monday” on Tuesday, or that I should “Walk like an Egyptian” on February 31, who cares? There is no incentive to unit test because honestly, who cares? On the other hand, if it has the potential to brick the project, go back to #1. Do you really need to test the day of the week? Are you bloody sure?? :)
4.) If you reach #4, it’s time to invest in unit tests. You wrote a condition where a day of the week test could result in software failure.