Software test case sharing and multiplexing method and system based on semantic understanding search

By building a test case knowledge graph and using semantic understanding search technology, the cumbersome problems of writing and maintaining test cases are solved, efficient sharing and reuse of test cases is achieved, and testing efficiency and quality are improved.

CN119718925APending Publication Date: 2025-03-28CHINESE PEOPLES LIBERATION ARMY UNIT 96901
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202411796292.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-09
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

The writing and maintenance of test cases in the prior art is complicated, resulting in increased repetitive work, high testing costs and low efficiency, and lack of effective test case sharing and reuse methods.

Method used

Using a method based on semantic understanding search, a test case knowledge graph is constructed, search terms are understood through semantic understanding, intent recognition, semantic disambiguation and word meaning expansion are carried out, and interrelated test case data is recommended.

Benefits of technology

It realizes sharing and reuse from semantic search to software test cases, improves testing efficiency and quality, and reduces repeated work and testing costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119718925A_ABST
    Figure CN119718925A_ABST
Patent Text Reader

Abstract

The invention relates to a software test case sharing and multiplexing method and system based on semantic understanding search, and belongs to the technical field of software testing. According to the method, defined entities, attributes of the entities and relationships among the entities are extracted from massive software test cases, a software test case knowledge graph is constructed, and the extracted knowledge is fused under the same framework specification to form a high-quality knowledge base. Meanwhile, word segmentation understanding based on semantic understanding is carried out on search words of the user, intention recognition, semantic ambiguity elimination and word meaning expansion are carried out on the search words after word segmentation through the constructed knowledge graph, search results are clustered and sorted according to service weights and provided for the user, and sharing and reuse from semantic search to software test cases are achieved. The testing efficiency and quality are improved, and repeated work and testing cost are reduced. Meanwhile, the method has high practicability and universality and can be applied to different software testing scenes and projects.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of software testing, and in particular relates to a method and system for sharing and reusing software testing cases based on semantic understanding search. Background Art

[0002] With the continuous development of software development, software testing has become increasingly important. In software testing, test cases are an important means of testing software systems and play an important role in ensuring software quality and reliability. They are used to verify whether the software meets the expected functional and performance requirements. However, the writing and maintenance of test cases is a tedious task that requires a lot of time and human resources. In addition, repeated writing and maintenance of test cases will also lead to increased testing costs and reduced testing efficiency. To this end, an effective test case sharing and reuse method is needed to improve testing efficiency and quality. Summary of the invention

[0003] 1. Technical issues to be resolved

[0004] The technical problem to be solved by the present invention is: to design a software test case sharing and reuse method and system, to realize the sharing and reuse from semantic search to software test cases, to improve test efficiency and quality, and to reduce duplication of work and test costs.

[0005] (II) Technical solution

[0006] In order to solve the above technical problems, the present invention provides a software test case sharing and reuse method based on semantic understanding search, comprising the following steps:

[0007] Step S101: construct a test case knowledge graph according to configuration item software, test items, and test cases;

[0008] Step S102: receiving input software test related search terms; wherein the search terms include any one or more of configuration item software name, identification and evaluation organization, test level, document name, document type, test item name, test case name, test purpose, test environment, test data, and test result;

[0009] Step S103: performing a semantic understanding search on the search term based on the knowledge graph to obtain search results corresponding to the search term; during the search process, performing semantic understanding on the search term, and performing reasoning analysis on the search term based on the association between various entities in the knowledge graph;

[0010] Step S104: outputting the interrelated test case data corresponding to the search results as recommendation results.

[0011] The present invention also provides a system for the method, the system comprising:

[0012] A construction unit, configured to construct a test case knowledge graph based on software testing related knowledge, wherein the software testing related knowledge includes interrelated software testing data;

[0013] A receiving unit, used for receiving an input test case question search term;

[0014] A semantic understanding search unit, configured to perform a semantic understanding search on the search term based on the knowledge graph to obtain search results corresponding to the search term;

[0015] The output unit is used to output the interrelated test case data corresponding to the search results as recommendation results.

[0016] (III) Beneficial effects

[0017] The present invention extracts defined entities, attributes of entities and relationships between entities from massive software test cases, constructs a software test case knowledge graph, and integrates the extracted knowledge under the same framework specification to form a high-quality knowledge base. At the same time, a segmentation understanding based on semantic understanding is carried out for user search terms, and the constructed knowledge graph is used to perform intent recognition, semantic disambiguation and word meaning expansion on the search terms after segmentation, and the search results are clustered and sorted according to business weights and provided to users, realizing sharing and reuse from semantic search to software test cases, improving test efficiency and quality, and reducing duplication of work and test costs. At the same time, the invention has high practicality and versatility, and can be applied to different software testing scenarios and projects. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 A schematic diagram of a test case recommendation design method flow chart provided by an embodiment of the present invention;

[0019] Figure 2 A flowchart of a semantic understanding search method provided by an embodiment of the present invention;

[0020] Figure 3 A block diagram of a test case recommendation design system provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0021] In order to make the purpose, content and advantages of the present invention more clear, the specific implementation methods of the present invention are further described in detail below in conjunction with the drawings and examples.

[0022] With the development of intelligent technology approaches for software testing, the growth of data scale and the complexity of the relationship with products are constantly changing and increasing, but the technical means of knowledge acquisition have long been out of touch with the urgent needs of testers. Testers often don't know whether the knowledge resources they need are available in the company? If so, where are they? Are there any places I don't know about, or knowledge that I should know but don't know yet? Such problems also plague new employees, making it very difficult for them to grow quickly in their new jobs. Moreover, even if the company has accumulated a certain amount of testing technical documents, there are often a lot of unstructured text data of test case knowledge that is difficult to use, data is difficult to deeply integrate, and the depth of test knowledge application is shallow. Solving these problems has become an urgent need for the company to meet.

