We just learned how methods from forensic psychology let us find complex, buggy code and guide our refactoring efforts. Now it’s time to put the theory into practice. Together, we’re going to analyze a software system. In our case, the offender is problematic code, not criminals.
We’ll start by mining evolutionary data from a version-control system. We’ll then augment the change data with complexity estimates to identify hotspots. Along the way, we’ll stop to look at existing research to see how the analysis helps us spot maintenance problems and quality issues.
When you finish this chapter, you’ll be able to identify hotspots in your own code. As you’ll see, hotspots point you to the parts of the code where you’ll get the most from improvements in terms of time and money.
Finally, you’ll get tips on how to use the resulting information to prioritize design problems, guide manual work, and communicate within a project. We’ll also discuss the limitations of the hotspot concept.