Static sequencing method for test cases of micro-service system based on semantic similarity

By generating semantic vectors and calculating similarity for test cases in microservice systems, the issues of flexibility and efficiency in test case sorting are resolved, achieving efficient test case priority sorting and reducing resource waste.

CN120973665APending Publication Date: 2025-11-18SUZHOU AEROSPACE INFORMATION RES INST
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510997364.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-18
Publication Date
2025-11-18

AI Technical Summary

Technical Problem

Existing technologies cannot effectively adapt to the characteristics of microservice architectures, rely on external information for test case sorting, and lack testing strategies for microservice systems, resulting in low testing efficiency and wasted resources.

Method used

By parsing test case code to generate an abstract syntax tree, extracting structural features of the software under test, generating semantic vectors, and combining this with a domain knowledge base to calculate test case similarity, the test cases are prioritized according to functional and non-functional test types.

Benefits of technology

It enables flexible test case priority allocation in microservice systems to adapt to different testing scenarios, reducing redundant execution and improving testing efficiency and resource utilization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120973665A_ABST
    Figure CN120973665A_ABST
Patent Text Reader

Abstract

The invention discloses a micro-service system test case static sorting method based on semantic similarity, which comprises the following steps: analyzing test case codes to generate an abstract syntax tree model, and extracting structural features of tested software; a logic structure in the abstract syntax tree is recognized, the logic structure comprises a sequential structure, branches and a loop, and semantic vectors of the test cases are generated according to operation behaviors, variable dependency relations and interface calling in the test cases through the semantic analysis technology; the distance between the semantic vectors corresponding to all the test cases is used for evaluating the similarity between the test cases; for a test case set, the importance degrees of different test types are divided according to two perspectives of function and non-function, and sorting is carried out according to the similarity of the test cases on the basis. The test efficiency and the resource utilization rate are effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application relates to test case sequencing, in particular to a micro-service system test case static sequencing method based on semantic similarity. BACKGROUND

[0002] In recent years, as a new type of software architecture, micro-service architecture has gradually become the mainstream architecture of complex software systems due to its low coupling, easy scalability and independent deployment advantages. However, with the modularization and distributed characteristics of the system, the testing difficulty of the micro-service system has also increased significantly. The micro-service system is often composed of multiple independent service modules, which communicate with each other through the network and have complex dependency relationships. This complexity brings great challenges to the configuration of the test environment, the management and execution of test cases, especially in the case of a large number of test cases and limited system resources, how to efficiently execute the test has become a problem that the development team needs to solve.

[0003] Test case prioritization (TCP) technology is one of the most commonly used techniques to speed up testing. Without reducing the number of test cases, the test case priority is set according to the established test target, so that test cases with higher priority are executed first. The purpose is to detect faults as soon as possible to speed up fault localization and thus reduce testing costs. Among them, the similarity-based TCP technology only needs to measure the similarity between test cases, which is suitable for most test scenarios. However, for the specific application scenario of micro-service system test case sequencing, when applying the TCP method based on vector similarity for static sequencing, the main limitations include: (1) The similarity analysis process of the test case needs information other than the test code (such as the code under test) as input, which has a narrow application range and is difficult to support black-box testing tasks from the user's perspective in a cloud environment; (2) It does not consider the unique requirements of micro-service testing, which are different from other types of software under test (such as monolithic applications), and lacks analysis and support for micro-service testing strategies. SUMMARY

[0004] The application aims to provide a micro-service system test case static sequencing method based on semantic similarity, which solves the problem that the prior art cannot effectively adapt to the characteristics of micro-service architecture, relies on external information and general corpus.

[0005] The technical solution of the application is: a micro-service system test case static sequencing method based on semantic similarity, comprising the following steps:

[0006] Step 1: Extracting the structural features of the software under test

[0007] An abstract syntax tree model is generated by parsing the test case code to extract the structural features of the software under test as the basis for calculating the semantic vector of the test case.

[0008] Step 2: Generating the semantic vector of the test case

[0009] Logical structures in the abstract syntax tree are identified, including sequential structure, branching, and looping. Using semantic analysis techniques, the semantic vector of the test case is generated based on the operation behavior, variable dependency, and interface call in the test case, serving as the basis for further semantic similarity calculation.

[0010] Step 3: Semantic similarity calculation of test cases

[0011] The distance between the semantic vectors of each test case is used to evaluate the similarity between test cases, serving as a measure of the testing capability between test cases and laying the foundation for test case ranking.

[0012] Step 4: Microservice test case ranking