[0023] In order to solve the above problems, the test case knowledge graph intelligent recommendation provided by the embodiment of the present invention applies the knowledge graph in artificial intelligence technology to the field of software testing, so as to enable the machine to understand the empirical knowledge of test case compilation, thereby allowing the machine to use knowledge to enrich the intelligent test case compilation method. It can not only integrate the massive and discrete knowledge points in the field of software testing, systematize the software testing knowledge, and form general and learnable knowledge, but also discover new knowledge through graph reasoning based on the formed test knowledge, greatly reducing the cost of enterprise intelligent transformation; using interactive machine learning technology, the knowledge of each dimension of software testing in the knowledge graph is converted into features for statistical learning, supporting the learning function based on reasoning, error correction, and annotation interactive actions, continuously precipitating knowledge logic and models, improving the intelligence of the system, precipitating knowledge within the enterprise, and reducing dependence on experience.

[0024] The embodiment of the present invention provides a method and system for sharing and reusing software test cases based on semantic understanding search, such as Figure 1 As shown, the method includes the following steps S101 to S104:

[0025] Step S101: construct a test case knowledge graph according to configuration item software, test items, and test cases, wherein the configuration item software, test items, and test cases include interrelated test data; construct a knowledge graph global knowledge classification system according to the configuration item software, test items, and test case modeling, extract knowledge from data of different sources and different structures, and store the formed knowledge into the knowledge graph; perform entity extraction, association annotation, concept disambiguation, data preprocessing, and text mining in software test case data with complex formats and contents, and construct a test case knowledge graph from the perspectives of test methods, evaluation agencies, selection of testers, test objectives, test types, test environments, and test data.

[0026] Specifically, step S101 includes:

[0027] Based on software test cases, define the entities, attributes of entities and relationships between entities in the software testing knowledge graph; perform ontology modeling to define the entity types and basic attributes of each entity in the knowledge graph, including reasonably defining the data model in the knowledge graph based on the provided data and application requirements, and clarifying the entities, relationships, and attributes of each entity and relationship in the graph; specifically including: (1) analyzing existing test cases and execution processes to build a conceptual system for the software testing field; (2) defining the basic attributes of the tested software, test items, test cases, evaluation organizations, and test personnel entities in the software testing graph scenario; (3) defining the relationships between the tested software, test items, test cases, evaluation organizations, and test personnel entities in the software testing scenario.

[0028] Extract defined entities, entity attributes and relationships between entities from the software test cases, and fuse the extracted knowledge under the same framework specification, and integrate them into the knowledge graph after fusion; the extracted knowledge includes defined entities, entity attributes and relationships between entities extracted from the test cases; perform knowledge extraction and fusion in sequence, that is, after obtaining software test related data and ontology modeling through multiple channels, obtain entity, relationship and entity attribute information from existing unstructured and semi-structured data through knowledge extraction technology according to the entities and relationships defined in the ontology modeling step; in addition, after the knowledge extraction work is completed, the knowledge from different knowledge sources is integrated, de-redundant, disambiguated, processed, reasoned and verified, and updated under the same framework specification through knowledge fusion technology to form a high-quality enterprise knowledge base. The following is a detailed explanation of the above steps, which also includes the meanings of the formulas and letters involved:

[0029] Knowledge extraction: This step is to extract useful knowledge from raw data or information sources. This knowledge exists in the form of rules, patterns, concepts, and facts.

[0030] Knowledge extraction can be achieved using remotely supervised relationship extraction methods.

[0031] The above-mentioned knowledge extraction and fusion specifically include: (1) Knowledge extraction: extracting entities, attributes and entity relationships defined in ontology modeling from different data sources, such as requirement specifications, software design plans, and test reports; among them, ① Entity extraction: by adding a software testing domain dictionary, using the Bi-LSTM+CRF model; ② Attribute extraction: the same as entity extraction, by adding a software testing domain dictionary, using the Bi-LSTM+CRF model; ③ Relationship extraction: using the remote supervision method, extracting entity pairs with relationships from the existing knowledge base, and then extracting sentences containing entity pairs from unstructured text as training examples to train the relationship extractor;

[0032] (2) Knowledge fusion: The knowledge extracted from multiple data sources is integrated into the knowledge graph after fusion. When performing knowledge fusion, it is necessary to solve various types of data conflict problems, such as one phrase corresponding to multiple entities, inconsistent configuration item software names, missing attributes, inconsistent attribute values, one-to-many mapping of attribute values, multiple relationships between entities, incomplete or inaccurate data in the knowledge graph, the existence of polysemous words or synonyms, complex associations between entities or attributes, and ambiguous data in the knowledge graph; the knowledge fusion stage mainly performs ontology alignment and entity matching on the data.

[0033] The extracted knowledge is connected to a relational database, and the tables in the structured data of the relational database are mapped to entities and attributes of entities in the knowledge graph. Among them, the mapping is D2R mapping, which converts the data in the relational database into semantic data in the form of RDF triples. It is necessary to formulate a set of mapping specifications from the relational database to the semantic data and describe them in XML language, namely D2RML; the key to knowledge mapping of structured data is to fully understand the basic structure in the structured data, including the meaning of each table and the relationship between the tables, as well as the structure of the knowledge graph, and use D2RML to associate the tables in the structured data with the concepts or entities in the knowledge graph. The knowledge extraction service connects to the target database in the mapping file, reads the data in the corresponding table, maps the table and column data in the relational database into conceptual entities and attributes of entities respectively, and then stores the knowledge obtained from these mappings in the software test case knowledge graph.

