Software Archeology

The difficulty of testing the error path of splitDateTime() and the fact that I could not figure out where the exception supposedly came from bothered me. It was time for an archeological expedition into the project’s history.

Searching back, I discovered that the error handling was added two years prior as part of a different function [4496926]. I also noticed that the body of the try block called a collaborator that was no longer involved in the present day code. About a year ago, it was refactored into its current function [e7c7d40], but the try block still called the collaborator. Finally, I found the code from ten months ago that replaced the original implementation with the current one [b838a21]. The current code could not throw the exception that it was catching and trying to process. As a result, I could delete the entire error handling block, the try/catch surrounding the implementation [6adc077], the placeholder to test the error path that no longer existed. This allowed me in turn to eliminate two now-unused parameters to splitDateTime().

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.14.252.56