Computer software automatic test analysis method and test platform
By optimizing the test case sequence through the target semantic recognition model and quantum genetic algorithm, early detection of software errors is achieved, solving the problem of high error repair costs in software testing and improving detection efficiency.
Patent Information
- Application Number
- CN202511189167.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-25
- Publication Date
- 2025-10-03
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the existing software testing process, as software development progresses, the cost of error repair increases exponentially, resulting in waste of resources and reduced detection efficiency.
A computer software automatic test analysis method is proposed. It generates test categories and scenarios through the target semantic recognition model, automatically generates test case sequences, optimizes the test sequence through quantum genetic algorithm, and monitors software logs in real time to detect abnormal code and repair it.
Detect software errors early, reduce the impact of error propagation, reduce later repair costs, and improve the overall detection efficiency of software testing.
Smart Images

Figure CN120743784A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of software testing, and in particular to a computer software automatic testing and analysis method and a testing platform. Background Art
[0002] In computer systems, software is responsible for translating user needs into executable program functions, ensuring these functions can effectively serve various usage scenarios. Through a series of development and operation facilities, such as code editors, compilers, servers, and client environments, software converts abstract demand logic into program instructions suitable for computer execution, forming a multi-layered interactive process to provide services to users.
[0003] The prior art (publication number: CN116756023A) discloses a detection system and method for computer software detection, which relates to the field of software detection technology, including a data testing module, a security testing module, a test case module, and a defect management and analysis module; wherein, the data testing module is used to detect the correctness of the software when processing data, construct test cases of data types, and conduct comprehensive testing on the software; the security testing module is used to detect security vulnerabilities in the software, simulate possible attack scenarios, and test the software; the test case module is used to generate test cases through machine learning, and detect the software by combining manual testing with automated testing. By generating test cases in the test case module and storing them in the test case library, the data testing module and the security testing module can use the test cases in the test case library or redesign the test cases for use, and the defect display through the combination of the two test cases makes the test results more accurate.
[0004] However, in the actual software testing process, as software development progresses, the cost of error repair will increase exponentially, and then repairing the software in the later stage will increase the cost and increase resource waste, which will reduce the overall detection efficiency of software testing. Summary of the Invention
[0005] The purpose of the present invention is to solve the problem and to provide a computer software automatic testing and analysis method and testing platform.
[0006] The purpose of the present invention can be achieved through the following technical solutions:
[0007] First, a computer software automatic testing and analysis method is proposed, which includes:
[0008] Substitute the software test request sent by the user into the target semantic recognition model to obtain the test category and test scenario;
[0009] Query the preset script library according to the test category and test scenario, extract the test execution script corresponding to the test category and test scenario, and automatically generate multiple test cases, and determine the multiple test cases into a test case sequence;
[0010] Optimize the target sequence of the test case sequence to obtain the priority test case sequence;
[0011] Execute test cases according to the prioritized test case sequence and monitor the software's record logs in real time;
[0012] If the target exception code exists in the query software's record log, it is determined that the software has a defect, and the preset historical repair data is obtained to repair the software.
[0013] Optionally, the software test request sent by the user is substituted into the target semantic recognition model to obtain the test categories and test scenarios including:
[0014] Perform word embedding on the software test request sentence to obtain an initial embedding vector;
[0015] Processing the initial embedding vector through multiple target attention mechanism layers in sequence to obtain an attention vector;
[0016] Perform a residual connection operation on the attention vector to obtain a first eigenvector;
[0017] Normalizing the attention vector to obtain a second eigenvector;
[0018] Fusing the attention vector, the first feature vector, and the second feature vector to obtain a fused feature vector;
[0019] Performing a full connection operation on the fused feature vector to obtain a target feature, which is recorded as a key feature;
[0020] Detection is performed based on the key features to obtain corresponding test categories and test scenarios.
[0021] Optionally, the target attention mechanism layer works as follows:
[0022] Determine the initial embedding vector as the initial feature, substitute the initial feature into the target attention mechanism layer to obtain the first key vector, the second key vector, the query vector and the value vector of the target attention mechanism;
[0023] Transposing the first key vector and the second key vector to obtain a first transposed vector and a second transposed vector, performing a dot product operation on the first transposed vector and a query vector to obtain a first weight vector, and performing a dot product operation on the second transposed vector and the query vector to obtain a second weight vector;
[0024] Adding the first weight vector and the second weight vector to obtain a weight vector;
[0025] Performing a normalization operation on the weight vector to obtain a normalized vector;
[0026] Perform a dot product operation on the value vector and the normalized vector to obtain a target dual attention vector.
[0027] Optionally, performing target sequence optimization on the test case sequence to obtain a priority test case sequence includes:
[0028] The arrangement order of each test case in the test case sequence is used as a chromosome, and multiple chromosomes are randomly generated as a population; the fitness error corresponding to each chromosome is calculated using a fitness function, and the fitness errors of all chromosomes are compared to obtain an optimal fitness error; and the optimal chromosome corresponding to the optimal fitness error is used as an evolution target and iterated through a quantum evolution operation; the quantum evolution operation includes: a quantum rotating gate, a quantum mutation operation, and a quantum crossover;
[0029] If the quantum genetic algorithm meets the convergence error or reaches the maximum number of iterations, the priority test case sequence is output.
[0030] Optionally, the fitness error corresponding to each chromosome is calculated using the fitness function including:
[0031] The formula of the fitness function is:
[0032]
[0033] Among them, S represents the fitness error of the current chromosome, GZ represents the average false detection rate of the current chromosome, FG represents the average branch coverage rate of the current chromosome, T ah represents the position of the first test case where the hth error is detected, T bk Indicates the position of the first test case covering the k-th branch, n is the total number of test cases, m is the total number of errors in the code to be tested, and j is the total number of branches that need to be covered in the code to be tested.
[0034] A computer software automatic testing platform is proposed, comprising:
[0035] Semantic recognition module: Substitutes the software test request sent by the user into the target semantic recognition model to obtain the test category and test scenario;
[0036] Script execution module: queries the preset script library according to the test category and test scenario, extracts the test execution script corresponding to the test category and test scenario, and automatically generates multiple test cases, and determines the multiple test cases into a test case sequence;
[0037] Sequence optimization module: optimizes the test case sequence to obtain the priority test case sequence;
[0038] Execution module: executes test cases according to the priority test case sequence and monitors the software record log in real time;
[0039] Anomaly detection module: If the target anomaly code exists in the query software's record log, it is determined that the software has a defect, and the preset historical repair data is obtained to repair the software.
[0040] Optionally, the semantic recognition module includes: word embedding module, attention module, residual module, normalization module, fusion module, fully connected module and category detection module:
[0041] The word embedding module is used to embed the software test request statement into words to obtain an initial embedding vector;
[0042] The attention module is used to process the initial embedding vector through multiple target attention mechanism layers in sequence to obtain an attention vector;
[0043] The residual module is used to perform a residual connection operation on the attention vector to obtain a first eigenvector;
[0044] The normalization module is used to perform a normalization operation on the attention vector to obtain a second eigenvector;
[0045] The fusion module is configured to fuse the attention vector, the first feature vector, and the second feature vector to obtain a fused feature vector;
[0046] The fully connected module is used to perform a fully connected operation on the fused feature vector to obtain a target feature, and the target feature is recorded as a key feature;
[0047] The category detection module is used to detect according to the key features to obtain corresponding test categories and test scenarios.
[0048] Optionally, the target attention mechanism layer works as follows:
[0049] Determine the initial embedding vector as the initial feature, substitute the initial feature into the target attention mechanism to obtain the first key vector, the second key vector, the query vector and the value vector of the target attention mechanism layer;
[0050] Transposing the first key vector and the second key vector to obtain a first transposed vector and a second transposed vector, performing a dot product operation on the first transposed vector and a query vector to obtain a first weight vector, and performing a dot product operation on the second transposed vector and the query vector to obtain a second weight vector;
[0051] Adding the first weight vector and the second weight vector to obtain a weight vector;
[0052] Performing a normalization operation on the weight vector to obtain a normalized vector;
[0053] Perform a dot product operation on the value vector and the normalized vector to obtain a target dual attention vector.
[0054] Optionally, performing target sequence optimization on the test case sequence to obtain a priority test case sequence includes:
[0055] The arrangement order of each test case in the test case sequence is used as a chromosome, and multiple chromosomes are randomly generated as a population; the fitness error corresponding to each chromosome is calculated using a fitness function, and the fitness errors of all chromosomes are compared to obtain an optimal fitness error; and the optimal chromosome corresponding to the optimal fitness error is used as an evolution target and iterated through a quantum evolution operation; the quantum evolution operation includes: a quantum rotating gate, a quantum mutation operation, and a quantum crossover;
[0056] If the quantum genetic algorithm meets the convergence error or reaches the maximum number of iterations, the priority test case sequence is output.
[0057] Optionally, the fitness error corresponding to each chromosome is calculated using the fitness function including:
[0058] The formula of the fitness function is:
[0059]
[0060] Among them, S represents the fitness error of the current chromosome, GZ represents the average false detection rate of the current chromosome, FG represents the average branch coverage rate of the current chromosome, T ah represents the position of the first test case where the hth error is detected, T bk Indicates the position of the first test case covering the k-th branch, n is the total number of test cases, m is the total number of errors in the code to be tested, and j is the total number of branches that need to be covered in the code to be tested.
[0061] Beneficial effects of the present invention:
[0062] The present invention proposes a computer software automatic testing and analysis method, which obtains test categories and test scenarios by substituting a software test request sent by a user into a target semantic recognition model; queries a preset script library based on the test categories and test scenarios, extracts the corresponding test execution scripts, and automatically generates a test case sequence; optimizes the test case sequence to obtain a priority test case sequence; executes the test case according to the priority test case sequence, and monitors the software's log in real time; if the target exception code exists in the query software's log, it is determined that the software has a defect, and obtains preset historical repair data to repair the software. By optimizing the test case sequence to obtain a priority test case sequence, the present invention can detect critical errors early in the execution of software testing, reduce the impact of the error spreading in the software life cycle, reduce the cost of later repairs, and thus improve the overall detection efficiency of software testing. BRIEF DESCRIPTION OF THE DRAWINGS
[0063] Figure 1 A flowchart of a computer software automatic testing and analysis method provided by an embodiment of the present invention;
[0064] Figure 2 A flow chart of a target semantic recognition model provided by an embodiment of the present invention;
[0065] Figure 3 A framework diagram of a computer software automatic testing platform provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0066] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0067] The embodiment of the present invention provides a computer software automatic testing and analysis method. Figure 1 , Figure 1 A flowchart of a computer software automatic testing and analysis method provided by an embodiment of the present invention. The method includes the following steps:
[0068] Substitute the software test request sent by the user into the target semantic recognition model to obtain the test category and test scenario;
[0069] Query the preset script library according to the test category and test scenario, extract the test execution script corresponding to the test category and test scenario, and automatically generate multiple test cases, and determine the multiple test cases into a test case sequence;
[0070] Optimize the target sequence of the test case sequence to obtain the priority test case sequence;
[0071] Execute test cases according to the prioritized test case sequence and monitor the software's record logs in real time;
[0072] If the target exception code exists in the query software's record log, it is determined that the software has a defect, and the preset historical repair data is obtained to repair the software.
[0073] A computer software automatic testing and analysis method provided by an embodiment of the present invention optimizes the test case sequence to obtain a priority test case sequence, which can detect critical errors early in the execution of software testing, reduce the impact of the error spread in the software life cycle, reduce the later repair costs, and thus improve the overall detection efficiency of software testing.
[0074] Specifically, test categories include functional testing, performance testing, security testing, and regression testing; test scenarios include normal scenarios, abnormal scenarios, UI automation scenarios, mobile performance testing scenarios, and compatibility testing scenarios; the pre-set script library is a collection of pre-stored and managed test scripts. Its core purpose is to enable rapid, automatic generation and reuse of test cases, reducing the workload of rewriting scripts and improving testing efficiency; the prioritized test case sequence is a prioritized sequence of test cases optimized for each test case; logs are event information automatically generated during software testing. Event information includes system logs (logs generated by the operating system or runtime environment (such as the JVM and .NET CLR), which record memory usage, thread status, and crash information); application logs (debugging information, error stack traces, and user operation traces output by the software itself through code (such as log4j and logging modules); and exception codes (specific error identifiers that may appear in logs (such as NullPointerException and Error Code 0x80070005) and are used to trigger defect determination). Pre-set historical repair data is set and obtained based on historical experience of staff.
[0075] In one implementation, see Figure 2 , Figure 2 A flowchart of a target semantic recognition model provided by an embodiment of the present invention, in which a software test request sent by a user is substituted into the target semantic recognition model to obtain a test category and a test scenario, includes:
[0076] Embed the software test request sentence into words to obtain the initial embedding vector;
[0077] The initial embedding vector is processed by multiple target attention mechanisms in sequence to obtain the attention vector;
[0078] Perform a residual connection operation on the attention vector to obtain the first eigenvector;
[0079] Normalize the attention vector to obtain the second eigenvector;
[0080] Fusing the attention vector, the first eigenvector, and the second eigenvector to obtain a fused eigenvector;
[0081] Perform a full connection operation on the fused feature vector to obtain the target feature, which is recorded as the key feature;
[0082] Detection is performed based on the key features to obtain corresponding test categories and test scenarios.
[0083] Specifically, the corresponding test categories and test scenarios are obtained based on the key features, including:
[0084] Substitute the key features into the preset detection model to obtain the corresponding test categories and test scenarios;
[0085] The specific operation process of the preset detection model is as follows:
[0086] Substitute the key features into the preset detection model to obtain the corresponding category probability and scene probability;
[0087] The corresponding test category is obtained by judging the category probability and category threshold interval;
[0088] The corresponding scene category is obtained by judging the scene probability and the scene threshold interval.
[0089] In one implementation, multi-level semantic processing and feature fusion significantly enhance the automatic analysis capabilities of software test request statements. Through word embedding and attention mechanisms, the model can accurately capture key semantic information in test requests (such as test objects, scenarios, or abnormal conditions), reducing ambiguity in manual parsing. Multi-level attention mechanisms and residual connection operations enhance contextual association capabilities, ensuring that implicit logic in complex requests (such as dependencies or priorities) is effectively extracted. Fusion of attention vectors, normalized features, and residual features enhances the model's robustness to diverse representations and adapts to the input habits of different users. The fully connected layer transforms the fused features into key features (such as test types or parameters) that can directly drive the test tool. Finally, detection based on these key features yields the corresponding test categories and test scenarios, significantly reducing manual intervention and accelerating the closed loop from requirements analysis to test execution.
[0090] In one implementation, the target attention mechanism layer works as follows:
[0091] Determine the initial embedding vector as the initial feature, substitute the initial feature into the target attention mechanism to obtain the first key vector, second key vector, query vector and value vector of the target attention mechanism layer;
[0092] Transposing the first key vector and the second key vector to obtain a first transposed vector and a second transposed vector, performing a dot product operation on the first transposed vector and the query vector to obtain a first weight vector, and performing a dot product operation on the second transposed vector and the query vector to obtain a second weight vector;
[0093] Adding the first weight vector and the second weight vector to obtain a weight vector;
[0094] Performing a normalization operation on the weight vector to obtain a normalized vector;
[0095] Perform a dot product operation on the value vector and the normalized vector to obtain the target dual attention vector.
[0096] In one implementation, optimizing the test case sequence to obtain a prioritized test case sequence includes:
[0097] The order of each test case in the test case sequence is used as a chromosome, and multiple chromosomes are randomly generated as a population. The fitness error corresponding to each chromosome is calculated using the fitness function, and the fitness errors of all chromosomes are compared to obtain the optimal fitness error. The optimal chromosome corresponding to the optimal fitness error is used as the evolution target and iterated through quantum evolution operations. Quantum evolution operations include: quantum revolving gate, quantum mutation operation and quantum crossover.
[0098] If the quantum genetic algorithm meets the convergence error or reaches the maximum number of iterations, the priority test case sequence is output.
[0099] In one implementation, a quantum genetic algorithm optimizes test case sequences, bringing significant benefits to software testing. By encoding the order of test cases as chromosomes and initializing the population, combined with a fitness function for evaluation, the algorithm intelligently identifies the optimal test sequence, effectively improving the early detection rate of critical defects. Quantum rotation gates, mutations, and crossover operations enhance the algorithm's global search capabilities, preventing traditional genetic algorithms from falling into local optimality and ensuring a more optimal test sequence. By setting convergence conditions and a maximum number of iterations, the algorithm controls computational costs while ensuring optimization results, achieving a balance between testing efficiency and resource consumption.
[0100] In one implementation, calculating the fitness error corresponding to each chromosome using the fitness function includes:
[0101] The formula of the fitness function is:
[0102]
[0103] Among them, S represents the fitness error of the current chromosome, GZ represents the average false detection rate of the current chromosome, FG represents the average branch coverage rate of the current chromosome, T ah represents the position of the first test case where the hth error is detected, T bk Indicates the position of the first test case covering the k-th branch, n is the total number of test cases, m is the total number of errors in the code to be tested, and j is the total number of branches that need to be covered in the code to be tested.
[0104] In one implementation, test cases are prioritized by the average error detection rate and the average branch coverage rate. The higher the average error detection rate, the faster the detection speed corresponding to errors in the code to be tested; the higher the average branch coverage rate, the faster the coverage speed of software branches. The fitness error combines the average error detection rate and the average branch coverage rate, which not only ensures that software errors are discovered as early as possible to reduce subsequent repair costs, but also ensures that test cases effectively cover software branches. This improves the effectiveness of the testing process while optimizing resource allocation, avoids the one-sidedness that may be caused by single-target evaluation, and makes the priority sorting results more in line with the actual needs of software testing.
[0105] Based on the same inventive concept, the present invention also provides a computer software automatic testing platform. Figure 3 , Figure 3 A framework diagram of a computer software automatic testing platform provided by an embodiment of the present invention includes:
[0106] Semantic recognition module: Substitutes the software test request sent by the user into the target semantic recognition model to obtain the test category and test scenario;
[0107] Script execution module: queries the preset script library according to the test category and test scenario, extracts the test execution script corresponding to the test category and test scenario, and automatically generates multiple test cases, and determines the multiple test cases into a test case sequence;
[0108] Sequence optimization module: optimizes the test case sequence to obtain the priority test case sequence;
[0109] Execution module: executes test cases according to the priority test case sequence and monitors the software record log in real time;
[0110] Anomaly detection module: If the target anomaly code exists in the query software's record log, it is determined that the software has a defect, and the preset historical repair data is obtained to repair the software.
[0111] A computer software automatic testing platform provided by an embodiment of the present invention optimizes the test case sequence to obtain a priority test case sequence, which can detect critical errors early in the execution of software testing, reduce the impact of the error spread in the software life cycle, reduce the later repair costs, and thus improve the overall detection efficiency of software testing.
[0112] It should be noted that, in this document, terms such as "comprises", "includes" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or apparatus that includes a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements that are inherent to such process, method, article or apparatus.
[0113] While the embodiments of the present invention have been shown and described, it will be apparent to those skilled in the art that various changes, modifications, substitutions, and alterations can be made to the embodiments without departing from the principles and spirit of the invention.
Claims
1. A computer software automatic testing and analysis method, characterized in that: The method comprises: Substitute the software test request sent by the user into the target semantic recognition model to obtain the test category and test scenario; Query the preset script library according to the test category and test scenario, extract the test execution script corresponding to the test category and test scenario, and automatically generate multiple test cases, and determine the multiple test cases into a test case sequence; Optimize the target sequence of the test case sequence to obtain the priority test case sequence; Execute test cases according to the prioritized test case sequence and monitor the software's record logs in real time; If the target exception code exists in the query software's record log, it is determined that the software has a defect, and the preset historical repair data is obtained to repair the software.
2. A computer software automatic testing and analysis method according to claim 1, characterized in that: Substituting the software test request sent by the user into the target semantic recognition model to obtain the test category and test scenario includes: Perform word embedding on the software test request sentence to obtain an initial embedding vector; Processing the initial embedding vector through multiple target attention mechanism layers in sequence to obtain an attention vector; Perform a residual connection operation on the attention vector to obtain a first eigenvector; Normalizing the attention vector to obtain a second eigenvector; Fusing the attention vector, the first feature vector, and the second feature vector to obtain a fused feature vector; Performing a full connection operation on the fused feature vector to obtain a target feature, which is recorded as a key feature; Detection is performed based on the key features to obtain corresponding test categories and test scenarios.
3. A computer software automatic testing and analysis method according to claim 2, characterized in that: The principle process of the target attention mechanism layer includes: Determine the initial embedding vector as the initial feature, substitute the initial feature into the target attention mechanism layer to obtain the first key vector, the second key vector, the query vector and the value vector of the target attention mechanism; Transposing the first key vector and the second key vector to obtain a first transposed vector and a second transposed vector, performing a dot product operation on the first transposed vector and a query vector to obtain a first weight vector, and performing a dot product operation on the second transposed vector and the query vector to obtain a second weight vector; Adding the first weight vector and the second weight vector to obtain a weight vector; Performing a normalization operation on the weight vector to obtain a normalized vector; Perform a dot product operation on the value vector and the normalized vector to obtain a target dual attention vector.
4. A computer software automatic testing and analysis method according to claim 1, characterized in that: Optimizing the test case sequence to obtain a priority test case sequence includes: The arrangement order of each test case in the test case sequence is used as a chromosome, and multiple chromosomes are randomly generated as a population; the fitness error corresponding to each chromosome is calculated using a fitness function, and the fitness errors of all chromosomes are compared to obtain an optimal fitness error; and the optimal chromosome corresponding to the optimal fitness error is used as an evolution target and iterated through a quantum evolution operation; the quantum evolution operation includes: a quantum rotating gate, a quantum mutation operation, and a quantum crossover; If the quantum genetic algorithm meets the convergence error or reaches the maximum number of iterations, the priority test case sequence is output.
5. A computer software automatic testing and analysis method according to claim 4, characterized in that: Calculating the fitness error corresponding to each chromosome by the fitness function includes: The formula of the fitness function is: ; Among them, S represents the fitness error of the current chromosome, GZ represents the average false detection rate of the current chromosome, FG represents the average branch coverage rate of the current chromosome, T ah represents the position of the first test case where the hth error is detected, T bk Indicates the position of the first test case covering the k-th branch, n is the total number of test cases, m is the total number of errors in the code to be tested, and j is the total number of branches that need to be covered in the code to be tested.
6. A computer software automatic testing platform, characterized in that: The platform includes: Semantic recognition module: Substitutes the software test request sent by the user into the target semantic recognition model to obtain the test category and test scenario; Script execution module: queries the preset script library according to the test category and test scenario, extracts the test execution script corresponding to the test category and test scenario, and automatically generates multiple test cases, and determines the multiple test cases into a test case sequence; Sequence optimization module: optimizes the test case sequence to obtain the priority test case sequence; Execution module: executes test cases according to the priority test case sequence and monitors the software record log in real time; Anomaly detection module: If the target anomaly code exists in the query software's record log, it is determined that the software has a defect, and the preset historical repair data is obtained to repair the software.
7. A computer software automatic testing platform according to claim 6, characterized in that: The semantic recognition module includes: word embedding module, attention module, residual module, normalization module, fusion module, full connection module and category detection module: The word embedding module is used to embed the software test request statement into words to obtain an initial embedding vector; The attention module is used to process the initial embedding vector through multiple target attention mechanism layers in sequence to obtain an attention vector; The residual module is used to perform a residual connection operation on the attention vector to obtain a first eigenvector; The normalization module is used to perform a normalization operation on the attention vector to obtain a second eigenvector; The fusion module is configured to fuse the attention vector, the first feature vector, and the second feature vector to obtain a fused feature vector; The fully connected module is used to perform a fully connected operation on the fused feature vector to obtain a target feature, and the target feature is recorded as a key feature; The category detection module is used to detect according to the key features to obtain corresponding test categories and test scenarios.
8. A computer software automatic testing platform according to claim 7, characterized in that: The principle process of the target attention mechanism layer includes: Determine the initial embedding vector as the initial feature, substitute the initial feature into the target attention mechanism layer to obtain the first key vector, the second key vector, the query vector and the value vector of the target attention mechanism; Transposing the first key vector and the second key vector to obtain a first transposed vector and a second transposed vector, performing a dot product operation on the first transposed vector and a query vector to obtain a first weight vector, and performing a dot product operation on the second transposed vector and the query vector to obtain a second weight vector; Adding the first weight vector and the second weight vector to obtain a weight vector; Performing a normalization operation on the weight vector to obtain a normalized vector; Perform a dot product operation on the value vector and the normalized vector to obtain a target dual attention vector.
9. A computer software automatic testing platform according to claim 6, characterized in that: Optimizing the test case sequence to obtain a priority test case sequence includes: The arrangement order of each test case in the test case sequence is used as a chromosome, and multiple chromosomes are randomly generated as a population; the fitness error corresponding to each chromosome is calculated using a fitness function, and the fitness errors of all chromosomes are compared to obtain an optimal fitness error; and the optimal chromosome corresponding to the optimal fitness error is used as an evolution target and iterated through a quantum evolution operation; the quantum evolution operation includes: a quantum rotating gate, a quantum mutation operation, and a quantum crossover; If the quantum genetic algorithm meets the convergence error or reaches the maximum number of iterations, the priority test case sequence is output.
10. A computer software automatic testing platform according to claim 9, characterized in that: Calculating the fitness error corresponding to each chromosome by the fitness function includes: The formula of the fitness function is: ; Among them, S represents the fitness error of the current chromosome, GZ represents the average false detection rate of the current chromosome, FG represents the average branch coverage rate of the current chromosome, T ah represents the position of the first test case where the hth error is detected, T bk Indicates the position of the first test case covering the k-th branch, n is the total number of test cases, m is the total number of errors in the code to be tested, and j is the total number of branches that need to be covered in the code to be tested.
Citation Information
Patent Citations
Detection system and method for computer software detection
CN116756023A
Population evolution multi-objective test case priority ranking method
CN110059015A
Root Framework framework test case automatic generation method and system based on improved GPT2
CN116841893A
Knowledge graph construction method based on IE-Triple
CN117252258A
Automatic software testing method and device based on artificial intelligence
CN119829467A