[0034] Step S102: receiving input software testing related search terms; wherein the search terms include any one or more of configuration item software name, identification and evaluation organization, test level, document name, document type, test item name, test case name, test purpose, test environment, test data, and test results.

[0035] Step S103: Based on the knowledge graph, a semantic understanding search is performed on the search term to obtain search results corresponding to the search term. During the search process, a semantic understanding is performed on the search term, and an inference analysis is performed on the search term based on the association between various entities in the knowledge graph to achieve a reference for intelligent recommendation of test cases. For example, from a large amount of test case data, by inputting the configuration item software name, identification and evaluation agency, test level, document name, document type, test item name, test case name, test purpose, test environment, test data, and test result information, other related data is searched out, and its association is checked through the knowledge graph.

[0036] The embodiment of the present invention also provides a semantic understanding search method based on knowledge graph, such as Figure 2As shown in the figure, it mainly includes word segmentation technology based on knowledge graph intention recognition and sorting strategy based on knowledge graph. In terms of word segmentation technology, compared with the traditional Chinese word segmentation algorithm, the intelligent search engine based on knowledge graph provides a variety of word segmentation plug-ins, and can provide domain dictionary configuration according to the user's specific use field to realize personalized word segmentation strategy. The main word segmentation plug-ins provided include: IK, Ansj word segmentation plug-in, Pinyin word segmentation plug-in, synonym word segmentation plug-in, and optimization stage, optimize the domain word segmentation model for the software testing field separately;

[0037] Then, semantic understanding is performed, i.e. semantic search (SemanticSearch), a search service based on knowledge graphs. Compared with traditional network search engines based on keyword matching, knowledge graph search can support the recognition of users' more colloquial queries (queries, questions); using knowledge graphs to query makes search results and query content more intelligent than simple string matching of traditional search engines. At the same time, the construction of knowledge graphs is derived from the integration and processing of massive data, which also avoids cross-domain problem query deviations. In other words, on the basis of knowledge graphs, various logical algorithms are used to analyze and process natural languages ​​to grasp the key matching knowledge graphs that best match the problem, so as to find the answer.

[0038] Specifically, the step S103 includes:

[0039] The knowledge graph is used as a word segmentation algorithm vocabulary, and a domain word segmentation model based on the knowledge graph is constructed to perform word segmentation understanding on the search terms; based on the word segmentation of the knowledge graph, the user's search terms are segmented and understood to the greatest extent possible;

[0040] Based on the knowledge graph, the intent of the search terms after word segmentation is recognized, the entities in the search terms after word segmentation are recognized, and the knowledge graph is used to perform semantic understanding on the entities in the search terms after word segmentation; based on the entity, concept, and attribute recognition of the knowledge graph, named entity recognition is performed on the user questions after word segmentation, including recognizing the entities, concepts, attributes, and operators in the knowledge graph, and using the knowledge graph to perform semantic disambiguation and semantic expansion on the word segmentation entities in the user questions, and the steps are as follows:

[0041] (1) Word segmentation and entity recognition: First, we need to analyze the user's question, use natural language processing technology to segment the words, and identify the entities in them. These entities include names of people, places, organizations, and time.

[0042] (2) Semantic disambiguation: For the identified entities, the knowledge graph needs to be used for semantic disambiguation. Specifically, the correct semantics of polysemous or ambiguous words are determined by using the contextual information in the knowledge graph and the relationship between entities. For example, for the entity "apple", multiple related entities can be found in the knowledge graph, including the fruit "apple" and the technology company "apple". Therefore, it is necessary to determine which entity "apple" refers to in this question based on the contextual information and the specific content of the question.

[0043] (3) Semantic expansion: For disambiguated entities, the knowledge graph can also be used for semantic expansion, that is, to find other entities or concepts associated with the entity based on the relationship information in the knowledge graph. For example, for the entity "Beijing", the relationship between it and other entities can be found in the knowledge graph, such as "China's capital" and "the second batch of national public cultural service system demonstration areas". Therefore, based on this relationship information, the entity "Beijing" can be semantically expanded to obtain more relevant information.

[0044] (4) Constructing a knowledge graph: Finally, a complete knowledge graph needs to be constructed to support semantic disambiguation and semantic expansion of user questions. Constructing a knowledge graph requires starting from data collection, data cleaning, entity recognition, and relationship extraction to build a high-quality knowledge graph.

[0045] Convert the semantically understood search terms into semi-structured query expressions; i.e. query conversion, converting user questions after semantic understanding and parsing into semi-structured query expressions, such as converting them into a combination of keywords and specific domain retrieval;

[0046] The semi-structured query expression is used to perform a preliminary search to improve the recall rate of the search; in the rough sorting stage, with the goal of improving the recall rate of the search, the semi-structured query expression is used to perform a preliminary search, including keyword similarity calculation and scoring, and model and graph recognition to determine the query of domain results;

[0047] Business aggregation and business classification are performed based on the results of the preliminary search: aggregation operations are performed according to business calculations, and classified navigation services are implemented; according to the specific operations of business calculation aggregation, it is usually necessary to clarify business requirements and data models, and then select appropriate aggregation functions and parameters, and finally implement aggregation operations through programming. The following is a technical solution for implementing classified navigation services:

[0048] (1) Clarify business requirements and data models:

