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 条
  • [21] DeepHunter: A Coverage-Guided Fuzz Testing Framework for Deep Neural Networks
    Xie, Xiaofei
    Ma, Lei
    Juefei-Xu, Felix
    Xue, Minhui
    Chen, Hongxu
    Liu, Yang
    Zhao, Jianjun
    Li, Bo
    Yin, Jianxiong
    See, Simon
    PROCEEDINGS OF THE 28TH ACM SIGSOFT INTERNATIONAL SYMPOSIUM ON SOFTWARE TESTING AND ANALYSIS (ISSTA '19), 2019, : 146 - 157
  • [22] JITfuzz: Coverage-guided Fuzzing for JVM Just-in-Time Compilers
    Wu, Mingyuan
    Lu, Minghai
    Cui, Heming
    Chen, Junjie
    Zhang, Yuqun
    Zhang, Lingming
    2023 IEEE/ACM 45TH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING, ICSE, 2023, : 56 - 68
  • [23] StFuzzer: Contribution-Aware Coverage-Guided Fuzzing for Smart Devices
    Yang, Jiageng
    Zhang, Xinguo
    Lu, Hui
    Shafiq, Muhammad
    Tian, Zhihong
    SECURITY AND COMMUNICATION NETWORKS, 2021, 2021
  • [24] CAGFuzz: Coverage-Guided Adversarial Generative Fuzzing Testing for Image-Based Deep Learning Systems
    Zhang, Pengcheng
    Ren, Bin
    Dong, Hai
    Dai, Qiyin
    IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 2022, 48 (11) : 4630 - 4646
  • [25] Industry Practice of Coverage-Guided Enterprise-Level DBMS Fuzzing
    Wang, Mingzhe
    Wu, Zhiyong
    Xu, Xinyi
    Liang, Jie
    Zhou, Chijin
    Zhang, Huafeng
    Jiang, Yu
    2021 IEEE/ACM 43RD INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING: SOFTWARE ENGINEERING IN PRACTICE (ICSE-SEIP 2021), 2021, : 328 - 337
  • [26] Coverage-Guided Tensor Compiler Fuzzing with Joint IR-Pass Mutation
    Liu, Jiawei
    Wei, Yuxiang
    Yang, Sen
    Deng, Yinlin
    Zhang, Lingming
    PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2022, 6 (OOPSLA):
  • [27] CriticalFuzz: A critical neuron coverage-guided fuzz testing framework for neural networks
    Bai, Tongtong
    Huang, Song
    Huang, Yifan
    Wang, Xingya
    Xia, Chunyan
    Qu, Yubin
    Yang, Zhen
    INFORMATION AND SOFTWARE TECHNOLOGY, 2024, 172
  • [28] Detection of Hardware Trojans in SystemC HLS Designs via Coverage-guided Fuzzing
    Le, Hoang M.
    Grosse, Daniel
    Bruns, Niklas
    Drechsler, Rolf
    2019 DESIGN, AUTOMATION & TEST IN EUROPE CONFERENCE & EXHIBITION (DATE), 2019, : 602 - 605
  • [29] Efficient Cross-Level Processor Verification using Coverage-guided Fuzzing
    Bruns, Niklas
    Herdt, Vladimir
    Grosse, Daniel
    Drechsler, Rolf
    PROCEEDINGS OF THE 32ND GREAT LAKES SYMPOSIUM ON VLSI 2022, GLSVLSI 2022, 2022, : 97 - 103
  • [30] EPF: An Evolutionary, Protocol-Aware, and Coverage-Guided Network Fuzzing Framework
    Helmke, Rene
    Winter, Eugen
    Rademacher, Michael
    2021 18TH INTERNATIONAL CONFERENCE ON PRIVACY, SECURITY AND TRUST (PST), 2021,