一句话:提出 ACETest,从深度学习算子代码自动提取输入校验约束,生成有效且多样的测试用例以暴露核心逻辑缺陷。
深度学习算子是多维张量计算的核心构件,其缺陷影响严重。有效测试需要测试用例通过输入合法性检查并触达算子核心逻辑,因此需提取输入校验约束;现有方法依赖人工或 API 文档,难以处理复杂约束且可能与实现不符。ACETest 自动识别算子中的输入校验代码,抽取约束并生成有效且多样的测试用例。在 TensorFlow 与 PyTorch 上,其约束质量优于 SOTA,提取约束多 96.4%,发现缺陷为 SOTA 的 1.95 至 55 倍;共发现 108 个未知缺陷,87 个被确认,5 个获 CVE。
Deep learning (DL) applications are prevalent nowadays as they can help with multiple tasks. DL libraries are essential for building DL applications. Furthermore, DL operators are the important building blocks of the DL libraries, that compute the multi-dimensional data (tensors). Therefore, bugs in DL operators can have great impacts. Testing is a practical approach for detecting bugs in DL operators. In order to test DL operators effectively, it is essential that the test cases pass the input validity check and are able to reach the core function logic of the operators. Hence, extracting the input validation constraints is required for generating high-quality test cases. Existing techniques rely on either human effort or documentation of DL library APIs to extract the constraints. They cannot extract complex constraints and the extracted constraints may differ from the actual code implementation. To address the challenge, we propose ACETest, a technique to automatically extract input validation constraints from the code to build valid yet diverse test cases which can effectively unveil bugs in the core function logic of DL operators. For this purpose, ACETest can automatically identify the input validation code in DL operators, extract the related constraints and generate test cases according to the constraints. The experimental results on popular DL libraries, TensorFlow and PyTorch, demonstrate that ACETest can extract constraints with higher quality than state-of-the-art (SOTA) techniques. Moreover, ACETest is capable of extracting 96.4% more constraints and detecting 1.95 to 55 times more bugs than SOTA techniques. In total, we have used ACETest to detect 108 previously unknown bugs on TensorFlow and PyTorch, with 87 of them confirmed by the developers. Lastly, five of the bugs were assigned with CVE IDs due to their security impacts.
DOI 原文 · arXiv · PDF(开放获取) · DBLP
@inproceedings{ShiXLLYYSCH23,
title = {ACETest: Automated Constraint Extraction for Testing Deep Learning Operators},
author = {Jingyi Shi and Yang Xiao and Yuekang Li and Yeting Li and Dongsong Yu and Chendong Yu and Hui Su and Yufeng Chen and Wei Huo},
booktitle = {ISSTA},
year = {2023},
doi = {10.1145/3597926.3598088}
}