基于代码变更预训练模型的即时缺陷预测方法及存储介质
By using a pre-trained model based on code changes, and employing five pre-training tasks to establish semantic connections between code changes and submission comments, this approach solves the problem of inconsistency between pre-training tasks and fine-tuning targets in existing technologies, and achieves efficient real-time defect prediction and code change understanding.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NAT UNIV OF DEFENSE TECH
- Filing Date
- 2023-11-14
- Publication Date
- 2026-07-17
AI Technical Summary
Existing pre-trained models cannot effectively utilize domain knowledge of code changes in real-time defect prediction, resulting in an inconsistency between the pre-training task and the fine-tuning objective, making it difficult to achieve efficient real-time defect prediction.
We employ a code change-based pre-trained model. Through the steps of constructing training data, preprocessing, model pre-training, and real-time defect prediction, we utilize five pre-training tasks to establish semantic connections between code changes and submission comments. These tasks include mask language modeling for code changes, mask language modeling for submission comments, NL→PL generation, PL→NL generation, and structure-aware pre-training tasks, thereby enhancing the model's ability to understand code changes.
It achieves real-time defect detection with simple principles, easy implementation, and wide applicability. It can effectively utilize domain knowledge of code changes in a large amount of unlabeled data, thereby improving the efficiency and accuracy of code change-related tasks.
Smart Images

Figure CN117785207B_ABST