Testing Neural Network Classifiers Based on Metamorphic Relations

The application of machine learning programs is becoming increasingly more widespread. Neural networks, which are among the most popular machine learning programs, play important roles in people's daily lives, such as by controlling cars in autonomous driving systems. However, neural networks still lack effective testing methods. To address this problem, this paper proposes a testing method for neural network classifiers based on metamorphic relations. Firstly, it designs metamorphic relations to transform the original data set into derivative data sets. Then, it uses the data before and after the transformation to train and test the neural network classifier, respectively. Finally, it checks whether the output conforms to the metamorphic relations. The neural network classifier is defective if conflicts are detected. Experiments are conducted on a neural network classifier from Stanford's cs231n course to verify the effectiveness of the method. The results show that the defect detection capability of the proposed method is accurate, and 87.5% of the mutants are successfully detected.

[1]  Lionel C. Briand,et al.  Is mutation an appropriate tool for testing experiments? , 2005, ICSE.

[2]  Wang Lulu Survey of Metamorphic Testing , 2009 .

[3]  A. Jefferson Offutt,et al.  MuJava: an automated class mutation system , 2005, Softw. Test. Verification Reliab..

[4]  Junfeng Yang,et al.  DeepXplore: Automated Whitebox Testing of Deep Learning Systems , 2017, SOSP.

[5]  Elaine J. Weyuker,et al.  Pseudo-oracles for non-testable programs , 1981, ACM '81.

[6]  Sergio Segura,et al.  A Survey on Metamorphic Testing , 2016, IEEE Transactions on Software Engineering.

[7]  Junfeng Yang,et al.  DeepXplore: Automated Whitebox Testing of Deep Learning Systems , 2019, GETMBL.

[8]  Philip Koopman,et al.  Robustness Testing of Autonomy Software , 2017, 2018 IEEE/ACM 40th International Conference on Software Engineering: Software Engineering in Practice Track (ICSE-SEIP).

[9]  Baowen Xu,et al.  Testing and validating machine learning classifiers by metamorphic testing , 2011, J. Syst. Softw..

[10]  Nancy G. Leveson,et al.  An experimental evaluation of the assumption of independence in multiversion programming , 1986, IEEE Transactions on Software Engineering.

[11]  Sarfraz Khurshid,et al.  DeepRoad: GAN-Based Metamorphic Testing and Input Validation Framework for Autonomous Driving Systems , 2018, 2018 33rd IEEE/ACM International Conference on Automated Software Engineering (ASE).

[12]  Lei Ma,et al.  DeepHunter: a coverage-guided fuzz testing framework for deep neural networks , 2019, ISSTA.

[13]  Tsong Yueh Chen,et al.  Metamorphic Testing: A New Approach for Generating Next Test Cases , 2020, ArXiv.

[14]  Chen Xiang Mutation Testing: Principal, Optimization and Application , 2012 .