arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2109.01002cs.SE
收藏

DocTer:用于测试深度学习API函数的文档引导式模糊测试

DocTer: Documentation Guided Fuzzing for Testing Deep Learning API Functions

Danning Xie, Yitong Li, Mijung Kim, Hung Viet Pham, Lin Tan, Xiangyu Zhang, Michael W. Godfrey

AI总结:

本研究提出DocTer技术,通过依存句法分析树自动构建规则从深度学习API文档提取特有输入约束,用于生成测试输入检测API bug,在三大主流深度学习库上实现85.4%的约束提取准确率,发现大量未知bug与文档问题。

摘要:

输入约束对许多软件开发任务十分有用。例如,函数的输入约束能够生成符合这些约束的有效输入,从而对函数进行更深度的测试。深度学习(DL)库的API函数存在深度学习特有的输入约束,这些约束以非形式化的方式记录在自由格式的API文档中。现有的约束提取技术无法有效提取深度学习特有的输入约束。\n 为填补这一空白,我们设计并实现了一种新技术DocTer,通过分析API文档来提取深度学习API函数的深度学习特有输入约束。DocTer的核心是一种新颖的算法,该算法以API描述的依存句法分析树形式的句法模式为基础,自动构建规则以提取API参数约束。随后将这些规则应用于主流深度学习库的大量API文档,提取其输入参数约束。为验证提取得到的约束的有效性,DocTer利用这些约束自动生成有效和无效输入,用于测试深度学习API函数。\n 我们在三个主流深度学习库(TensorFlow、PyTorch和MXNet)上开展了评估,结果显示DocTer提取输入约束的准确率为85.4%。DocTer从174个API函数中检测出94个bug,其中包括1个此前未知的安全漏洞,该漏洞现已被录入CVE数据库;而未使用输入约束的基线技术仅检测出59个bug。在检测到的94个bug中,大部分(63个)为此前未知的bug,其中54个在我们上报后已被开发者修复或确认。此外,DocTer还检测出43处文档不一致问题,其中39处已被修复或确认。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