[0013] For the test case set, the importance of different test types is divided from the perspectives of function and non-function, and on this basis, the test cases are ranked according to their similarity.

[0014] Further, Step 1: Extracting the structural features of the software under test, the specific method is:

[0015] Step 1.1, test case code parsing

[0016] The compiler front-end tool is used for lexical analysis and syntax analysis of the test case code to generate an abstract syntax tree containing complete syntax information, which converts the source code into a tree structure representation. In which: the node represents the syntax element, and the edge represents the nesting relationship of the syntax element.

[0017] Step 1.2, extracting the structural features of the software under test based on parsing

[0018] By performing a depth-first traversal of the abstract syntax tree, the structural features of the software under test are extracted, including the following three dimensions:

[0019] (1) Logical entity features: class name, member attribute, member method;

[0020] (2) Dependency relationship features: inheritance chain, call chain, type reference;

[0021] (3) Interface features: REST API endpoint, message queue interface.

[0022] Further, Step 2: Generating the semantic vector of the test case, the specific method is:

[0023] Step 2.1, feature information filtering

[0024] A dual filtering mechanism is constructed: text features are filtered for stop words and word segmentation noise using NLP techniques; code features are filtered for non-execution content using regular expressions;

[0025] Step 2.2, domain knowledge construction

[0026] Extract historical test cases from open source platforms to build a domain knowledge base containing three elements for semantic analysis of current test cases, including the following three aspects: microservice typical scenario classification; test mode annotation; domain-specific vocabulary;

[0027] Step 2.3, semantic vector construction

[0028] Based on the domain knowledge base, the effective structural information obtained in step 2.1 is tokenized to generate a semantic vector corresponding to each test case, specifically:

[0029] First, a depth-first traversal algorithm is used to extract three types of key nodes in the abstract syntax tree:

[0030] Control flow nodes, including loops, branches;

[0031] Data flow nodes, including variable declarations, parameter passing;

[0032] Service interaction nodes, including API calls, message publishing;

[0033] Then, combine the program tokens to quantify the information of these key nodes, map each key node to a specific token, and count the frequency and position information of these tokens to construct a sparse vector to represent the characteristics of the test case.

[0034] Further, step 3: semantic similarity calculation of test cases, the specific method is:

[0035] Use cosine similarity or Euclidean distance to calculate the similarity between vectors, the lower the similarity, the higher the priority.

[0036] Further, step 4: microservice test case sorting, the specific method is:

[0037] Step 4.1, microservice test type division

[0038] Microservice test type is divided into tests for microservice functionality and non-functional tests for microservice quality, the former is used to judge the correctness of service running, and the latter is used to judge the advantages and disadvantages of microservice, so the test cases of functional type are prior to the test cases of non-functional type, including:

[0039] c) Classification and ordering for functional test types

[0040] F1: Communication test;

[0041] F2: Data test;

[0042] F3: Consumer-side contract test;

[0043] F4: Provider-side contract test;

[0044] d) Classification and ordering for non-functional test types

[0045] NF1: Coexistence test;

[0046] NF2: Availability test;

[0047] NF3: Fault tolerance test;

[0048] NF4: Performance test;

[0049] NF5: Coupling test;

[0050] NF6: Cohesion test;

[0051] Step 4.2, test priority ordering

[0052] For a test case set, first, the test types are prioritized, and then the test cases of the same type are statically sorted according to the similarity analysis result of step 3. For each test case, the test priority order is determined by the average similarity degree of the test case with other test cases of the same type. The lower the average similarity degree, the higher the test priority.

[0053] A microservice system test case static sorting system based on semantic similarity, implements the microservice system test case static sorting method based on semantic similarity, and realizes microservice system test case static sorting based on semantic similarity. Four modules are used to perform steps 1 to 4.

[0054] A computer device includes a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the microservice system test case static sorting method based on semantic similarity is implemented, and the microservice system test case static sorting based on semantic similarity is realized.

[0055] A computer readable storage medium has a computer program stored thereon. When the computer program is executed by a processor, the microservice system test case static sorting method based on semantic similarity is implemented, and the microservice system test case static sorting based on semantic similarity is realized.

[0056] Compared with the prior art, the present application has the following advantages:

