Abstract

A test suite plays a key role in software testing. Mutation testing is a powerful approach to measure the fault-detection ability of a test suite. The mutation testing process requires a large number of mutants to be generated and executed. Hence, mutation testing is also computationally expensive. To solve this problem, predictive mutation testing builds a classification model to predict the test result of each mutant. However, the existing predictive mutation testing methods only can be used to estimate the overall mutation scores of object-oriented programs. To overcome the shortcomings of the existing methods, we propose a new method to directly predict the mutation score for each statement in process-oriented programs. Compared with the existing predictive mutation testing methods, our method uses more dynamic program execution features, which more adequately reflect dynamic dependency relationships among the statements and more accurately reflects information propagation during the execution of test cases. By comparing the prediction effects of logistic regression, artificial neural network, random forest, support vector machine, and symbolic regression, we finally decide to use a single hidden layer feedforward neural network as the predictive model to predict the statement mutation scores. In our two experiments, the mean absolute errors between the statement mutation scores predicted by the neural network and the real statement mutation scores both approximately reach 0.12.

Highlights

  • When a programmer writes a program, a mistake may occur in the code

  • The predictive mutation testing methods extract some features related to program structures and testing processes and apply machine learning to predict each mutant’s test result

  • The experimental results on two c programs demonstrate that our method can directly predict statement mutant scores approximately

Read more

Summary

Introduction

A programmer may incorrectly write x=x-1 as x=x+1, x=x*1, x=x%1, etc This mistake is referred to as a software fault (i.e., a software bug). A mutant is said to be identified by a test suite if at least one test case from the test suite has different execution results on the mutant and the original program. For quickly calculating the mutation score of the whole program, these methods attempt to use a mutant sample to represent all mutants. The predictive mutation testing methods extract some features related to program structures and testing processes and apply machine learning to predict each mutant’s test result (i.e., the identification result).

Method
Basic Terms
Formal Definitions of Statement Features
Value Impact Factor of Statement
Value Impact Set of Branch Instance l
Value Impact Set of the Special Statement Instance
Path Impact Factor of Statement
Path Impact Set of Branch Instance l
Path Impact Set of the Special Statement Instance
Generalized Value Impact Factor of Statement
Generalized Value Impact Set of the Special Statement Instance l
Generalized Path Impact Factor of Statement
Generalized Path Impact Set of the Special Statement Instance l
Latent Impact Factor of the Program Statement
Latent Impact Set of the Special Statement Instance l l
Information Hidden Factor
Calculation Process
Computational Complexity Analysis
Machine Learning Algorithms Comparison and Modelling
Experimental Subjects
The Construction Method of Data Set
Performance Metrics
Area under Curve
Logarithmic Loss
Brier Score
Metric Comparison
Model Comparing and Tuning
Comparing Models
Testing Predictions in Practice
Further Confirmation of the Optimization Model
Structure of the Automated Prediction Tool
Conclusions
Findings
Methods
Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call