Similar to forensic psychology methods, code offender profiling techniques help us narrow down the search area within a codebase. In the next chapter, you’ll see the payoff on a large codebase where the hotspots make up a small percentage of the total code. That means we can focus our human expertise on smaller, more focused parts of the system. This opens up a number of possibilities:
Prioritize design issues: I started this investigation because I needed a way to plan and prioritize improvements to a legacy system. Some of the suggested improvements were redesigns that cost several weeks of intense work. I had to ensure we spent time on improvements that actually helped future development efforts. Hotspots, indicating complex code that changes frequently, proved to be great candidates. With the material in this chapter, you have the basis to do the same analysis yourself.
Perform code reviews: Code reviews have high defect-removal rates. A code review done right is also time-consuming. Because hotspots make good predictors of buggy code (see The Relationship Between Hotspots and Defects), they identify the parts where reviews would be a good investment of time.
Improve communication: On a recent project I used the results of a hotspot analysis to communicate with the test leader. That project had several skilled testers. They often spent the end of each iteration on exploratory testing. The test leader wanted a simple way to identify feature areas that could benefit from such additional testing. Hotspots make a perfect starting point for these kinds of tests.
Hotspots make good predictors of defects. If your development team maintains a bug database, it’s possible to map defects to modules in the code. For example, here’s how it looked on a system I investigated:

As you see in the diagram, defects tend to cluster in a few problematic modules. This is a typical pattern found in many systems. In this particular system, the hotspots made up only 4 percent of the code, yet they contained seven of the eight modules with the greatest number of defects.
Guided by hotspots, you’ll encircle those buggy areas with high precision. This allows you to improve the code that needs it the most.