[0057] (1) The test case priority of the microservice system can be statically divided. The existing technology can only statically divide the test case priority of the traditional application system, and cannot be directly applied to the microservice system. This is determined by the characteristics of the microservice architecture, which has greater complexity, multi-language programming, heterogeneous and independent microservices, runtime communication behavior, and other characteristics. These characteristics determine that the test strategy and static priority division of test cases for microservice systems are different from traditional software. Therefore, the present application is based on the characteristics of the microservice system and combines various test strategies such as unit testing, contract testing, integration testing, component testing, and end-to-end testing. By classifying different types of test cases, the present application can flexibly adapt to the needs of different test scenarios.

[0058] Under the microservice architecture, the scalability and modular design of the system increase the interdependence between test cases. Compared with the traditional single-dimensional test method, the present application provides a multi-dimensional and flexible priority division mechanism that can comprehensively judge the test priority according to multiple dimensions such as test type, module importance, and similarity. This flexibility enables the present application to handle system testing of different sizes and complexities.

[0059] (2) The semantic similarity between test cases can be evaluated. Existing corpora are not targeted, such as Wikipedia, which is a general corpus and is not suitable for evaluating the semantic similarity of test cases. In the present application, a test case corresponding corpus is established, and after preprocessing the test cases, the test cases are converted into embedded vector representations. By applying similarity, the present application can effectively identify the similarity between test cases and avoid repeatedly executing test cases with similar functions. This not only reduces the test time, but also improves the efficiency of test case management.

[0060] Especially in large systems, the number of test cases is large, and repeated testing may consume a lot of resources. The present application generates a similarity vector through semantic analysis and can determine which test cases can be skipped or delayed in certain scenarios based on similarity, thereby avoiding resource waste.

[0061] (3) Improve test efficiency and save test resources. Traditional test case sorting methods mainly rely on coverage information or historical execution data to determine the priority of test cases, which is often difficult to achieve in microservice systems. The modularization and distributed characteristics of microservice systems make it very complex to collect and calculate coverage information. However, the present application uses a semantic similarity-based sorting method that does not rely on coverage information and other difficult-to-obtain information, and directly extracts syntax and semantic information from the code of the test cases for priority division.

[0062] In this way, the application can effectively improve the test efficiency without relying on a large amount of historical data or complex environment configuration. At the same time, the similarity analysis of the test cases can avoid repeated execution of functionally similar test cases, reduce unnecessary test operations, and save test resources. BRIEF DESCRIPTION OF DRAWINGS

[0063] Figure 1 is a process block diagram in the application.

[0064] Figure 2 is a key technology flowchart in the application. DETAILED DESCRIPTION

[0065] In order to make the purpose, technical scheme and advantages of the present application clearer, the present application will be further described in detail below in combination with the drawings and examples. It should be understood that the specific examples described herein are only used to explain the present application and do not limit the present application.

[0066] The application proposes a microservice system test case static sorting method based on semantic similarity. By combining the microservice test strategy features and the traditional software test case priority division method, the static sorting of test cases is realized. The core of the method is: 1) based on abstract syntax tree (AST) to analyze the structural features of test code and the software under test; 2) combining program semantics and domain knowledge to construct a test case feature vector; 3) fusion of functional / non-functional test strategy evaluation and semantic similarity analysis to generate priority sorting. As shown in Figure 1 The specific steps are as follows:

[0067] Step 1: Extracting the structural features of the software under test

[0068] By parsing the test case code to generate an abstract syntax tree model, the structural features of the software under test are extracted as the basis for calculating the semantic vector of the test case.

[0069] Step 1.1, test case code parsing. Use a compiler front-end tool (such as ANTLR) to perform lexical analysis and syntax analysis on the test case code to generate an abstract syntax tree (AST) containing complete syntax information. AST converts source code into a tree structure representation, in which: nodes represent syntax elements (such as function call nodes containing method names, parameter list attributes); edges represent the nesting relationship of syntax elements (such as the inclusion relationship of loop body and branch statements).

[0070] Through the hierarchical structure of AST, a syntax association model of test cases and the system under test is established. By parsing the source code of each test case into an abstract syntax tree (AST), a foundation is laid for analyzing and extracting the structural features of the software under test.

[0071] Step 1.2, Feature Extraction Based on Resolved Software Structure. A structured feature matrix is established as the basis for subsequent semantic analysis. There are uses of the interfaces of the software under test on the AST corresponding to the test case code, so by performing a depth-first traversal of the AST, various information about each logical entity class of the software under test can be extracted, including class names, class members and member methods, and other entities; inheritance, calling, type reference, and object creation dependencies. The structural features extracted mainly include the following three dimensions:

[0072] (1) Logical entity features: class name, member attribute, member method, and other static structures

