CoCoFuzzing: Testing Neural Code Models With Coverage-Guided Fuzzing

被引:4
|
作者
Wei, Moshi [1 ]
Huang, Yuchao [2 ]
Yang, Jinqiu [3 ]
Wang, Junjie [2 ]
Wang, Song [1 ]
机构
[1] York Univ, Toronto, ON M3J 1P3, Canada
[2] Chinese Acad Sci, Inst Software, Beijing 100045, Peoples R China
[3] Concordia Univ, Montreal, PQ H3G 1M8, Canada
关键词
Codes; Testing; Fuzzing; Neurons; Software; Biological neural networks; Task analysis; Code model; deep learning (DL); fuzzy logic; language model; robustness;
D O I
10.1109/TR.2022.3208239
中图分类号
TP3 [计算技术、计算机技术];
学科分类号
0812 ;
摘要
Deep learning (DL)-based code processing models have demonstrated good performance for tasks such as method name prediction, program summarization, and comment generation. However, despite the tremendous advancements, DL models are frequently susceptible to adversarial attacks, which pose a significant threat to the robustness and generalizability of these models by causing them to misclassify unexpected inputs. To address the issue above, numerous DL testing approaches have been proposed; however, these approaches primarily target testing DL applications in the domains of image, audio, and text analysis, etc., and cannot be "directly applied" to "neural models for code" due to the unique properties of programs. In this article, we propose a coverage-based fuzzing framework, CoCoFuzzing, for testing DL-based code processing models. In particular, we first propose 10 mutation operators to automatically generate validly and semantically preserving source code examples as tests, followed by a neuron coverage (NC)-based approach for guiding the generation of tests. The performance of CoCoFuzzing is evaluated using three state-of-the-art neural code models, i.e., NeuralCodeSum, CODE2SEQ, and CODE2VEC. Our experiment results indicate that CoCoFuzzing can generate validly and semantically preserving source code examples for testing the robustness and generalizability of these models and enhancing NC. Furthermore, these tests can be used for adversarial retraining to improve the performance of neural code models.
引用
收藏
页码:1276 / 1289
页数:14
相关论文
共 50 条
  • [1] Coverage-guided Fuzzing for Feedforward Neural Networks
    Xie, Xiaofei
    Chen, Hongxu
    Li, Yi
    Ma, Lei
    Liu, Yang
    Zhao, Jianjun
    34TH IEEE/ACM INTERNATIONAL CONFERENCE ON AUTOMATED SOFTWARE ENGINEERING (ASE 2019), 2019, : 1162 - 1165
  • [2] TensorFuzz: Debugging Neural Networks with Coverage-Guided Fuzzing
    Odena, Augustus
    Olsson, Catherine
    Andersen, David G.
    Goodfellow, Ian
    INTERNATIONAL CONFERENCE ON MACHINE LEARNING, VOL 97, 2019, 97
  • [3] SPINALFUZZ: Coverage-Guided Fuzzing for SpinalHDL Designs
    Ruep, Katharina
    Grosse, Daniel
    2022 IEEE EUROPEAN TEST SYMPOSIUM (ETS 2022), 2022,
  • [4] Coverage-Guided Testing for Recurrent Neural Networks
    Huang, Wei
    Sun, Youcheng
    Zhao, Xingyu
    Sharp, James
    Ruan, Wenjie
    Meng, Jie
    Huang, Xiaowei
    IEEE TRANSACTIONS ON RELIABILITY, 2022, 71 (03) : 1191 - 1206
  • [5] REFuzz: A Remedy for Saturation in Coverage-Guided Fuzzing
    Lyu, Qian
    Zhang, Dalin
    Da, Rihan
    Zhang, Hailong
    ELECTRONICS, 2021, 10 (16)
  • [6] Fw-fuzz: A code coverage-guided fuzzing framework for network protocols on firmware
    Gao, Zicong
    Dong, Weiyu
    Chang, Rui
    Wang, Yisen
    CONCURRENCY AND COMPUTATION-PRACTICE & EXPERIENCE, 2022, 34 (16):
  • [7] RIFF: Reduced Instruction Footprint for Coverage-Guided Fuzzing
    Wang, Mingzhe
    Liang, Jie
    Zhou, Chijin
    Jiang, Yu
    Wang, Rui
    Sun, Chengnian
    Sun, Jiaguang
    PROCEEDINGS OF THE 2021 USENIX ANNUAL TECHNICAL CONFERENCE, 2021, : 147 - 159
  • [8] FOX: Coverage-guided Fuzzing as Online Stochastic Control
    She, Dongdong
    Storek, Adam
    Xie, Yuchong
    Kweon, Seoyoung
    Srivastava, Prashast
    Jana, Suman
    2024 IEEE/ACM INTERNATIONAL WORKSHOP ON SEARCH-BASED AND FUZZ TESTING, SBFT 2024, 2024, : 57 - 58
  • [9] Enhancing Coverage-Guided Fuzzing via Phantom Program
    Wu, Mingyuan
    Chen, Kunqiu
    Luo, Qi
    Xiang, Jiahong
    Qi, Ji
    Chen, Junjie
    Cui, Heming
    Zhang, Yuqun
    PROCEEDINGS OF THE 31ST ACM JOINT MEETING EUROPEAN SOFTWARE ENGINEERING CONFERENCE AND SYMPOSIUM ON THE FOUNDATIONS OF SOFTWARE ENGINEERING, ESEC/FSE 2023, 2023, : 1037 - 1049
  • [10] Coverage-guided fuzzing for deep reinforcement learning systems
    Wan, Xiaohui
    Li, Tiancheng
    Lin, Weibin
    Cai, Yi
    Zheng, Zheng
    JOURNAL OF SYSTEMS AND SOFTWARE, 2024, 210