A PSO-based Method to Test Deep Learning Library at API Level

Shuyan Liao, Chun Shan*

*Corresponding author for this work

Research output: Chapter in Book/Report/Conference proceedingConference contributionpeer-review

Abstract

In recent years, deep learning (DL) is widely used in various fields. DL library bugs could result in security issues and even some losses like data loss and model stealing. As a result, testing DL libraries is the focus of an increasing number of studies. However, there are still issues with these works, such as poor test sample selection and overly general test oracle, which result in ineffective and insufficient testing. In this paper, we present a LEAPI-PSO method based on particle swarm optimization (PSO) algorithm for testing DL libraries at API level, which tackles the inadequacies of existing testing techniques. LEAPI-PSO initially chooses high-quality seed samples by using input coverage and the seed progeny tree. Then, by using PSO, LEAPI-PSO generates test samples that are more likely to reveal API bugs. Based on eight mutation strategies, LEAPI-PSO can produce rich and varied test samples and input them into the API to check for bugs using test oracle. The two most popular DL libraries, PyTorch and Tensorflow, have been used in this study to validate and evaluate LEAPI-PSO. The result shows that LEAPI-PSO is capable to successfully find bugs including crashes, logical errors, and documentation errors. We report 115 bugs to the DL library developers, 95 of which are confirmed, and 63 of which are fixed.

Original languageEnglish
Title of host publicationProceedings of the 3rd International Conference on Computer, Artificial Intelligence and Control Engineering, CAICE 2024
PublisherAssociation for Computing Machinery
Pages117-130
Number of pages14
ISBN (Electronic)9798400716942
DOIs
Publication statusPublished - 26 Jan 2024
Event3rd International Conference on Computer, Artificial Intelligence and Control Engineering, CAICE 2024 - Xi'an, China
Duration: 26 Jan 202428 Jan 2024

Publication series

NameACM International Conference Proceeding Series

Conference

Conference3rd International Conference on Computer, Artificial Intelligence and Control Engineering, CAICE 2024
Country/TerritoryChina
CityXi'an
Period26/01/2428/01/24

Keywords

  • API
  • Deep Learning Library
  • Fuzzy
  • PSO

Fingerprint

Dive into the research topics of 'A PSO-based Method to Test Deep Learning Library at API Level'. Together they form a unique fingerprint.

Cite this