[0049] First, you need to clarify the specific requirements of the classification navigation business, such as what data needs to be aggregated, what the source of the data is, and what results you want to get. Based on these requirements, design a suitable data model to store and organize the data. For example, you need a product table to store detailed product information, a sales table to store the sales record of each product, and an evaluation table to store the evaluation information of each product.

[0050] (2) Choose appropriate aggregation functions and parameters:

[0051] Select the appropriate aggregate function based on business needs. For example, to calculate the sales of each product, you need to use the SUM function; to calculate the average sales of each product, you need to first use the SUM function and then divide it by the sales quantity of the product.

[0052] Common aggregation functions and parameters include sum function (SUM), count function (COUNT), average function (AVG), maximum function (MAX), and minimum function (MIN). In addition to these common aggregation functions, there are some other aggregation functions, such as median, variance, standard deviation, and mode. In specific business, you can choose appropriate aggregation functions and parameters for calculation according to your needs.

[0053] (3) Programming implementation:

[0054] With clear requirements, data models, and aggregation functions, you can start writing code to implement these aggregation operations. This usually requires using a programming language such as Python or Java and using related libraries or frameworks to operate the database.

[0055] For the classification navigation business, some complex operations are involved, such as grouping, sorting, and filtering of large amounts of data, which requires the use of corresponding algorithms and data structures to achieve.

[0056] During the implementation process, you also need to consider how to handle abnormal situations that arise, such as missing or incorrect data.

[0057] (4) Data storage and query:

[0058] For classification navigation business with large amounts of data, some big data processing technologies are also needed, such as distributed databases and data warehouses.

[0059] When querying data, you also need to consider how to optimize the query speed, such as through indexing and partitioning technology.

[0060] (5) Result analysis and visualization:

[0061] Finally, the results of the computational aggregation are analyzed to discover the inherent laws and trends of the data, which involves some data mining and machine learning techniques, such as clustering, classification, and association rules.

[0062] The analysis results can also be displayed intuitively through data visualization techniques, such as charts and dashboards, to help with understanding and decision-making.

[0063] Adjust the weight of the business according to the weighted features reflected by business aggregation and classification, sort the results of the preliminary search through a sorting algorithm, and obtain the search results. In the refined sorting stage, sort and return the returned results according to the weighted features of the business, and cache them in the memory database; follow the steps below:

[0064] (1) Extracting business weighted features: First, we need to extract weighted features from business logic and data. These features include product sales, inventory, and evaluation ratings, and each feature has a corresponding weight.

[0065] (2) Define sorting rules: After you have weighted features, you need to define sorting rules. These rules include total weight and average weight. For example, you can sort in descending order based on total sales, or in ascending order based on average sales.

[0066] (3) Execute sorting: After defining the sorting rules, the system will sort all products according to the rules. This can be achieved through various sorting algorithms, such as quick sort and merge sort.

[0067] (4) Return results: After the sorting is completed, the system will return the sorting results to the user. The returned results include the product list, product ID, and product name.

[0068] (5) Performing Reset: If the user is not satisfied with the current result, he or she can select the “Reset” operation and re-perform the sorting. This usually retains the last sorting result, adjusts the weight or rule based on the user’s feedback, and then re-sorts.

[0069] (6) Continuous iteration: Through repeated sorting and replacement, users can continuously adjust weights and rules until satisfactory results are obtained.

[0070] When adjusting the weight of a business according to the business weighting feature, the weighting rules include: using the results of intent recognition, synonyms, the length or position information of the search term, business data, and feedback information from the user search log for weighting. The specific methods are as follows:

[0071] (1) Weighting of intent recognition results: Based on the results of intent recognition, search terms and intent tags are matched, and search terms with intent tags that have a higher degree of match are given a higher weight.

[0072] (2) Synonym weighting: Using the synonym library, the search terms are expanded into synonyms and the weight of the synonyms is appropriately reduced. However, the higher the similarity with the original search terms, the higher the weight.

[0073] (3) Weighting of search term length: Generally speaking, longer search terms contain more specific and detailed information. Therefore, the length of the search term can be used as a weighting factor. The longer the search term, the higher the weight.

[0074] (4) Weighting of search term position information: If a search term appears in a specific position, such as in a title, the search term can be considered more important, and thus can be weighted according to the search term's position information.

[0075] (5) Business data weighting: Business data, such as product sales, page views, and reviews, can be used as a weighting factor. The better the business data performance of a product or content, the higher its weight.

[0076] (6) Weighting of user search log feedback information: Utilize the feedback information of user search logs, such as the search terms clicked by users and the products browsed by users, and use the user feedback information as a weighting factor. The more search terms, products or content users feedback, the higher the weight.

[0077] The step of sorting the results of the preliminary search by a sorting algorithm includes:

[0078] The preliminary search results are sorted by the BM25 algorithm, and the search term attribute domain is adjusted after intent recognition to generate a document matching candidate set. The intelligent search engine based on the knowledge graph includes multiple sorting algorithms such as TF-IDF, BM25, DFR, Okapi BM25, PageRank, HITS, SALSA, and MetroMap. It also supports users to modify the parameters of the sorting algorithm to achieve personalized search applications. The main sorting algorithm includes the BM25 sorting algorithm.

[0079] After determining the candidate set of document matches, the ranking score of each element is obtained according to the ranking rule, and the search results are obtained based on the ranking score.

[0080] The generating of the document matching candidate set includes:

[0081] According to the search terms, the score score (D, Q) corresponding to the result set of document matching is determined as follows:

[0082]

