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 ...

Get Quality Code: Software Testing Principles, Practices, and Patterns now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.