Font Size: a A A

A Method Of Obtaining Metamorphic Relations For Numerical Computation Programs

Posted on:2022-08-18Degree:MasterType:Thesis
Country:ChinaCandidate:H Y ZhangFull Text:PDF
GTID:2518306332465374Subject:Software engineering
Abstract/Summary:PDF Full Text Request
The scientific computing software has now been widely used in various research fields,and the functional implementation of scientific computing software needs to be composed of multiple numerical calculations.Therefore,whether the output results of the numerical computing program are correct will directly affect whether the scientific computing software can be used normally.Testing the numerical calculation program is also an essential part of software testing.When testing the numerical calculation program,since the output of the program is often very complicated,it is difficult for testers to directly judge whether the output result of the program is correct or not.Oracle problems are widespread.Therefore,it is necessary to apply the metamorphic test to the test of the numerical calculation program.The idea of the metamorphic test is to obtain the relationship between the corresponding outputs by constructing the relationship between a pair of inputs of the program to be tested,avoiding the occurrence of Oracle problems in the testing process.However,in the application scenario of metamorphic test,most of the metamorphic relations are difficult to reuse,resulting in a large amount of time for the metamorphic test.Common numerical calculation programs with a single value input can refer to the existing formula of related calculations as the metamorphic relation.However,how to obtain the metamorphic relation of the numerical calculation program whose input is a sequence has not yet been clearly resolved.In order to improve the metamorphic test efficiency of the numerical calculation program whose input is a sequence,and solve the problem of low reuse rate of the metamorphic relation,this paper proposes a method for obtaining the metamorphic relation for the numerical calculation program.The method is divided into the classification prediction of the metamorphic relation and the derivation of the metamorphic relation.The first part is a classification prediction method of metamorphic relations based on path features,and 6 types of metamorphic relations that can be commonly used in numerical calculation programs are selected.The method first generates a control flow graph for the program to be tested,makes the execution path extracted from the control flow graph as path features,and then adds labels to the features based on the satisfaction of the corresponding metamorphic relation of the program to be tested to make a data set,and finally use the data set is used to train and test the support vector machine to obtain the classification model.Inputting the path features of the program to be tested into the classification model can predict whether the program satisfies the metamorphic relation corresponding to the model.This paper evaluates the classification model through experiments,and the evaluation results show that this method can effectively predict the satisfaction of the numerical calculation program for the corresponding metamorphic relation.When conducting a metamorphic test on a program,the metamorphic relation used should have a numerical relationship unique to the program.In order to meet this demand,the second part of the method proposed in this paper is the derivation method of the specific metamorphic relation.The method expresses the metamorphic relations as polynomials,expresses the three metamorphic relations as linear equations with parameters,and uses the least square method to solve the parameters.This method derives two specific metamorphic relations.This paper designs an experiment to evaluate the error detection capabilities of the two metamorphic relations.The results show that the error detection rate of the two metamorphic relations can almost reach a relatively ideal state,so it also verifies that the derivation method of the metamorphic relations proposed in this paper is effective.
Keywords/Search Tags:metamorphic test, metamorphic relation, numerical calculation program
PDF Full Text Request
Related items