[0083] Where n is the total number of documents, f(q i ,D) is the word qi The word frequency in the document. Here, a single word is 1 after deduplication. |D| is the number of words in the document. avgd1 is the average number of words in all documents. k1 is an empirical parameter. b is an adjustment parameter. When b is 0, the effect of document length is not considered. Experience shows that b=0.75 has a better effect, but it should also be adjusted according to the corresponding scenario. The larger b is, the greater the penalty for document length. The empirical parameter k1 is used to adjust the word frequency. In the extreme case, k1=0, then the second part degenerates to 1, and the word frequency feature fails. It can be proved that the larger k1 is, the greater the effect of word frequency;

[0084] In the BM25 algorithm, parameter b is used to adjust the weights of word frequency and document length. When the b value increases, the impact of document length decreases; when the b value decreases, the impact of document length increases.

[0085] When b=0, the BM25 algorithm degenerates into the TF-IDF weighting method, which only considers the word frequency and does not consider the influence of the document length. In this case, all documents will be treated equally, whether they are long or short documents, as long as the word frequency is the same, their weights will be the same. This is obviously unreasonable, because in actual search scenarios, the probability of a word appearing in a long document is usually higher than that in a short document.

[0086] When b=1, the influence of document length will be fully considered. In this case, the BM25 algorithm degenerates into a simple document length weighting method. In this case, the weight of long documents will be higher than that of short documents, but this weighting method cannot reflect actual needs. This is because in a short document set, a word will appear repeatedly many times, causing its weight to be overestimated.

[0087] Therefore, in experience, when b = about 0.75, we can consider the weight of document length while considering word frequency, which can better reflect the user's search intent and the relevance of the document. This is why in practice, a b value of about 0.75 is considered a better choice.

[0088] However, "better results" are relative to specific applications and data sets. For certain tasks or data sets, there is an optimal b value. This needs to be determined through cross-validation or other forms of model adjustment.

[0089] The inverse document frequency IDF(q i ):

[0090]

[0091] Among them, n(q i ) is a string containing the word q iThe number of documents; inverse document frequency IDF(q i ) is a measure of the general importance of a word. Its size is inversely proportional to the commonness of a word. It is calculated by dividing the total number of documents in the corpus by the number of documents in the corpus that contain the word, and then taking the logarithm of the quotient;

[0092] According to the scores of all result sets that match the document, select the document matching candidate set from all result sets.

[0093] After determining the document matching candidate set, obtaining the ranking score of each element according to the ranking rule, and obtaining the search result according to the ranking score, includes:

[0094] The document matching candidate set is scored according to the following sorting rules:

[0095] score=c*BM25+d*x+e*y+f*z+g*w+…

[0096] Among them, BM25, x, and y represent business rules respectively, and c, d, and e represent the impact weights of the scenarios in which each business rule is located. BM25, x, and y are dynamically configured through the search operation system, and the values ​​of c, d, and e are adjusted according to the business. In the later stage, machine learning is performed in combination with search logs.

[0097] All document matching candidate sets are sorted according to their scores, and the document matching candidate set corresponding to the highest score is used as the search result. Based on the BM25 search model, the boost is first adjusted through intent recognition. After the candidate set is determined, the ranking score of each element is obtained according to the rule score = c*BM25+d*x+e*y+f*z+g*w+…, and the ranking result is updated according to the ranking score.

[0098] Step S104: Output the interrelated test case data corresponding to the search results as recommendation results. Since the search results include at least one set of interrelated test data, when outputting and displaying to the user in the form of a list or chart, all interrelated test case data corresponding to the search results are returned to the user as recommendation results.

[0099] Furthermore, historical test information retrieval is performed based on the configuration item software name, identification and evaluation organization, test level, document name, document type, test item name, test case name, test input, and test step conditions. Historical test information retrieval usually uses database retrieval, data mining and machine learning, text mining, and data visualization technology. The main function of historical test information retrieval is to provide insights into past test activities in order to better understand the performance, reliability, security, and user experience of the system or product. This information can help the team understand the current status of the product or system, discover potential problems and opportunities, and provide valuable feedback for future product or system development. In addition, historical test information can also be used to measure the integrity and stability of the test, as well as to evaluate and improve the effectiveness and coverage of test cases.

[0100] The knowledge graph-based similarity algorithm compares the test cases provided by users in the existing software testing data through a similarity calculation model, and recommends similar use cases to users based on the test information elements, including configuration item software name, identification and evaluation agency, test level, document name, document type, test item name, test case name, test input, and test steps.

[0101] The specific value of the similarity Sim(A,B) depends on the similarity calculation method used. In the field of software testing, similarity is usually determined based on the degree of similarity between two use cases. Generally speaking, when the similarity Sim(A,B) between two use cases reaches a high value (for example, 0.8 or higher), they can be defined as similar use cases.

[0102] The calculation method of similarity Sim(A,B) varies depending on different testing frameworks or organizations. Some organizations use custom similarity calculation methods, while some frameworks provide built-in similarity calculation functions. Therefore, the specific similarity threshold will vary and needs to be determined based on the framework or organization used.

[0103] In summary, when the similarity Sim(A, B) between two use cases reaches a high value, they can be considered to be similar use cases with similar functions or behaviors.

[0104] This solution provides a similarity calculation model based on the software testing knowledge graph, which mainly uses the information elements established in the graph, such as configuration item software name, identification and evaluation agency, test level, document name, document type, test item name, and test case name as similarity calculation features.

[0105] Wherein, the case retrieval for the search term based on the knowledge graph includes:

[0106] The concept to which the entity in the knowledge graph belongs is used as a similarity calculation feature, and the similarity Sim(A, B) between entity A and entity B is determined as follows:

