Detection of Variable Misuse Using Static Analysis Combined with Machine Learning (Gleb Morgachev, ISPRASOPEN-2019)
Материал из 0x1.tv
- Глеб Моргачев
Industrial static analyzers are able to detect only several narrow classes of algorithmic errors, for example actual arguments order swapped with formal parameters, forgotten renaming of variable after copy-paste. However, even for these categories essential part of errors is lost because of heuristical design of a checker. We propose the generalization of specified errors in the form of variable misuse problem and deal with it using machine learning.
The proposed method uses message propagation through the program model represented as a graph, combining data from multiple analysis levels, including AST, dataflow. We introduce several error criteria, which were evaluated on the set of open source projects with millions of LoC. Testing in close to industrial conditions shows good false positive and missed errors ratio comparable with remaining detectors and allows to include developed checker (after a minor rework) into a general purpose production static analyzer for error detection.
English translation of http://0x1.tv/20191205AH