Automatic Unit Test Generation for Deep Learning Frameworks based on API Knowledge
Arunkaleeshwaran Narayanan, Nima Shiri harzevili, Junjie Wang, Lin, Shi, Moshi Wei, Song Wang

TL;DR
This paper introduces MUTester, a tool that enhances automatic unit test generation for deep learning frameworks by leveraging API constraints and usage patterns, significantly improving coverage and reducing invalid tests.
Contribution
MUTester uniquely combines mined API constraints and usage patterns to guide test generation for deep learning APIs, filling a gap in existing tools.
Findings
Code coverage increased by 15.7% to 27.0%.
Reduced invalid tests by approximately 19%.
Validated effectiveness through developer user study.
Abstract
Many automatic unit test generation tools that can generate unit test cases with high coverage over a program have been proposed. However, most of these tools are ineffective on deep learning (DL) frameworks due to the fact that many of deep learning APIs expect inputs that follow specific API knowledge. To fill this gap, we propose MUTester to generate unit test cases for APIs of deep learning frameworks by leveraging the API constraints mined from the corresponding API documentation and the API usage patterns mined from code fragments in Stack Overflow (SO). Particularly, we first propose a set of 18 rules for mining API constraints from the API documents. We then use the frequent itemset mining technique to mine the API usage patterns from a large corpus of machine learning API related code fragments collected from SO. Finally, we use the above two types of API knowledge to guide the…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsSoftware Testing and Debugging Techniques · Software System Performance and Reliability · Software Engineering Research
