Search

CN-121979800-A - Intelligent equipment software testing method integrating clustering and convolutional neural network

CN121979800ACN 121979800 ACN121979800 ACN 121979800ACN-121979800-A

Abstract

The invention relates to the field of computer software testing, and discloses an intelligent equipment software testing method integrating clustering and convolutional neural networks, which aims to improve the efficiency of generating coverage path test cases for paths formed by a plurality of variant branches. Firstly, classifying paths by adopting a fuzzy clustering method according to the coverage difficulty and the similarity of variant branch paths, then, for each cluster, constructing a convolutional neural network model only aiming at a cluster center path, and finally, generating test cases based on a particle swarm optimization algorithm based on excellent particles predicted by the convolutional neural network model as an initial population. According to the invention, aiming at a plurality of similar paths in the same cluster, only the central path of the cluster is selected to construct the convolutional neural network model, so that the cost of training and predicting the convolutional neural network can be reduced, and the excellent representative individuals are selected based on the convolutional neural network model, so that the particle swarm evolution efficiency can be improved.

Inventors

  • SHEN SHEN
  • QU QIAN
  • XIA HENG
  • DANG XIANGYING
  • WU SHUTONG

Assignees

  • 徐州工程学院

Dates

Publication Date
20260505
Application Date
20260225

Claims (8)

  1. 1. The intelligent equipment software testing method integrating the clustering and the convolutional neural network is characterized by comprising the following steps of: s1, utilizing the coverage difficulty and similarity of a variant branch path to self-adaptively fuzzy clustering paths; S1.1, determining the coverage difficulty of a variant branch path and the similarity between paths; S1.2, fuzzy clustering paths based on path coverage difficulty and similarity to form a plurality of path classes; s2, each path class forms a cluster, and an optimization model generated by covering the path test cases is built aiming at each cluster; s3, constructing a convolutional neural network model of a cluster center path based on the optimization model; And S4, generating test cases based on a convolutional neural network model enhanced particle swarm algorithm.
  2. 2. The method according to claim 1, wherein the step S1.2 is specifically: input data ordered variant branch path set Path similarity matrix Threshold value of ; Output data post-cluster clustering , Is the number of clusters; S1.2.1. initializing each cluster , Setting variable ; S1.2.2 from In (2) selecting the first variation branch node as the first variation branch node Is denoted as cluster center path Updating clusters ; S1.2.3 scanning If (3) Any one of the paths Similarity is greater than a threshold Then these paths are put into clusters; s1.2.4 from Middle deleted cluster Path involved, update ; S1.2.5 if it is , Otherwise, turning S1.2.7; s1.2.6 repeating S1.2.2 to S1.2.5 until the set If the middle is an empty set, the clustering is finished; S1.2.7 output all clusters, noted as Wherein Is the cluster center path.
  3. 3. The method according to claim 2, wherein the step S3 is specifically: S3.1, constructing a sample set based on an optimization model; S3.2, training a convolutional neural network model based on the sample set.
  4. 4. A method according to claim 3, wherein said step S3.1 is performed as: Cluster Is defined by the center path of (a) The input feature vector corresponding to the convolutional neural network is Comprises Inputting data by a plurality of samples; executing the tested program to obtain a traversing path set as And increase As an assist feature of convolutional neural networks; Recording device Is represented in the crossing path In the first and target paths The same node is at The index starts from 0, and the same goes, Is shown in In (3), the last one and The same node is at Position values of (a); normalizing the position value: Wherein, the For the target path The number of the middle nodes is according to And Calculating an adaptation value 。
  5. 5. The method of claim 4, wherein, in the convolutional neural network, The corresponding output characteristic value is Thereby, for the input feature vector The corresponding output feature vector is expressed as The sample set is 。
  6. 6. The method according to claim 1, wherein the step S4 is specifically: s4.1, selecting an initial population of particle swarms based on a convolutional neural network model; s4.2, generating a test case by adopting a particle swarm algorithm based on the initial population.
  7. 7. The method according to claim 6, wherein the step S4.2 is specifically: input data, randomly generated test cases, path set ; Outputting data, namely covering a test case set of the path set; s4.2.1 setting parameter values of a particle swarm algorithm; s4.2.2 for cluster center path Based on a convolutional neural network model, excellent particle swarm is predicted, and is taken as initial particles of a particle swarm algorithm, and the initial particle swarm is taken as , Is the number of particles; S4.2.3: executing the program under test, if A certain particle coverage path in (a) ( ) If the test case or iteration reaches the maximum iteration number, stopping the particle swarm The evolution of (1) and saving test cases; if any particles are not covered ( ) And the maximum iteration number is not reached, go to step S4.2.6, if Turning to step S4.2.7; S4.2.4 No test case Path is found in step 4.2.3 When calculating the crossing path of particles and the path in the iterative process If the similarity is greater than a threshold And storing particles with a threshold value greater than U as paths Is counted as the number of the excellent initial particles ; S4.2.5 in In selecting a path Based on cluster center path Is selected by a convolutional neural network model A kind of electronic device Excellent particles, excellent particles stored in step 4.2.4 Common composition Corresponding initial population Step S4.2.3: s4.2.6 calculating particle adaptation values of the initial population in step 4.2.5, updating the speed and position of particles, updating local optimal and global optimal values, and turning to step S4.2.3; S4.2.7, ending the iteration and outputting the test case set.
  8. 8. The method of claim 7, wherein in step S4.2.3, the determination is made Whether or not the middle particles cover the clusters If k particles can cover the paths in the cluster A path in which The k particles are stored as test cases corresponding to paths, and the test cases are clustered Deleting the path of the found test case and updating the cluster ; ; 。

