arrow
返回

MoCo: Fuzzing Deep Learning Libraries via Assembling Code

delete2025-02-01
delete0
delete
OA
AI
P
Pin Ji
Y
Yang Feng
D
Duo Wu
L
Lingyue Yan
P
P. Chen
刘
刘佳 (Jia Liu) *
Z
Zhihong Zhao
DOI:10.1109/TSE.2024.3509975delete
delete原文链接
delete原文求助
delete分享
delete收藏
摘要

摘要

En 中文
The rapidly developing Deep Learning (DL) techniques have been applied in software systems of various types. However, they can also pose new safety threats with potentially serious consequences, especially in safety-critical domains. DL libraries serve as the underlying foundation for DL systems, and bugs in them can have unpredictable impacts that directly affect the behaviors of DL systems. Previous research on fuzzing DL libraries still has limitations in generating tests corresponding to crucial testing scenarios and constructing test oracles. In this paper, we propose MoCo, a novel fuzzing testing method for DL libraries via assembling code. The seed tests used by MoCo are code files that implement DL models, covering both model construction and training in the most common real-world application scenarios for DL libraries. MoCo first disassembles the seed code files to extract templates and code blocks, then applies code block mutation operators (e.g., API replacement, random generation, and boundary checking) to generate new code blocks that fit the template. To ensure the correctness of the code block mutation, we employ the Large Language Model to parse the official documents of DL libraries for information about the parameters and the constraints between them. By inserting context-appropriate code blocks into the template, MoCo can generate a tree of code files with intergenerational relations. According to the derivation relations in this tree, we construct the test oracle based on the execution state consistency and the calculation result consistency. Since the granularity of code assembly is controlled rather than randomly divergent, we can quickly pinpoint the lines of code where the bugs are located and the corresponding triggering conditions. We conduct a comprehensive experiment to evaluate the efficiency and effectiveness of MoCo using three widely-used DL libraries (i.e., TensorFlow, PyTorch, and Jittor). During the experiments, MoCo detects 77 new bugs of four types in three DL libraries, where 55 bugs have been confirmed, and 39 bugs have been fixed by developers. The experimental results demonstrate that MoCo can generate high-quality tests that cover crucial testing scenarios and detect different types of bugs, which helps developers improve the reliability of DL libraries.
Keyword:
Codes
Libraries
Testing
Computational modeling
Computer bugs
Load modeling
Fuzzing
Neurons
Deep learning
Training
Deep learning libraries
deep learning testing
bug detection
fuzzing

期刊

IEEE Transactions on Software Engineering 封面图
IEEE Transactions on Software Engineering
IF:
5.6
论文数:
2.9K
被引数:
1.1W

机构

N
nanjing university
学者数:
7.8W
论文数: 5.6W
被引数: 87
引用论文

引用论文

Muscle Mutability
err1982-12-01
err0
errOAAI
errSteven J Rose; Jules M Rothstein
err分享
err收藏
err分享
err收藏
Vascular changes in the human endometrium following the administration of the progesterone antagonist RU 486
err1989-01-01
err0
PREAI
errElisabeth Johannisson; Martin Oberholzer; Marja-Liisa Swahn; Marc Bygdeman
err分享
err收藏
err分享
err收藏
学者 查看更多内容