当前位置: X-MOL 学术arXiv.cs.SE › 论文详情
Our official English website, www.x-mol.net, welcomes your feedback! (Note: you will need to create a separate account there.)
CoCoFuzzing: Testing Neural Code Models with Coverage-Guided Fuzzing
arXiv - CS - Software Engineering Pub Date : 2021-06-17 , DOI: arxiv-2106.09242
Moshi Wei, Yuchao Huang, Jinqiu Yang, Junjie Wang, Song Wang

Deep learning-based code processing models have shown good performance for tasks such as predicting method names, summarizing programs, and comment generation. However, despite the tremendous progress, deep learning models are often prone to adversarial attacks, which can significantly threaten the robustness and generalizability of these models by leading them to misclassification with unexpected inputs. To address the above issue, many deep learning testing approaches have been proposed, however, these approaches mainly focus on testing deep learning applications in the domains of image, audio, and text analysis, etc., which cannot be directly applied to neural models for code due to the unique properties of programs. In this paper, we propose a coverage-based fuzzing framework, CoCoFuzzing, for testing deep learning-based code processing models. In particular, we first propose ten mutation operators to automatically generate valid and semantically preserving source code examples as tests; then we propose a neuron coverage-based approach to guide the generation of tests. We investigate the performance of CoCoFuzzing on three state-of-the-art neural code models, i.e., NeuralCodeSum, CODE2SEQ, and CODE2VEC. Our experiment results demonstrate that CoCoFuzzing can generate valid and semantically preserving source code examples for testing the robustness and generalizability of these models and improve the neuron coverage. Moreover, these tests can be used to improve the performance of the target neural code models through adversarial retraining.

中文翻译:

CoCoFuzzing:使用覆盖引导模糊测试测试神经代码模型

基于深度学习的代码处理模型在预测方法名称、总结程序和注释生成等任务中表现出良好的性能。然而,尽管取得了巨大的进步,但深度学习模型往往容易受到对抗性攻击,这会导致这些模型的鲁棒性和泛化性受到意想不到的输入错误分类的严重威胁。针对上述问题,已经提出了很多深度学习测试方法,但是这些方法主要侧重于测试深度学习在图像、音频和文本分析等领域的应用,不能直接应用于神经模型代码由于程序的独特属性。在本文中,我们提出了一个基于覆盖的模糊测试框架 CoCoFuzzing,用于测试基于深度学习的代码处理模型。特别是,我们首先提出了十个变异算子来自动生成有效且语义上保留的源代码示例作为测试;然后我们提出了一种基于神经元覆盖的方法来指导测试的生成。我们研究了 CoCoFuzzing 在三个最先进的神经代码模型上的性能,即 NeuralCodeSum、CODE2SEQ 和 CODE2VEC。我们的实验结果表明 CoCoFuzzing 可以生成有效且语义保留的源代码示例,用于测试这些模型的鲁棒性和通用性并提高神经元覆盖率。此外,这些测试可用于通过对抗性再训练来提高目标神经代码模型的性能。然后我们提出了一种基于神经元覆盖的方法来指导测试的生成。我们研究了 CoCoFuzzing 在三个最先进的神经代码模型上的性能,即 NeuralCodeSum、CODE2SEQ 和 CODE2VEC。我们的实验结果表明 CoCoFuzzing 可以生成有效且语义保留的源代码示例,用于测试这些模型的鲁棒性和通用性并提高神经元覆盖率。此外,这些测试可用于通过对抗性再训练来提高目标神经代码模型的性能。然后我们提出了一种基于神经元覆盖的方法来指导测试的生成。我们研究了 CoCoFuzzing 在三个最先进的神经代码模型上的性能,即 NeuralCodeSum、CODE2SEQ 和 CODE2VEC。我们的实验结果表明 CoCoFuzzing 可以生成有效且语义保留的源代码示例,用于测试这些模型的鲁棒性和通用性并提高神经元覆盖率。此外,这些测试可用于通过对抗性再训练来提高目标神经代码模型的性能。我们的实验结果表明 CoCoFuzzing 可以生成有效且语义保留的源代码示例,用于测试这些模型的鲁棒性和通用性并提高神经元覆盖率。此外,这些测试可用于通过对抗性再训练来提高目标神经代码模型的性能。我们的实验结果表明 CoCoFuzzing 可以生成有效且语义保留的源代码示例,用于测试这些模型的鲁棒性和通用性并提高神经元覆盖率。此外,这些测试可用于通过对抗性再训练来提高目标神经代码模型的性能。
更新日期:2021-06-18
down
wechat
bug