Description

Intelligent equipment software testing method integrating clustering and convolutional neural network Technical Field The invention relates to the field of computer software testing, in particular to an intelligent equipment software testing method integrating clustering and convolutional neural networks. Background The equipment software is a core product of deep fusion of equipment manufacturing industry and software technology, and is a digital neural center for realizing intelligent, automatic and accurate operation of various industrial equipment (such as machine tools, engineering machinery, aerospace equipment, ships, military equipment and the like). It directly embeds or controls the hardware of the equipment, determines the upper performance limit, the running efficiency, the reliability and the intelligent level of the equipment, and is a key support for the transition of modern equipment from 'mechanical driving' to 'software definition'. Software testing is an important means for guaranteeing the quality of software, and in recent years, software testing work is paid more and more attention to, and requirements on software testing efficiency are higher and higher. The equipment software test is a core link for guaranteeing the reliable operation of the whole life cycle of equipment, avoiding major risks and realizing the performance value of the equipment, the importance of the equipment is shown in multiple dimensions and irreplaceability, once the failure is caused by the software defect, the equipment is possibly caused by the disastrous effects of machine destruction, personal death, production paralysis, national safety damage and the like, the test is the final defense line for checking hidden danger and blocking safety risks in advance, the test can accurately verify core indexes such as functional logic, resource occupation and anti-interference capability of the equipment, the equipment is ensured to stably exert the efficacy according to design indexes, the software occupation ratio is continuously improved along with the upgrading of the equipment to intellectualization and networking, and the high-quality test is not only the key support for guaranteeing the autonomous controllability of the equipment, but also the important foundation for improving the core competitiveness of domestic equipment and pushing the manufacturing industry of the equipment to high-end transformation. As a software testing method for defects, the mutation test has the remarkable advantages of strong debugging capability, convenience, flexibility, high automation degree and the like. In the mutation test, small controllable modifications are introduced to the source program in a targeted manner, the grammar modification of a certain sentence is called mutation, and the mutated sentence is a mutated sentence. The weak mutation test only needs to meet the reachability and necessity conditions. The mutation branch is a branch statement constructed based on mutation test requirements and consists of an original statement and a mutation statement. Each variant statement corresponds to a variant branch, representing a potential software defect. The core of the fuzzy clustering idea is to break the traditional rigid classification logic of 'not but' and based on the 'part attribution' idea of fuzzy mathematics, the category boundaries of most things in the real world are considered not to be absolutely clear, and samples can be simultaneously attributed to a plurality of categories in different degrees, so that the fuzzy relation and the complex structure among data are more truly depicted. The convolutional neural network is used as a deep learning model, has good feature learning capability, and the type and complexity of input data are usually high in software testing, especially when multi-mode data are processed. The convolutional neural network can well process complex data, and key information is automatically extracted from the data for analysis through feature learning and abstraction, so that the accuracy and reliability of the test are improved. When the evolutionary algorithm calculates the adaptation value, the evolutionary individual needs to execute the program for a plurality of times, so that the cost of executing the program is increased, and the efficiency of the evolutionary algorithm is reduced. Therefore, in order to solve the bottleneck of the evolution algorithm, the invention improves the performance of the evolution method by virtue of the advantages of the convolutional neural network model. Disclosure of Invention The invention provides an intelligent equipment software testing method for fusing clustering and convolutional neural networks, which aims to solve the problem of low efficiency of test case generation for detecting software defects in the prior art and is characterized in that the method is different from the prior method in that the method is based on a variant branch path