[0107]

[0108] Among them, A0 and B0 respectively represent the types of concepts to which entities A and B belong in the knowledge graph, Ar and Br respectively represent the value of the rth numerical attribute under the concept to which entities A and B belong in the knowledge graph, Aj and Bj respectively represent the value of the jth object attribute under the concept to which entities A and B belong in the knowledge graph, s and m respectively represent the number of numerical attributes and the number of object attributes under the concept to which the entity belongs in the knowledge graph, u, v, and w respectively represent the type of concept to which the entity belongs in the knowledge graph, the numerical attributes under the concept, and the weight values ​​of the object attributes under the concept in the similarity calculation, u+v+w=1.

[0109] The weights u, v, and w can be set according to different similarity calculation tasks and data characteristics. The following is the value setting method and principle:

[0110] (1) According to the importance of attribute types: weights can be assigned according to the relative importance of attribute types. For example, concept types (A0, B0) are more important and can be given higher weights; numerical attributes (Ar, Br) and object attributes (Aj, Bj) are relatively unimportant and can be given lower weights.

[0111] (2) Based on the commonness of attributes: weights can be assigned based on the commonness of different attributes in the knowledge graph. For example, if concept types (A0, B0) are more common, they can be given lower weights; numerical attributes (Ar, Br) and object attributes (Aj, Bj) are relatively rare and can be given higher weights.

[0112] (3) Based on the stability of attributes: weights can be assigned based on the stability of different attributes. For example, if the concept type (A0, B0) is relatively stable, it can be given a lower weight; if the numerical attribute (Ar, Br) and the object attribute (Aj, Bj) are relatively unstable, they can be given a higher weight.

[0113] (4) Based on the predictability of the attributes: weights can be assigned based on the predictability of different attributes. For example, if the concept type (A0, B0) is more difficult to predict, it can be given a higher weight; the numerical attributes (Ar, Br) and object attributes (Aj, Bj) are easier to predict and can be given a lower weight.

[0114] Specifically, the weights can be assigned in the following ways:

[0115] (1) Setting fixed weight values: You can set fixed weight values, such as u = 0.3, v = 0.3, w = 0.4. This method is relatively simple and easy to use, but it is not suitable for all similarity calculation tasks.

[0116] (2) Cluster analysis: Cluster analysis can be used to divide attributes into different clusters, and then weights are assigned based on the characteristics of the attributes in each cluster. For example, concept types can be used as one cluster, and numerical attributes and object attributes can be used as another cluster. Then weights are assigned based on the characteristics of the attributes in each cluster.

[0117] (3) Machine learning algorithm: Machine learning algorithms can be used to automatically determine weights. For example, a gradient descent algorithm can be used to train a model, and the weights can be adjusted based on the accuracy of the model's predictions to achieve the best similarity calculation effect.

[0118] Different similarity calculation tasks and data characteristics require different weight allocation methods. Therefore, in practical applications, it is necessary to select and adjust according to the specific situation.

[0119] From the above description, it can be seen that the present invention achieves the following technical effects:

[0120] Compared with the simple string matching of traditional search engines, the query using the knowledge graph makes the search results and query content more intelligent. At the same time, the construction of the knowledge graph is derived from the integration and processing of massive data, which also avoids the deviation of cross-domain problem query. In other words, based on the knowledge graph, various logical algorithms are used to analyze and process natural language to grasp the key matching knowledge graph that best fits the problem, so as to find the answer.

[0121] In the embodiment of the present invention, a deeper analysis is conducted to fully explore the value of the test case text, and the automatic classification of the entire software testing process is completed; further based on text matching and information extraction technology, the interpretability of test case compilation is improved, and the fusion application of heterogeneous data is realized; finally, based on theoretical research and actual project development, the corresponding software system is developed to improve the intelligent level of test case compilation;

[0122] Based on software, test items, test case features and related historical test cases, through deep learning, knowledge graphs, natural language processing artificial intelligence technology, we can achieve intelligent test case recommendation and shared reuse functions to improve the level of software test case design.

[0123] The embodiment of the present invention also provides a system for sharing and reusing software test cases based on knowledge graphs for implementing the above-mentioned software test case sharing and reuse method based on knowledge graphs, such as Figure 3 As shown, the device comprises:

[0124] A construction unit 31 is used to construct a test case knowledge graph based on software test related knowledge, wherein the software test related knowledge includes interrelated software test data;

[0125] A receiving unit 32, used for receiving an input test case question search term;

[0126] A semantic understanding search unit 33, configured to perform a semantic understanding search on the search term based on the knowledge graph to obtain search results corresponding to the search term;

[0127] The output unit 34 is used to output the interrelated test case data corresponding to the search results as recommendation results.

[0128] The present invention can be applied to various software testing projects, including functional testing, performance testing, and security testing. This application scenario can improve software testing efficiency and quality, reduce testing costs and risks, and can also be applied to different software testing scenarios and requirements, such as Web application testing, mobile application testing, and embedded system testing.

[0129] The present invention supports multi-platform testing including Windows, Linux, Android, and iOS, as well as multiple test environments and configurations. It can be integrated with other test tools and test processes, such as continuous integration and automated deployment, and adapt to different software test development methods, such as agile development, iterative development, and waterfall model.

[0130] The present invention provides software testers with a more convenient and efficient testing method and tool, which can realize various types of automated testing, such as UI automated testing, API automated testing, and performance automated testing. At the same time, data-driven testing, keyword-driven testing, and modular testing can be performed during the testing process, thereby improving the reusability and maintainability of test cases, supporting manual testing and hybrid testing, and improving the quality and efficiency of software testing.