[0073] (2) Dependency relationship features: inheritance chain, call chain, type reference, and other static associations

[0074] (3) Interface features: REST API endpoints, message queue interfaces, and other microservice-specific elements

[0075] Step 2: Generate semantic vectors for test cases.

[0076] By identifying the logical structure in the abstract syntax tree, including sequential structure, branching, and looping, and using semantic analysis techniques, the semantic vectors of the test cases are generated based on the operation behavior, variable dependency relationship, and interface call in the test cases, serving as the basis for further semantic similarity calculation. The specific method is as follows:

[0077] Step 2.1, Feature Information Filtering. A dual filtering mechanism is constructed: text features are filtered for stop words and word segmentation noise using NLP techniques; code features are filtered for non-execution content such as comments and blank lines using regular expressions.

[0078] Step 2.2, Domain Knowledge Construction. Historical test cases are extracted from open source platforms such as GitHub and GitLab to construct a domain knowledge base containing three major elements for the semantic analysis of current test cases. The knowledge base includes the following three aspects: microservice typical scenario classification (such as service discovery, fuse degradation); test pattern annotation (contract testing, fault tolerance testing, etc.); and domain-specific glossary (such as Kubernetes-specific terminology).

[0079] Step 2.3, Semantic Vector Construction. Based on the domain knowledge set, the effective structure information obtained in step 2.1 is tokenized to generate a semantic vector corresponding to each test case. Specifically, a depth-first traversal algorithm is used to extract three types of key nodes in the AST: control flow nodes, including loops (for / while), branches (if / switch); data flow nodes, including variable declarations, parameter passing; service interaction nodes including API calls, message publishing. Then, combining the program tokens, the information of these key nodes is quantified, and each key node is mapped to a specific token. The frequency and position information of these tokens are counted, and a sparse vector is constructed to represent the characteristics of the test case.

[0080] Step 3: Semantic Similarity Calculation of Test Cases

[0081] The distance between the semantic vectors corresponding to each test case is used to evaluate the similarity between test cases, serving as a measure of the test capabilities between test cases, laying the foundation for test case ranking. The specific method is as follows: using distance measurement methods between vectors, such as cosine similarity or Euclidean distance, to calculate the similarity between different test case feature vectors. The smaller the distance, the more similar the test cases in syntax structure and function implementation.

[0082] Step 4: Microservice Test Case Ranking

[0083] For the test case set, the importance of different test types is divided from the perspectives of function and non-function, and on this basis, the test cases are ranked according to their similarity. The specific method is as follows:

[0084] Step 4.1, Microservice Test Type Division. Overall, it is divided into tests for microservice functions and non-functional tests for microservice quality. The former is used to judge the correctness of service operation, and the latter is used to judge the advantages and disadvantages of microservices, so the function type test case is prior to the non-function type test case. Specific types include:

[0085] e) Division of Function Test Type

[0086] F1: Communication Test, verify the interaction between external communication modules and external services according to the importance of functions.

[0087] F2: Data Test, verify the interaction between data access modules and external databases according to the importance of functions.

[0088] F3: Consumer-side Contract Test, define the request and expected response between consumer and provider through streaming API, and verify whether it meets the expectations.

[0089] F4: Contract test on provider side, according to contract file, simulate the consumer sending request to provider, verify the response result with the result in contract file.

[0090] f) Classification for non-functional test types

[0091] NF1: Coexistence test, since each service is developed by different team, there may be service conflict, resource conflict and circular dependency problem, improper handling will cause system error.

[0092] NF2: Availability test, thanks to high availability technology and container orchestration technology, the availability of microservice architecture application is improved through the large redundancy of service instances, and the number of key service instances is measured, too many or too few will affect the system.

[0093] NF3: Fault tolerance test, measure whether the service's fuse, flow limiting, degradation, load balancing and other mechanisms are implemented, such as the service cannot be correctly fused, which may cause the system to crash.

[0094] NF4: Performance test, through monitoring the resource utilization of container or increasing the number of concurrent access, the service with low performance can be improved to avoid performance bottleneck.

[0095] NF5: Coupling test, under microservice architecture, the responsibility of each service should be more single, and the service is not enough single will cause more dependence between services, reduce efficiency and maintainability, which can be judged by the strength of the dependence between services.

[0096] NF6: Cohesion test, each service in microservice architecture application should focus on the business of one domain model, and high cohesion service is conducive to testing and modification.

