DocTer: Documentation-Guided Fuzzing for Testing Deep Learning API Functions

被引:41
作者
Xie, Danning [1 ]
Li, Yitong [2 ]
Kim, Mijung [1 ,3 ]
Hung Viet Pham [2 ]
Tan, Lin [1 ]
Zhang, Xiangyu [1 ]
Godfrey, Michael W. [2 ]
机构
[1] Purdue Univ, W Lafayette, IN 47907 USA
[2] Univ Waterloo, Waterloo, ON, Canada
[3] Ulsan Natl Inst Sci & Technol, Ulsan, South Korea
来源
PROCEEDINGS OF THE 31ST ACM SIGSOFT INTERNATIONAL SYMPOSIUM ON SOFTWARE TESTING AND ANALYSIS, ISSTA 2022 | 2022年
关键词
text analytics; testing; test generation; deep learning;
D O I
10.1145/3533767.3534220
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
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 DocTer's precision 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.
引用
收藏
页码:176 / 188
页数:13
相关论文
共 60 条
[1]  
Abadi M, 2016, PROCEEDINGS OF OSDI'16: 12TH USENIX SYMPOSIUM ON OPERATING SYSTEMS DESIGN AND IMPLEMENTATION, P265
[2]  
[Anonymous], BRIGHT LINES PROJECT
[3]  
[Anonymous], 2019, incubator-mxnet
[4]  
[Anonymous], 1999, The Java Modeling Language (JML)
[5]  
[Anonymous], 2020, US
[6]  
[Anonymous], 2022, DocTer
[7]  
[Anonymous], 2017, What is the best programming language for Machine Learning?
[8]  
[Anonymous], 2016, pytype
[9]  
[Anonymous], 2019, FuzzFactory: DomainSpecific Fuzzing with Waypoints
[10]  
[Anonymous], 2019, torch.Tensor