arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2112.05567cs.SE
收藏

一种基于注解的神经网络程序缺陷查找方法

An Annotation-based Approach for Finding Bugs in Neural Network Programs

Mohammad Rezaalipour, Carlo A. Furia

AI总结:

针对神经网络程序缺乏输入约束导致自动测试易生成无效输入的问题,本文提出 aNNoTest,利用专用注解和基于属性的测试生成有效随机输入,并在19个程序中发现94个缺陷。

摘要:

随着神经网络越来越多地被纳入安全关键系统的核心组件,开发专门针对它们的有效测试技术变得至关重要。大部分研究集中于测试神经网络模型;但这些模型是通过编写程序来定义的,而且越来越多的证据表明,这些神经网络程序也经常存在缺陷。本文提出了 aNNoTest:一种为神经网络程序生成测试输入的方法。一个根本性挑战在于,常用于编写神经网络程序的动态类型语言(例如 Python)无法表达关于有效函数输入(例如具有特定维度的矩阵)的详细约束。在不了解这些约束的情况下,自动化测试用例生成容易产生无效输入,从而触发虚假失败,并且对识别真实缺陷毫无用处。为解决这一问题,我们引入了一种简单的注解语言,专门用于简洁地表达神经网络程序中的有效函数输入。aNNoTest 以带注解的程序作为输入,并使用基于属性的测试来生成满足有效性约束的随机输入。本文还概述了简化编写 aNNoTest 注解的指南。我们在来自 Islam 等人综述中的 19 个神经网络程序上评估了 aNNoTest,并按照我们的指南对它们进行手动注解——每个被测函数平均产生 6 个注解。aNNoTest 自动生成的测试输入揭示了 94 个缺陷,其中包括该综述针对这些项目报告的 63 个缺陷。这些结果表明,aNNoTest 可以成为查找真实世界神经网络程序中广泛存在缺陷的一种有价值方法。

英文摘要:

As neural networks are increasingly included as core components of safety-critical systems, developing effective testing techniques specialized for them becomes crucial. The bulk of the research has focused on testing neural-network models; but these models are defined by writing programs, and there is growing evidence that these neural-network programs often have bugs too. This paper presents aNNoTest: an approach to generating test inputs for neural-network programs. A fundamental challenge is that the dynamically-typed languages (e.g., Python) commonly used to program neural networks cannot express detailed constraints about valid function inputs (e.g., matrices with certain dimensions). Without knowing these constraints, automated test-case generation is prone to producing invalid inputs, which trigger spurious failures and are useless for identifying real bugs. To address this problem, we introduce a simple annotation language tailored for concisely expressing valid function inputs in neural-network programs. aNNoTest takes as input an annotated program, and uses property-based testing to generate random inputs that satisfy the validity constraints. In the paper, we also outline guidelines that simplify writing aNNoTest annotations. We evaluated aNNoTest on 19 neural-network programs from Islam et al's survey., which we manually annotated following our guidelines -- producing 6 annotations per tested function on average. aNNoTest automatically generated test inputs that revealed 94 bugs, including 63 bugs that the survey reported for these projects. These results suggest that aNNoTest can be a valuable approach to finding widespread bugs in real-world neural-network programs.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