Over the past few years, deep neural networks (DNNs) have been continuously expanding their real-world applications for source code processing tasks across the software engineering domain, e.g., clone detection, code search, comment generation. Although quite a few recent works have been performed on testing of DNNs in the context of image and speech processing, limited progress has been achieved so far on DNN testing in the context of source code processing, that exhibits rather unique characteristics and challenges. In this paper, we propose a search-based testing framework for DNNs of source code embedding and its downstream processing tasks like Code Search. To generate new test inputs, we adopt popular source code refactoring tools to generate the semantically equivalent variants. For more effective testing, we leverage the DNN mutation testing to guide the testing direction. To demonstrate the usefulness of our technique, we perform a large-scale evaluation on popular DNNs of source code processing based on multiple state-of-the-art code embedding methods (i.e., Code2vec, Code2seq and CodeBERT). The testing results show that our generated adversarial samples can on average reduce the performance of these DNNs from 5.41% to 9.58%. Through retraining the DNNs with our generated adversarial samples, the robustness of DNN can improve by 23.05% on average. The evaluation results also show that our adversarial test generation strategy has the least negative impact (median of 3.56%), on the performance of the DNNs for regular test data, compared to the other methods.


翻译:过去几年来,深层神经网络(DNN)在软件工程领域不断扩大其源码处理任务的实际应用,例如克隆检测、代码搜索、评论生成等。虽然在图像和语音处理方面最近对 DNN 测试做了一些工作,但在图像和语音处理方面,迄今为止在DNN 测试方面进展有限,在源码处理方面,对源码嵌入和下游处理任务(如代码搜索)的 DNN 测试框架非常独特。为了产生新的测试投入,我们采用了流行源码重新构思工具来生成等同的变体。为了进行更有效的测试,我们利用DNNN突变测试来指导测试方向。为了展示我们技术的效用,我们对源码处理的流行 DNNN 进行大规模评估,基于多种状态的代码最小嵌入方法(即代码2vec、代码2SECE和DCBBERT)进行。为了产生新的测试投入,我们采用了流行的源码再培训效果,我们正常的D.58NNR 测试结果可以显示我们正常的D 的D 测试结果。通过正常的D 测试结果,通过测试结果可以显示我们正常的D 的D 的D 测试结果,通过测试结果来显示我们正常的RNNNNNR 。

0
下载
关闭预览

相关内容

深度学习搜索,Exploring Deep Learning for Search
专知会员服务
57+阅读 · 2020年5月9日
【新书】深度学习搜索,Deep Learning for Search,附327页pdf
专知会员服务
203+阅读 · 2020年1月13日
《DeepGCNs: Making GCNs Go as Deep as CNNs》
专知会员服务
30+阅读 · 2019年10月17日
Keras François Chollet 《Deep Learning with Python 》, 386页pdf
专知会员服务
144+阅读 · 2019年10月12日
Unsupervised Learning via Meta-Learning
CreateAMind
41+阅读 · 2019年1月3日
A Technical Overview of AI & ML in 2018 & Trends for 2019
待字闺中
16+阅读 · 2018年12月24日
Facebook PyText 在 Github 上开源了
AINLP
7+阅读 · 2018年12月14日
LibRec 精选:推荐系统的论文与源码
LibRec智能推荐
14+阅读 · 2018年11月29日
【NIPS2018】接收论文列表
专知
5+阅读 · 2018年9月10日
LibRec 精选:连通知识图谱与推荐系统
LibRec智能推荐
3+阅读 · 2018年8月9日
Python机器学习教程资料/代码
机器学习研究会
8+阅读 · 2018年2月22日
【推荐】深度学习目标检测全面综述
机器学习研究会
21+阅读 · 2017年9月13日
【推荐】GAN架构入门综述(资源汇总)
机器学习研究会
10+阅读 · 2017年9月3日
Arxiv
17+阅读 · 2021年2月15日
Arxiv
16+阅读 · 2021年1月27日
Arxiv
12+阅读 · 2020年6月20日
VIP会员
相关资讯
Unsupervised Learning via Meta-Learning
CreateAMind
41+阅读 · 2019年1月3日
A Technical Overview of AI & ML in 2018 & Trends for 2019
待字闺中
16+阅读 · 2018年12月24日
Facebook PyText 在 Github 上开源了
AINLP
7+阅读 · 2018年12月14日
LibRec 精选:推荐系统的论文与源码
LibRec智能推荐
14+阅读 · 2018年11月29日
【NIPS2018】接收论文列表
专知
5+阅读 · 2018年9月10日
LibRec 精选:连通知识图谱与推荐系统
LibRec智能推荐
3+阅读 · 2018年8月9日
Python机器学习教程资料/代码
机器学习研究会
8+阅读 · 2018年2月22日
【推荐】深度学习目标检测全面综述
机器学习研究会
21+阅读 · 2017年9月13日
【推荐】GAN架构入门综述(资源汇总)
机器学习研究会
10+阅读 · 2017年9月3日
Top
微信扫码咨询专知VIP会员