Input constraints are useful for many software development tasks. For example, input constraints of a function enable the generation of valid inputs, i.e., inputs that follow these constraints, to test the function deeper. API functions of deep learning (DL) libraries have DL specific input constraints, which are described informally in the free form API documentation. Existing constraint extraction techniques are ineffective for extracting DL specific input constraints. To fill this gap, we design and implement a new technique, DocTer, to analyze API documentation to extract DL specific input constraints for DL API functions. DocTer features a novel algorithm that automatically constructs rules to extract API parameter constraints from syntactic patterns in the form of dependency parse trees of API descriptions. These rules are then applied to a large volume of API documents in popular DL libraries to extract their input parameter constraints. To demonstrate the effectiveness of the extracted constraints, DocTer uses the constraints to enable the automatic generation of valid and invalid inputs to test DL API functions. Our evaluation on three popular DL libraries (TensorFlow, PyTorch, and MXNet) shows that the precision of DocTer in extracting input constraints is 85.4%. DocTer detects 94 bugs from 174 API functions, including one previously unknown security vulnerability that is now documented in the CVE database, while a baseline technique without input constraints detects only 59 bugs. Most (63) of the 94 bugs are previously unknown, 54 of which have been fixed or confirmed by developers after we report them. In addition, DocTer detects 43 inconsistencies in documents, 39 of which are fixed or confirmed.


翻译:输入约束对许多软件开发任务至关重要。例如,函数的输入约束能够生成遵循约束的有效输入,从而更深入地测试函数。深度学习库的API函数具有深度学习特定的输入约束,这些约束在非正式的API自由文本文档中被非正式描述。现有约束提取技术难以有效提取深度学习特定输入约束。为填补这一空白,我们设计并实现了一种新技术DocTer,通过分析API文档提取深度学习API函数的特定输入约束。DocTer采用一种新颖算法,自动构建规则,从API描述的依存句法树模式中提取API参数约束。这些规则随后被应用于主流深度学习库的大量API文档中,以提取其输入参数约束。为验证提取约束的有效性,DocTer利用这些约束自动生成有效和无效输入,以测试深度学习API函数。我们在三个主流深度学习库(TensorFlow、PyTorch和MXNet)上的评估表明,DocTer提取输入约束的精确率达85.4%。DocTer从174个API函数中检测出94个缺陷,包括一个此前未知、现已记录在CVE数据库中的安全漏洞,而未使用输入约束的基线技术仅检测到59个缺陷。94个缺陷中的63个此前未知,其中54个在我们报告后已被开发者修复或确认。此外,DocTer还检测到43个文档不一致问题,其中39个已被修复或确认。

0
下载
关闭预览

相关内容

应用程序接口(简称 API),又称为应用编程接口,就是软件系统不同组成部分衔接的约定。
【SIGGRAPH2019】TensorFlow 2.0深度学习计算机图形学应用
专知会员服务
41+阅读 · 2019年10月9日
卓越工程实践之—前端高质量单测
阿里技术
0+阅读 · 2022年7月6日
深度自进化聚类:Deep Self-Evolution Clustering
我爱读PAMI
15+阅读 · 2019年4月13日
TF Boys必看!一文搞懂TensorFlow 2.0新架构!
引力空间站
19+阅读 · 2019年1月16日
MoCoGAN 分解运动和内容的视频生成
CreateAMind
18+阅读 · 2017年10月21日
【推荐】深度学习目标检测全面综述
机器学习研究会
21+阅读 · 2017年9月13日
国家自然科学基金
0+阅读 · 2017年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2013年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
1+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2009年12月31日
国家自然科学基金
1+阅读 · 2008年12月31日
Arxiv
10+阅读 · 2021年11月10日
Arxiv
38+阅读 · 2020年3月10日
Image Segmentation Using Deep Learning: A Survey
Arxiv
47+阅读 · 2020年1月15日
Arxiv
20+阅读 · 2018年10月25日
VIP会员
最新内容
《同步多无人机系统中的故障与通信》
专知会员服务
1+阅读 · 今天6:23
面向国防作战的最佳自主与蜂群无人机技术
专知会员服务
7+阅读 · 7月28日
《异构人类团队的协作决策过程混合建模研究》
博士论文 | 面向大模型推理的内存高效算法
专知会员服务
5+阅读 · 7月27日
美空军新型反无人机部队初探
专知会员服务
9+阅读 · 7月27日
相关VIP内容
【SIGGRAPH2019】TensorFlow 2.0深度学习计算机图形学应用
专知会员服务
41+阅读 · 2019年10月9日
相关资讯
卓越工程实践之—前端高质量单测
阿里技术
0+阅读 · 2022年7月6日
深度自进化聚类:Deep Self-Evolution Clustering
我爱读PAMI
15+阅读 · 2019年4月13日
TF Boys必看!一文搞懂TensorFlow 2.0新架构!
引力空间站
19+阅读 · 2019年1月16日
MoCoGAN 分解运动和内容的视频生成
CreateAMind
18+阅读 · 2017年10月21日
【推荐】深度学习目标检测全面综述
机器学习研究会
21+阅读 · 2017年9月13日
相关基金
国家自然科学基金
0+阅读 · 2017年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2013年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
1+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2009年12月31日
国家自然科学基金
1+阅读 · 2008年12月31日
Top
微信扫码咨询专知VIP会员