[0097] Step 4.2, test priority sorting. According to the similarity analysis results of step 3, the test case set in the above ten test types (F1~F4, NF1~NF6) is statically sorted according to the set type division rule. The specific method is: the similarity degree between test cases is calculated by using the distance measurement method between vectors (such as Euclidean distance, cosine similarity, etc.), for each test case, its test priority order is determined by the average value of the similarity degree with all other test cases, the lower the average value of similarity degree, the higher the test priority.

[0098] Through the four-stage processing flow, this method realizes the deep integration of structural features and semantic features, the vector space modeling guided by domain knowledge, the test division of multiple test strategies, and finally forms an optimized sorting scheme that takes into account the test efficiency and defect detection rate.

[0099] Embodiment

[0100] To verify the effectiveness of the present application scheme, the following experimental design is carried out.

[0101] It is known that six test cases are generated to form a test case set T = {t1, t2,..., t6}, which are integration testing and performance testing. Among them, t1 is integration testing, verifying the interaction function between services; t2-t6 is performance testing.

[0102] Step 1: Extracting the structural features of the software under test

[0103] Suppose the test code of t1 is as follows:

[0104]

[0105] After parsing the code into an AST tree, three types of structural features of the software under test can be obtained from it

[0106] (1) Logical entity features: class name Mockito, TimeoutException, member attribute paymentGateway, paymentService, member method process, triggerCircuitBreaker;

[0107] (2) Dependency relationship features: There is no inheritance chain, there are call chains testPaymentTimeout→when→process→any, testPaymentTimeout→assertTrue→triggerCircuitBreaker, and type references testPaymentTimeout→Mockito, etc. Static associations.

[0108] (3) Interface features: service call interfaces paymentGateway.process(any()), paymentService.triggerCircuitBreaker(), etc. Microservice-specific elements.

[0109] Step 2: Generate semantic vectors of test cases

[0110] First, filter out meaningless stop words such as any and assertTrue through feature information. Then use the constructed domain knowledge base to map the filtered tokens to vectors using the Word2Vec model. Suppose the similarity vector obtained is:

[0111] s1: [0.2, 0.2, 0.6]

[0112] s2: [0.1, 0.3, 0.6]

[0113] ■s3: [0.2, 0.5, 0.3]

[0114] ■s4: [0.8, 0.1, 0.1]

[0115] ■s5: [0.4, 0.4, 0.2]

[0116] ■s6: [0.7, 0.2, 0.1]

[0117] Step 3, semantic similarity calculation of test cases

[0118] Similarity calculation: here, the Euclidean distance is used to calculate the distance between each test case vector, measuring its similarity. For example:

[0119]

[0120] The similarity matrix is obtained as follows:

[0121] [s2] [s3] [s4] [s5] [s6] Avg(s i )]]> [s2] - 0.37 0.88 0.51 0.79 0.64 s3 0.37 - 0.75 0.24 0.62 0.50 [s4] 0.88 0.75 - 0.51 0.14 0.57 [s5] 0.51 0.24 0.51 - 0.37 0.41 [s6] 0.79 0.62 0.14 0.37 - 0.48

[0122] Step 4, microservice test case sorting

[0123] According to the test type division method of F1-F4, NF1-NF6, the classification of 6 test cases is:

[0124]

[0125]

[0126] According to the test type division, the functional test t1 should be prioritized over other non-functional tests in the sorting, and the non-functional tests are sorted from small to large according to the similarity matrix result, Avg(s i ) is obtained t5, t6, t3, t4, t2, so the final sorting is t1, t5, t6, t3, t4, t2.

[0127] Expected result: through semantic similarity and static priority division, test cases can be more effectively selected and executed, improving test efficiency and resource utilization.

[0128] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described, however, as long as the combinations of the technical features do not exist contradictions, they should be considered as the scope of the present disclosure.

[0129] The above-described embodiments are merely illustrative of several embodiments of the present application, which are described in more detail and in a specific manner, but should not be construed as limiting the scope of the present application. It should be noted that, for those skilled in the art, several modifications and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.

Claims

1. A static sorting method for test cases in a microservice system based on semantic similarity, characterized in that, Includes the following steps: Step 1: Extraction of structural features of the software under test By parsing the test case code to generate an abstract syntax tree model, the structural features of the software under test are extracted and used as the basis for calculating the semantic vector of the test cases. Step 2: Generate semantic vectors for test cases Identify the logical structure in the abstract syntax tree, including three types: sequential structure, branching and looping. Using semantic analysis techniques, generate semantic vectors for test cases based on operational behaviors, variable dependencies and interface calls, which serve as the basis for further semantic similarity calculations. Step 3: Calculate the semantic similarity of test cases The similarity between test cases is evaluated by using the distance between the semantic vectors corresponding to each test case, which serves as a metric for measuring the testing capabilities of test cases and lays the foundation for test case ranking. Step 4: Sorting Microservice Test Cases For the test case set, the importance of different test types is divided according to both functional and non-functional perspectives, and then sorted according to the similarity of test cases.

