CN-122019386-A - Local weighted linear regression-assisted parallel program path coverage test method
Abstract
The invention discloses a local weighted linear regression-assisted parallel program path coverage test method, aiming at improving the efficiency and effectiveness of test case generation. The method comprises the steps of (1) generating a certain number of program inputs for executing parallel programs to obtain a set of objective function values, defining sample input and output pairs to form a multi-output sample set, (2) calculating Gaussian distances between population evolution individuals and sample inputs for estimating objective function value components of each dimension to obtain an objective function estimated value, (3) selecting a representative evolution individual for actually executing the parallel programs to judge whether the evolution individuals with the objective function value components of 1 exist, namely whether test cases covering an objective path are generated.
Inventors
- Sun baicai
- NIU LE
- GONG DUNWEI
- Si Dongtian
- CHEN HANQIAO
Assignees
- 青岛科技大学
Dates
- Publication Date
- 20260512
- Application Date
- 20260202
Claims (1)
- 1. A local weighted linear regression aided parallel program path coverage test method is used for improving the efficiency and effectiveness of test case generation, and the method specifically comprises the following steps: Step one, forming a multi-output sample set conforming to parallel characteristics In order to form a multi-output sample set conforming to the parallel characteristics, a certain number of program inputs are firstly generated, then, a tested parallel program is executed based on the generated program input set to obtain an objective function value set; step two, objective function value estimation based on local weighted linear regression The method comprises the steps of generating a population based on an intelligent optimization algorithm, calculating Gaussian distances between each sample input in a multi-output sample set and each evolution individual in the population, calculating the number of the Gaussian distances which is the same as the number of the multi-output sample set for each evolution individual, obtaining a sub-path similarity estimated value of each dimension of the evolution individual according to a weight estimation formula of each evolution individual, wherein the estimated sub-path similarity of each dimension is also called as an objective function value component, and collecting objective function value components of all dimensions to obtain an objective function estimated value of each evolution individual; Step three, representative evolution individual selection and test case evolution generation In order to select representative evolutionary individuals in a population, first, class evolutionary individuals with the largest objective function value component in each dimension in the population are searched for, the coverage probability of an objective sub-path can be improved, then, second, class evolutionary individuals with the largest average value of the objective function value components in the population are searched for, the coverage probability of the objective path can be improved, then, the distances between the rest evolutionary individuals and the first and second class evolutionary individuals are calculated, the evolutionary individuals with the largest distances are selected, the diversity of the population is improved, then, based on the selected first to third class evolutionary individuals, a parallel program is actually executed, a real objective function value is obtained, whether all evolutionary individuals with the objective function value components being 1 exist or not is judged, finally, if all the objective function value components being 1 exist, iteration of the population is stopped, otherwise, the population is iterated until all the evolutionary individuals with the objective function value components being 1 are generated, and a test case for covering the objective path strength is generated.
Description
Local weighted linear regression-assisted parallel program path coverage test method Technical Field The patent belongs to the field of software testing, and in particular relates to a local weighted linear regression-assisted parallel program path coverage testing method which is used for improving the efficiency and effectiveness of test case generation. Background Software testing is an important method for ensuring the correctness of software. Excessive software testing time consumption greatly increases the cost of software testing. Statistics show that the software test accounts for more than 50% of the whole software development cost. Parallel programs have some features that complicate testing activities, such as non-deterministic, concurrency, synchronicity, and communicability. Although uncertainty is an important feature of parallel programs, such non-deterministic behavior can be avoided by using methods that block communication statements or other fixed communication sequences. Accordingly, the present invention contemplates only other features of concurrency, communication, and synchronization. In the software testing process, the testing criteria are very important, and can not only guide the generation of testing data, but also evaluate the sufficiency of the software testing. Various testing criteria have been proposed so far, wherein path coverage is a common structural coverage criteria with strong defect detection capability. The path coverage means that a target path of a given program is searched for test data in an input space of the program, and the target path can be covered after the test data is used as input to run the program. Some results have been achieved for path coverage testing of parallel programs, but the object of testing is mostly a simple parallel program. If the test case generation technique of the simple parallel program is applied to the actual complex parallel program test, excessive test time consumption occurs. In view of this, it is imperative to reduce the time consumption of testing complex parallel program path overlay tests. Based on the analysis, the invention provides a local weighted linear regression-assisted parallel program path coverage test method, which is used for solving the problems of multi-output sample set formation conforming to parallel characteristics, objective function value estimation based on local weighted linear regression, representative evolution individual selection, test case evolution generation and the like, so that the efficiency and the effectiveness of test case generation are further improved. Disclosure of Invention The method comprises the steps of firstly generating a certain number of program inputs for executing parallel programs to obtain an objective function value set, defining sample input and output pairs to form a multi-output sample set, then calculating Gaussian distances between population evolution individuals and the sample inputs for estimating objective function value components of each dimension to obtain an objective function estimated value, and finally selecting a representative evolution individual for actually executing the parallel programs to judge whether the evolution individuals with the objective function value components of 1 exist, namely whether test cases covering an objective path are generated. The invention aims to solve the technical problems that in the existing method, multiple output sample sets conforming to parallel characteristics are difficult to form, objective function value estimation based on local weighted linear regression is difficult, representative evolution individual selection and test case evolution generation are difficult, and the like. The technical scheme of the invention provides a local weighted linear regression-assisted parallel program path coverage test method, which is characterized by comprising the following steps of: Step one, forming a multi-output sample set conforming to parallel characteristics In order to form a multi-output sample set conforming to the parallel characteristics, a certain number of program inputs are firstly generated, then, a tested parallel program is executed based on the generated program input set to obtain an objective function value set; step two, objective function value estimation based on local weighted linear regression The method comprises the steps of generating a population based on an intelligent optimization algorithm, calculating Gaussian distances between each sample input in a multi-output sample set and each evolution individual in the population, calculating the number of the Gaussian distances which is the same as the number of the multi-output sample set for each evolution individual, obtaining a sub-path similarity estimated value of each dimension of the evolution individual according to a weight estimation formula of each evolution individual, wherein the estimated sub-path similarity of each dimension is