5 ms·
Adding function parameters solely for testing purposes is bad. However, poorly-designed functions are often difficult to unit test. I don't know the entire ba
by mattrepl 14y ago
Adding function parameters solely for testing purposes is bad. However, poorly-designed functions are often difficult to unit test.
I don't know the entire backstory, but it appears someone wrote a publish! method that took a publish_time argument that was only intended to be used in testing. The problem is that the original code didn't properly support some publish_time values.
This is a good example of the library vs. framework distinction. Frameworks favor opinion over composition.