TensorJSFuzz: Effective Testing of Web-Based Deep Learning Frameworks via Input-Constraint Extraction
As web applications grow in popularity, developers are increasingly integrating deep learning (DL) models into these environments. Web-based DL frameworks (e.g., TensorFlow.js) are essential for building and deploying such applications. Therefore, ensuring the quality of these frameworks is critical. While extensive testing efforts have been made for native DL frameworks such as TensorFlow and PyTorch, web-based DL frameworks have not yet undergone systematic testing. A key challenge is generating syntactically and semantically valid inputs while designing effective test oracles for web environments. To address this, we introduce TensorJSFuzz, a novel method for testing web-based DL frameworks. To ensure input quality, TensorJSFuzz extracts constraints directly from the source code of DL operators. By leveraging Large Language Models (e.g., ChatGPT) to understand the code and extract input constraints, TensorJSFuzz performs type-aware random generation coupled with dependency-aware refinement to create high-quality test inputs. These inputs are then subjected to differential testing across various backends, including CPU, TensorFlow, Wasm, and WebGL. Our experimental results show that TensorJSFuzz outperforms all baselines in generating valid inputs and identifying bugs. In particular, TensorJSFuzz successfully detected 92 bugs, with 30 already confirmed or fixed by developers, demonstrating its effectiveness in improving the robustness of web-based DL frameworks.
Authors
- Lili Quan (ORCID: https://orcid.org/0000-0003-0405-835X)
- Junjie Wang (ORCID: https://orcid.org/0009-0002-3847-6760)
- Lingxiao Jiang (ORCID: https://orcid.org/0000-0002-4336-8548)
- Xiaofei Xie (ORCID: https://orcid.org/0000-0002-1288-6502)
- Xiaohong Li (ORCID: https://orcid.org/0000-0002-0752-6764)
- Sen Chen (ORCID: https://orcid.org/0000-0001-9477-4100)
- Qianyu Guo
Institutions
- Tianjin University (CN)
- Nankai University (CN)
- Singapore Management University (SG)
Publication Details
- Published
- 2025-04-22
- DOI
- https://doi.org/10.1145/3696410.3714649
- Primary Topic
- Software Testing and Debugging Techniques
- Type
- article
- Field-Weighted Citation Impact
- 0.00
Funders
- National Research Foundation
- National Research Foundation Singapore
- National Natural Science Foundation of China