[0131] The present invention can provide highly customizable and flexible testing processes and tools to meet the customization requirements for various application scenarios, provide the testing team with better test management and tracking capabilities, including test case management, defect management, and test progress tracking, and provide the software development team with more test feedback and quality assurance.

[0132] It can be seen that the present invention realizes the sharing and reuse of test cases by utilizing the software testing knowledge graph, improves the testing efficiency and quality, and reduces duplication of work and testing costs. At the same time, the present invention has high practicality and versatility and can be applied to different software testing scenarios and projects.

[0133] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the technical principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A software test case sharing and reuse method based on semantic understanding search, characterized in that: The following steps are involved: Step S101: construct a test case knowledge graph according to configuration item software, test items, and test cases; Step S102: receiving input software test related search terms; wherein the search terms include any one or more of configuration item software name, identification and evaluation organization, test level, document name, document type, test item name, test case name, test purpose, test environment, test data, and test result; Step S103: performing a semantic understanding search on the search term based on the knowledge graph to obtain search results corresponding to the search term; during the search process, performing semantic understanding on the search term, and performing reasoning analysis on the search term based on the association between various entities in the knowledge graph; Step S104: output the interrelated test case data corresponding to the search results as recommendation results.

2. The method according to claim 1, characterized in that The configuration item software, test items, and test cases include interrelated test data; a knowledge graph global knowledge classification system is constructed based on the configuration item software, test items, and test case modeling, knowledge is extracted from data of different sources and structures, and the formed knowledge is stored in the knowledge graph; In the software test case data with specific format content, entity extraction, association annotation, concept disambiguation, data preprocessing, and text mining are performed to build a test case knowledge graph from the perspectives of test methods, evaluation agencies, selection of testers, test objectives, test types, test environments, and test data.

3. The method according to claim 1, characterized in that Step S101 is specifically as follows: Based on software test cases, define the entities, attributes of entities, and relationships between entities in the software testing knowledge graph; perform ontology modeling to define the entity types and basic attributes of each entity in the knowledge graph, including defining the data model in the knowledge graph based on the provided data and application requirements, and clarifying the entities, relationships, and attributes of each entity and relationship in the graph; specifically including: (1) analyzing existing test cases and execution processes to build a conceptual system for the software testing field; (2) defining the basic attributes of the tested software, test items, test cases, evaluation organizations, and test personnel entities in the software testing graph scenario; (3) defining the relationships between the tested software, test items, test cases, evaluation organizations, and test personnel entities in the software testing scenario; Extract defined entities, entity attributes and relationships between entities from the software test cases, and fuse the extracted knowledge under the same framework specification, and integrate the fused knowledge into the knowledge graph; the extracted knowledge includes defined entities, entity attributes and relationships between entities extracted from the test cases; perform knowledge extraction and fusion in sequence, that is, after obtaining software test related data and completing ontology modeling through multiple channels, obtain entity, relationship and entity attribute information from existing unstructured and semi-structured data through knowledge extraction technology according to the entities and relationships defined in the ontology modeling step; in addition, after the knowledge extraction work is completed, knowledge from different knowledge sources is fused to perform heterogeneous data integration, redundancy removal, disambiguation, processing, reasoning verification and updating steps under the same framework specification to form a knowledge base; Knowledge extraction and fusion specifically include: (1) Knowledge extraction: extracting entities, attributes, and relationships between entities defined in ontology modeling from different data sources; ① Entity extraction: by adding a software testing domain dictionary, it is implemented using the Bi-LSTM+CRF model; ② Attribute extraction: similar to entity extraction, by adding a software testing domain dictionary, it is implemented using the Bi-LSTM+CRF model; ③ Relationship extraction: using the remote supervision method, extracting entity pairs with relationships, and then extracting sentences containing entity pairs from unstructured text as training examples to train the relationship extractor; (2) Knowledge fusion: knowledge extracted from multiple data sources is integrated into the knowledge graph; The extracted knowledge is connected to a relational database, and the tables in the structured data of the relational database are mapped into entities and attributes of the entities in the knowledge graph; wherein the mapping is a D2R mapping, the data in the relational database is converted into semantic data in the form of RDF triples, a set of mapping specifications from the relational database to the semantic data is formulated, and described in XML language, namely D2RML; the key to knowledge mapping of structured data is to fully understand the basic structure in the structured data, including the meaning of each table and the relationship between the tables, as well as the structure of the knowledge graph, and use D2RML to associate the tables in the structured data with the concepts or entities in the knowledge graph; the knowledge extraction service connects to the target database in the mapping file, reads the data in the corresponding table, maps the table and column data in the relational database into conceptual entities and attributes of the entities respectively, and then stores the knowledge obtained from these mappings in the software test case knowledge graph.

4. The method according to claim 1, characterized in that In step S103, the semantic understanding search method based on the knowledge graph adopts the word segmentation technology based on the knowledge graph intention recognition and is implemented based on the sorting strategy of the knowledge graph.

