ISM’s Predictive Pro predicts potential code weaknesses
Code analysis tool identifies bug hot spots to focus QA efforts
Prediction in practice
Predictive Pro’s major functions are categorized as “modes.” Standard Mode uses the same non-AI forecasting used by the Lite edition. Standard Mode is made available in the Pro edition for the simple reason that it provides results fresh from the box, with no learning phase needed.
Heuristic Mode employs the educable AI engine and is the mode you’ll use when a project is under way. Error Trend Mode, as mentioned above, highlights methods that have proved to be bug breeding grounds so you can avoid them.
All three modes present in a spreadsheet-style tabular view that’s easy to navigate. Each row in the table corresponds to a method in the application. A navigation window to the left allows you to drill down into methods within specific modules or to rise to the top of the project tree and see all the methods. Columns in the table hold the metric information and historical bug data for each method.
Predictive Pro collects quite a few metrics, including simple information such as lines of code, characters of comment, lines of comment, and so on. It also calculates more elaborate metrics, such as number of returns in a method (the fewer, the better); cyclomatic complexity, a measure of the branching within flows of control in the method; Halstead metrics, 11 measurements that estimate the mental effort required to develop the method; and structural and architectural complexity. Structural measures the complexity of the code based on its configuration, and architectural measures the complexity of the code based on its interaction with other code. Both are metrics unique to the Predictive Products.
Cells in the table are colored green, yellow, and red, based on the method’s risk level. The specific metrics -- or historical bug data -- used in the analysis are also color-coded. That is, if a method has been flagged as high risk, metrics that have exceeded acceptable limits show up in red -- making it easy to identify them during code review.
As with all AI-based products, Predictive Pro is no panacea -- even when it works at its best. To make the best use of it, you must be well-acquainted with your project’s architecture. For example, even if the Error Trend report indicates that a particular method is error-prone, it may actually be a little-used method that has less of an impact on your product than other, less error-prone methods.
Although it’s unlikely that developers of small projects will need Predictive Pro, large projects pressed for time and resources should find this a worthwhile guide in directing testing efforts. Used over time, it will get better and better at spotlighting specific weaknesses in your team’s development efforts -- and may just save you a boatload of time and frustration.