On Distribution Shift in Learning-based Bug Detectors

被引:0
|
作者
He, Jingxuan [1 ]
Beurer-Kellner, Luca [1 ]
Vechev, Martin [1 ]
机构
[1] Swiss Fed Inst Technol, Dept Comp Sci, Zurich, Switzerland
关键词
D O I
暂无
中图分类号
TP18 [人工智能理论];
学科分类号
081104 ; 0812 ; 0835 ; 1405 ;
摘要
Deep learning has recently achieved initial success in program analysis tasks such as bug detection. Lacking real bugs, most existing works construct training and test data by injecting synthetic bugs into correct programs. Despite achieving high test accuracy (e.g., >90%), the resulting bug detectors are found to be surprisingly unusable in practice, i.e., <10% precision when used to scan real software repositories. In this work, we argue that this massive performance difference is caused by a distribution shift, i.e., a fundamental mismatch between the real bug distribution and the synthetic bug distribution used to train and evaluate the detectors. To address this key challenge, we propose to train a bug detector in two phases, first on a synthetic bug distribution to adapt the model to the bug detection domain, and then on a real bug distribution to drive the model towards the real distribution. During these two phases, we leverage a multi-task hierarchy, focal loss, and contrastive learning to further boost performance. We evaluate our approach extensively on three widely studied bug types, for which we construct new datasets carefully designed to capture the real bug distribution. The results demonstrate that our approach is practically effective and successfully mitigates the distribution shift: our learned detectors are highly performant on both our test set and the latest version of open source repositories. Our code, datasets, and models are publicly available at https://github.com/eth-sri/learning-real-bug-detector.
引用
收藏
页数:22
相关论文
共 50 条
  • [21] Machine Learning-based Anomaly Detection for Post-silicon Bug Diagnosis
    DeOrio, Andrew
    Li, Qingkun
    Burgess, Matthew
    Bertacco, Valeria
    DESIGN, AUTOMATION & TEST IN EUROPE, 2013, : 491 - 496
  • [22] Study of Information Retrieval and Machine Learning-Based Software Bug Localization Models
    Tamanna
    Sangwan, Om Prakash
    ADVANCES IN COMPUTING AND INTELLIGENT SYSTEMS, ICACM 2019, 2020, : 503 - 510
  • [23] Learning to Reduce False Positives in Analytic Bug Detectors
    Kharkar, Anant
    Moghaddam, Roshanak Zilouchian
    Jin, Matthew
    Liu, Xiaoyu
    Shi, Xin
    Clement, Colin
    Sundaresan, Neel
    2022 ACM/IEEE 44TH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING (ICSE 2022), 2022, : 1307 - 1316
  • [24] BUG DETECTORS
    REYNOLDS, S
    TRAC-TRENDS IN ANALYTICAL CHEMISTRY, 1989, 8 (07) : 245 - 246
  • [25] Towards a learning-based mode shift model: a conceptual framework
    Idris, Ahmed Osman
    Shalaby, Amer
    Habib, Khandker M. Nurul
    TRANSPORTATION LETTERS-THE INTERNATIONAL JOURNAL OF TRANSPORTATION RESEARCH, 2012, 4 (01): : 15 - 27
  • [26] Bug detectors
    Tsuneyasu Kaisho
    Shizuo Akira
    Nature, 2001, 414 : 701 - 703
  • [27] Evading deep learning-based DGA detectors: current problems and solutions
    de Haan, Puck
    Chiscop, Irina
    Poppink, Bram
    Kamphuis, Yori
    ARTIFICIAL INTELLIGENCE AND MACHINE LEARNING FOR MULTI-DOMAIN OPERATIONS APPLICATIONS VI, 2024, 13051
  • [28] Slowing Down the Aging of Learning-Based Malware Detectors With API Knowledge
    Zhang, Xiaohan
    Zhang, Mi
    Zhang, Yuan
    Zhong, Ming
    Zhang, Xin
    Cao, Yinzhi
    Yang, Min
    IEEE TRANSACTIONS ON DEPENDABLE AND SECURE COMPUTING, 2023, 20 (02) : 902 - 916
  • [29] Meta Learning-Based MIMO Detectors: Design, Simulation, and Experimental Test
    Zhang, Jing
    He, Yunfeng
    Li, Yu-Wen
    Wen, Chao-Kai
    Jin, Shi
    IEEE TRANSACTIONS ON WIRELESS COMMUNICATIONS, 2021, 20 (02) : 1122 - 1137
  • [30] A Novel Assessment Framework for Learning-based Deepfake Detectors in Realistic Conditions
    Lu, Yuhang
    Ebrahimi, Touradj
    APPLICATIONS OF DIGITAL IMAGE PROCESSING XLV, 2022, 12226