5. The method according to claim 4, characterized in that Step S103 is specifically as follows: Using the knowledge graph as a word segmentation algorithm thesaurus, constructing a domain word segmentation model based on the knowledge graph, and performing word segmentation understanding on the search terms; performing word segmentation understanding on the user's search terms based on the word segmentation of the knowledge graph; Based on the knowledge graph, the intent of the search terms after word segmentation is recognized, the entities in the search terms after word segmentation are recognized, and the knowledge graph is used to perform semantic understanding on the entities in the search terms after word segmentation; based on the entity, concept, and attribute recognition of the knowledge graph, named entity recognition is performed on the user questions after word segmentation, including recognizing the entities, concepts, attributes, and operators in the knowledge graph, and using the knowledge graph to perform semantic disambiguation and semantic expansion on the word segmentation entities in the user questions, and the steps are as follows: (1) Word segmentation and entity recognition: First, analyze the user's question, use natural language processing technology to segment the words, and identify the entities in them; (2) Semantic disambiguation: For the identified entities, the knowledge graph is used to perform semantic disambiguation, that is, the correct semantics of polysemous or ambiguous words are determined by using the contextual information in the knowledge graph and the relationship between entities; (3) Semantic expansion: For disambiguated entities, the knowledge graph is used to perform semantic expansion, that is, to find other entities or concepts associated with the entity based on the relationship information in the knowledge graph; Convert the semantically understood search terms into semi-structured query expressions; that is, convert the user questions after semantic understanding and analysis into semi-structured query expressions; performing a preliminary search using the semi-structured query expression; In the rough sorting stage, the semi-structured query expression is used to perform preliminary retrieval, including keyword similarity calculation and scoring, and graph recognition to determine the query domain results; Business aggregation and business classification are performed based on the results of the preliminary search: aggregation operations are performed according to business calculations, and classified navigation business is implemented; business requirements and data models are clarified according to the specific operations of business calculation aggregation, and then aggregation functions and parameters are selected, and finally aggregation operations are implemented through programming; The weight of the business is adjusted according to the weighted characteristics reflected by business aggregation and classification, and the results of the preliminary search are sorted through a sorting algorithm to obtain search results.

6. The method according to claim 4, characterized in that In step 103, when the weight of the service is adjusted according to the service weighting feature, the weighting rules include: weighting using the result of intent recognition, synonyms, length or position information of the search term, service data, and feedback information of the user search log, and the specific methods include: (1) Weighting of intent recognition results: Based on the results of intent recognition, search terms and intent tags are matched, and search terms with intent tags that have a higher degree of matching are given a higher weight; (2) Synonym weighting: Using the synonym database, search terms are expanded into synonyms, and the weight of synonyms is reduced. The higher the similarity with the original search term, the higher the weight; (3) Search term length weighting: The length of the search term is used as a weighting factor. The longer the search term, the higher the weight. (4) Search word position information weighting: weighting is performed based on the search word position information; (5) Business data weighting: using business data as a weighting factor; (6) Weighting of user search log feedback information: The feedback information of the user search log is used as a weighting factor.

7. The method according to claim 4, characterized in that In step 103, the step of sorting the preliminary search results by a sorting algorithm includes: The results of the preliminary search are sorted by the BM25 algorithm, and the search term attribute domain is adjusted after intent recognition to generate a document matching candidate set. After the document matching candidate set is determined, the sorting score of each element is obtained according to the sorting rules, and the search results are obtained based on the sorting score. The generating of the document matching candidate set includes: According to the search terms, the score score (D, Q) corresponding to the result set of document matching is determined as follows: Where n is the total number of documents, f(q i ,D) is the word q i The word frequency in the document. Here, a single word is 1 after deduplication. |D| is the number of words in the document. avgd1 is the average number of words in all documents. k1 is an empirical parameter. b is an adjustment parameter. When b is 0, the influence of document length is not considered. The larger b is, the greater the penalty for document length. The empirical parameter k1 is used to adjust the word frequency. In the extreme case, k1=0, then the second part degenerates to 1, that is, the word frequency feature fails. The larger k1 is, the greater the effect of word frequency. In the BM25 ranking algorithm, parameter b is used to adjust the weights of word frequency and document length. When the b value increases, the influence of document length decreases; and when the b value decreases, the influence of document length increases. According to the scores of all result sets that match the document, select the document matching candidate set from all result sets.

8. The method according to claim 7, characterized in that b=0.75。 9. The method according to claim 7, characterized in that Step S103, after determining the document matching candidate set, obtaining a ranking score for each element according to the ranking rule, and obtaining search results according to the ranking score, includes: The document matching candidate set is scored according to the following sorting rules: score=c*BM25+d*x+e*y+f*z+g*w+… Among them, BM25, x, and y represent business rules respectively, and c, d, and e represent the impact weights of the scenarios in which each business rule is located. BM25, x, and y are dynamically configured through the search operation system, and the values ​​of c, d, and e are adjusted according to the business. In the later stage, machine learning is performed in combination with search logs. All document matching candidate sets are sorted according to their scores, and the document matching candidate set corresponding to the highest score is used as the search result; based on the BM25 search model, the boost is first adjusted through intent recognition. After the candidate set is determined, the ranking score of each element is obtained according to the rule score = c*BM25+d*x+e*y+f*z+g*w+…, and the ranking result is updated according to the ranking score.

10. A system for use in the method according to any one of claims 1 to 9, characterized in that: The system includes: A construction unit, configured to construct a test case knowledge graph based on software testing related knowledge, wherein the software testing related knowledge includes interrelated software testing data; A receiving unit, used for receiving an input test case question search term; A semantic understanding search unit, configured to perform a semantic understanding search on the search term based on the knowledge graph to obtain search results corresponding to the search term; The output unit is used to output the interrelated test case data corresponding to the search results as recommendation results.

Citation Information

Cited By

  • Automatic management method, system and equipment for reuse of test cases and medium

    CN120849301A

  • Test method and test system for railway signal safety system software

    CN121116837A

  • Method, system and equipment for extracting chapter-level knowledge for long text and medium

    CN122174957A