2. The static sorting method for test cases of microservice systems based on semantic similarity according to claim 1, characterized in that, Step 1: Extract the structural features of the software under test. The specific method is as follows: Step 1.1, Test Case Code Analysis The compiler front-end tool is used to perform lexical and syntactic analysis on the test case code, generating an abstract syntax tree containing complete syntactic information, and transforming the source code into a tree structure representation, where nodes represent syntactic elements and edges represent the nesting relationship of syntactic elements; Step 1.2, Extraction of structural features of the software under test based on parsing. By performing a depth-first traversal of the abstract syntax tree, the structural features of the software under test are extracted, including the following three dimensions: (1) Logical entity characteristics: class name, member attributes, member methods; (2) Dependency characteristics: inheritance chain, call chain, type reference; (3) Interface characteristics: RESTAPI endpoint, message queue interface.

3. The static sorting method for microservice system test cases based on semantic similarity according to claim 1, step 2: generating semantic vectors for test cases, specifically as follows: Step 2.1, Feature Information Filtering A dual filtering mechanism is constructed: text features are filtered using NLP techniques to remove stop words and segmentation noise; code features are filtered using regular expressions to remove non-execution content. Step 2.2, Domain Knowledge Construction Historical test cases are extracted from open-source platforms to build a domain knowledge base containing three key elements for semantic analysis of current test cases. The domain knowledge base includes the following three aspects: typical microservice scenario classification; test pattern annotation; and domain-specific vocabulary. Step 2.3, Semantic Vector Construction Based on the domain knowledge base, the valid structural information obtained in step 2.1 is used to extract tokens and generate semantic vectors corresponding to each test case, specifically: First, a depth-first search algorithm is used to extract three types of key nodes from the abstract syntax tree: Control flow nodes, including loops and branches; Data flow nodes include variable declarations and parameter passing; Service interaction nodes, including API calls and message publishing; Then, by combining the program token, the information of these key nodes is quantified, each key node is mapped to a specific token, the frequency and location information of these tokens are counted, and a sparse vector is constructed to represent the characteristics of the test cases.

4. The static sorting method for test cases of microservice systems based on semantic similarity according to claim 1, characterized in that, Step 3: Calculate the semantic similarity of test cases. The specific method is as follows: Cosine similarity or Euclidean distance is used to calculate the similarity between vectors, and the lower the similarity, the higher the priority.

5. The static sorting method for test cases of microservice systems based on semantic similarity according to claim 1, characterized in that, Step 4: Sorting microservice test cases, the specific method is as follows: Step 4.1, Classification of Microservice Test Types Microservice testing is categorized into functional tests and quality tests. Functional tests determine the correctness of service operation, while quality tests determine the quality of the microservice. Therefore, functional test cases take precedence over non-functional test cases, including: a) Classification and sorting of functional test types F1: Communication Test; F2: Data Test; F3: Contract testing on the consumer side; F4: Contract testing on the provider side; b) Classification and sorting of non-functional test types NF1: Coexistence Test; NF2: Usability Testing; NF3: Fault Tolerance Testing; NF4: Performance Testing; NF5: Coupling test; NF6: Cohesion Test; Step 4.2, Test Priority Ranking First, prioritize the test case set according to test type. Then, based on the similarity analysis results in step 3, statically sort the test cases of the same type. For each test case, its test priority order is determined by the average similarity between it and other test cases of the same type. The lower the average similarity, the higher the test priority.

6. A static sorting system for test cases in a microservice system based on semantic similarity, characterized in that, Implement the static sorting method for microservice system test cases based on semantic similarity as described in any one of claims 1-5, and realize the static sorting of microservice system test cases based on semantic similarity, and execute steps 1 to 4 in four modules respectively.

7. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, it implements the static sorting method for microservice system test cases based on semantic similarity as described in any one of claims 1-5, thereby realizing static sorting of microservice system test cases based on semantic similarity.

8. A computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, it implements the static sorting method for test cases of a microservice system based on semantic similarity as described in any one of claims 1-5, thereby realizing static sorting of test cases for a microservice system based on semantic similarity.