The invention belongs to the technical field of
software detection and repair, and discloses a
reinforcement learning-based patch generation
system, which comprises a code analysis module, a code defect detection unit, a defect
verification module, a
reinforcement learning training unit, a patch generation unit and a test and
verification module. The code analysis module is used for extracting a
source code from an input code file and generating an
abstract syntax tree corresponding to the
source code; and the code defect detection unit is connected with the code analysis module and is used for identifying the defect position and type in the target code. According to the scheme, end-to-end
processing from defect positioning identification to repair is realized through a closed-
loop design of code analysis, defect detection,
reinforcement learning repair and test
verification, a multi-module collaborative architecture is adopted, the defect detection accuracy is ensured by adopting a multi-mode defect detection and defect verification technology, the
false alarm rate is reduced, and the detection efficiency is improved. And generating a high-quality repair patch through an interpretable reinforcement learning framework.