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.


翻译:输入限制对许多软件开发任务非常有用。例如,函数的输入限制可以生成有效的输入,即遵循这些限制的输入,以更深入地测试函数。深度学习(DL)库的 API 函数具有 DL 特定的输入限制,这些限制在自由形式的 API 文档中以非正式的方式描述。现有的限制提取技术无法提取 DL 特定的输入限制。为了填补这一空白,我们设计和实现了一种新技术,即 DocTer,以分析 API 文档以提取 DL API 函数的特定输入限制。 DocTer 采用一种新颖的算法,自动构建规则以从 API 描述的语法模式中提取 API 参数限制,形式为 API 描述的依赖解析树。然后,将这些规则应用于流行的 DL 库中大量的 API 文档,以提取它们的输入参数限制。为了展示提取条件的有效性,DocTer 使用这些限制来生成有效和无效的输入以测试 DL API 函数。我们在三个流行的 DL 库(TensorFlow、PyTorch 和 MXNet)上进行了评估,结果显示 DocTer 提取输入限制的精度为 85.4%。 DocTer 从 174 个 API 函数中检测到 94 个漏洞,包括一个以前未知的安全漏洞,现在记录在 CVE 数据库中,而没有输入限制的基线技术仅检测到 59 个漏洞。其中大多数(63 个)是以前未知的,其中 54 个已经在我们报告后被修复或确认。此外, DocTer 检测到 43 个文档不一致之处,其中 39 个已经被修复或确认。

0
下载
关闭预览

相关内容

应用程序接口(简称 API),又称为应用编程接口,就是软件系统不同组成部分衔接的约定。
【SIGGRAPH2019】TensorFlow 2.0深度学习计算机图形学应用
专知会员服务
39+阅读 · 2019年10月9日
卓越工程实践之—前端高质量单测
阿里技术
0+阅读 · 2022年7月6日
深度自进化聚类:Deep Self-Evolution Clustering
我爱读PAMI
14+阅读 · 2019年4月13日
TF Boys必看!一文搞懂TensorFlow 2.0新架构!
引力空间站
18+阅读 · 2019年1月16日
MoCoGAN 分解运动和内容的视频生成
CreateAMind
18+阅读 · 2017年10月21日
【推荐】深度学习目标检测全面综述
机器学习研究会
21+阅读 · 2017年9月13日
国家自然科学基金
0+阅读 · 2017年12月31日
国家自然科学基金
0+阅读 · 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
43+阅读 · 2020年1月15日
Arxiv
19+阅读 · 2018年10月25日
VIP会员
相关VIP内容
【SIGGRAPH2019】TensorFlow 2.0深度学习计算机图形学应用
专知会员服务
39+阅读 · 2019年10月9日
相关资讯
卓越工程实践之—前端高质量单测
阿里技术
0+阅读 · 2022年7月6日
深度自进化聚类:Deep Self-Evolution Clustering
我爱读PAMI
14+阅读 · 2019年4月13日
TF Boys必看!一文搞懂TensorFlow 2.0新架构!
引力空间站
18+阅读 · 2019年1月16日
MoCoGAN 分解运动和内容的视频生成
CreateAMind
18+阅读 · 2017年10月21日
【推荐】深度学习目标检测全面综述
机器学习研究会
21+阅读 · 2017年9月13日
相关基金
国家自然科学基金
0+阅读 · 2017年12月31日
国家自然科学基金
0+阅读 · 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会员