Southbound gateway detection method, device, equipment and medium
Patent Information
- Application Number
- CN202211153933.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-21
- Publication Date
- 2026-09-22
- Estimated Expiration
- 2042-09-21
AI Technical Summary
[0005]本公开提供一种南向网关检测方法、装置、设备及介质,至少在一定程度上克服相关技术中南向网关的复杂度检测难度高的问题
[0023]本公开的实施例所提供的一种南向网关检测方法、装置、设备及介质,提取南向网关的多个单元测试用例中测试用例描述文本,并从中筛选与目标用例描述文本相似的测试用例描述文本,将相似测试用例描述文本中语义相同的测试用例描述文本聚为一类,根据聚类后的相似测试用例描述文本的数量,从而方便、快速的确定南向网关的复杂度,以及各个南向网关单元测试用例的场景覆盖率,判断单元测试用例是否合格,有效识别南向网关的复杂度,保证南向网关的质量。
Smart Images

Figure CN115481031B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and in particular to a southbound gateway detection method, apparatus, electronic device, and computer-readable storage medium. Background Technology
[0002] In a layered architecture driven by domain-driven design, the infrastructure layer is the outermost layer, and the domain layer is the innermost layer. The domain layer is the core layer of the architecture, and the application layer is located between the domain layer and the infrastructure layer. Based on the direction of invocation, if the call is from the outside in, it is called a northbound gateway; if the current bounded context calls external resources or other bounded contexts through the gateway (i.e., from the inside out), it is called a southbound gateway.
[0003] Southbound gateways serve as channels connecting the application layer with external resources, or the domain layer with external resources; therefore, it is necessary to identify the complexity of southbound gateways. However, currently, detecting the complexity of southbound gateways is quite difficult.
[0004] It should be noted that the information disclosed in the background section above is only used to enhance the understanding of the background of this disclosure, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention
[0005] This disclosure provides a method, apparatus, device, and medium for detecting southbound gateways, which at least to some extent overcomes the problem of high difficulty in detecting the complexity of southbound gateways in related technologies.
[0006] Other features and advantages of this disclosure will become apparent from the following detailed description, or may be learned in part from practice of this disclosure.
[0007] According to one aspect of this disclosure, a southbound gateway detection method is provided, comprising: extracting test case description text from multiple unit test cases of a southbound gateway to form a test case description text set; filtering test case description texts similar to target test case description text from the test case description text set to form a similar test case description text set; clustering semantically identical test case description texts in the similar test case description text set into one category to obtain the number of test case description texts in the clustered similar test case description text set; and determining the complexity of the southbound gateway corresponding to the target test case description text based on the number of test case description texts in the clustered similar test case description text set.
[0008] In one embodiment of this disclosure, the step of filtering test case description texts similar to the target test case description text from the test case description text set to form a similar test case description text set includes: using a single token of the target test case description text as the key, and using the text ID and text content of the test case description texts in the test case description text set as the value for matching; and matching test case description texts containing the same token in the test case description text set to the similar test case description text set.
[0009] In one embodiment of this disclosure, the method further includes: calculating the text similarity of test case description text pairs within the set of similar test case description texts; and outputting a first test case description text and a second test case description text whose text similarity exceeds a first similarity threshold, wherein the first test case description text and the second test case description text are test case description text pairs within the set of similar test case description texts.
[0010] In one embodiment of this disclosure, calculating the text similarity of test case description text pairs within the set of similar test case description texts includes: performing word segmentation on the test case description text pairs to obtain the lexical intersection and lexical union of the test case description text pairs; and calculating the text similarity of the test case description text pairs based on the lexical intersection and lexical union.
[0011] In one embodiment of this disclosure, the step of clustering semantically identical test case description texts in a set of similar test case description texts into one class to obtain the number of test case description texts in the set of similar test case description texts after clustering includes: calculating the semantic similarity between the first test case description text and the second test case description text; and clustering the first test case description text and the second test case description text with a semantic similarity exceeding a second similarity threshold into one class.
[0012] In one embodiment of this disclosure, calculating the semantic similarity between the first test case description text and the second test case description text includes: performing word segmentation on the first test case description text pair to obtain a first word segmentation set of the first test case description text; performing word segmentation on the second test case description text pair to obtain a second word segmentation set of the second test case description text; calculating the word segmentation similarity between the first word segmentation set and the second word segmentation set; and normalizing the calculated word segmentation similarity to obtain the semantic similarity between the first test case description text and the second test case description text.
[0013] In one embodiment of this disclosure, the method further includes: obtaining a first word segmentation vector of the first test case description text; obtaining a second word segmentation vector of the second test case description text; calculating the word distance between the first test case description text and the second test case description text based on the first word segmentation vector and the second word segmentation vector; and correcting the semantic similarity between the first test case description text and the second test case description text based on the word distance.
[0014] In one embodiment of this disclosure, determining the complexity of the southbound gateway corresponding to the target test case description text based on the number of test case description texts in the clustered similar test case description text set includes: determining whether the number of test case description texts in the clustered similar test case description text set is greater than or equal to a first preset threshold; if so, determining that the test scenario of the southbound gateway meets the test requirements.
[0015] In one embodiment of this disclosure, the method further includes: if the number of test case description texts in the clustered similar test case description text set is less than a first preset threshold, then it is determined that the unit test case test scenarios of the southbound gateway are insufficient.
[0016] In one embodiment of this disclosure, the method further includes: determining whether the number of test case description texts in the clustered similar test case description text set is greater than a second preset threshold, wherein the second preset threshold is greater than a first preset threshold; if the condition is met, then the southbound gateway is determined to have complexity.
[0017] In one embodiment of this disclosure, the test case description text includes a test function description text and a test result description text, wherein the test function description text is used to distinguish different test methods; and the test result description text is used to distinguish different test results under the same test method.
[0018] In one embodiment of this disclosure, the target use case description text is a test case description text in the test case description text set; or, the target use case description text is a pre-defined text.
[0019] In one embodiment of this disclosure, the method further includes: preprocessing multiple test case description texts in the test case description text set.
[0020] According to another aspect of this disclosure, a southbound gateway detection device is provided, comprising: a text extraction module for extracting test case description text from multiple unit test cases of a southbound gateway to form a test case description text set; a text filtering module for filtering test case description texts similar to a target test case description text from the test case description text set to form a similar test case description text set; a text clustering module for clustering semantically identical test case description texts in the similar test case description text set into one category to obtain the number of test case description texts in the clustered similar test case description text set; and a complexity determination module for determining the complexity of the southbound gateway corresponding to the target test case description text based on the number of test case description texts in the clustered similar test case description text set.
[0021] According to another aspect of this disclosure, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform the aforementioned southbound gateway detection method by executing the executable instructions.
[0022] According to another aspect of this disclosure, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the southbound gateway detection method described above.
[0023] The embodiments of this disclosure provide a southbound gateway detection method, apparatus, device, and medium. This method extracts test case description text from multiple unit test cases of a southbound gateway, filters out test case description text similar to the target test case description text, clusters semantically identical test case description texts into a single category, and determines the complexity of the southbound gateway and the scenario coverage of each southbound gateway unit test case based on the number of clustered similar test case description texts. This allows for the assessment of whether the unit test cases are qualified, effectively identifying the complexity of the southbound gateway and ensuring its quality.
[0024] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0025] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure. It is obvious that the drawings described below are merely some embodiments of this disclosure, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort.
[0026] Figure 1This diagram illustrates a flowchart of a southbound gateway detection method provided in an embodiment of this disclosure.
[0027] Figure 2 This diagram illustrates another southbound gateway detection method provided in an embodiment of the present disclosure.
[0028] Figure 3 This diagram illustrates a flowchart illustrating the output of similar test case text pairs provided in embodiments of this disclosure;
[0029] Figure 4 This diagram illustrates a flowchart of yet another southbound gateway detection method provided in this embodiment of the present disclosure;
[0030] Figure 5 This diagram illustrates the calculation of semantic similarity between similar test case text pairs provided in an embodiment of this disclosure.
[0031] Figure 6 This diagram illustrates a flowchart of yet another southbound gateway detection method provided in an embodiment of this disclosure;
[0032] Figure 7 A schematic diagram of the southbound gateway detection method provided in this embodiment of the present disclosure is shown.
[0033] Figure 8 This diagram illustrates a southbound gateway detection device provided in an embodiment of the present disclosure.
[0034] Figure 9 This diagram illustrates a system architecture for implementing southbound gateway detection according to an embodiment of this disclosure.
[0035] Figure 10 A structural block diagram of an electronic device provided in an embodiment of this disclosure is shown. Detailed Implementation
[0036] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, they are provided so that this disclosure will be more comprehensive and complete, and will fully convey the concept of the exemplary embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
[0037] Furthermore, the accompanying drawings are merely illustrative of this disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and therefore repeated descriptions of them will be omitted. Some block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.
[0038] When a southbound gateway calls a third-party service, the caller is unaware of its internal implementation and complexity. During the integration process, the user determines the internal complexity of the southbound gateway based on the return values of the unit test cases.
[0039] The main purpose of unit testing is to verify the functionality of the code and its ability to handle exceptions. This disclosure uses the JUnit framework and Ant tools to write unit test cases for the southbound gateway, achieving automated testing. For example, using JUnit 5 to write unit test cases allows users to frequently integrate the software, ensuring that existing functionalities are not broken, and automatically analyzes the state of the existing code, publishing relevant test reports to identify, to some extent, the complexity of the southbound gateway's internal implementation and the scenario coverage of the unit test cases.
[0040] When writing unit test cases using JUnit 5, the @DisplayName annotation is typically used to describe the unit test cases. The description text consists of natural language, and different descriptions may have two meanings: one is the coverage of unit test cases for different scenarios of different southbound gateways; the other is the coverage of unit test cases for different scenarios of the same southbound gateway.
[0041] In one scenario, the test data is as follows:
[0042] class updateOrderRecycle{
[0043] @DisplayName(“Update order recycle bin status returned 200, successful”)
[0044] @Test
[0045] public void testUpdateOrderRecycle_return_200(){
[0046] Test code (omitted)
[0047] }
[0048] class updateOrderRecycle{
[0049] @DisplayName("Update order recycle bin status returned 420, concurrency lock control, please try again later")
[0050] @Test
[0051] public void testUpdateOrderRecycle_return_420(){
[0052] Test code (omitted)
[0053] }
[0054] class updateOrderRecycle{
[0055] @DisplayName("Update order recycle bin status returned 500, internal service error")
[0056] @Test
[0057] public void testUpdateOrderRecycle_return_500(){
[0058] Test code (omitted)
[0059] }
[0060] class updateOrderRecycle{
[0061] @DisplayName(“Update order recycle bin status returned 400, request parameters are abnormal”)
[0062] @Test
[0063] public void testUpdateOrderRecycle_return_400(){
[0064] Test code (omitted)
[0065] }
[0066] class updateOrderRecycle{
[0067] @DisplayName(“Update order recycle bin status return control”)
[0068] @Test
[0069] public void testUpdateOrderRecycle_return_NULL(){
[0070] Test code (omitted)
[0071] }
[0072] The above test data represents the test results of five unit test cases. The description text within the @DisplayName tag of the five unit test cases is different. From the five description texts, it can be seen that the five unit test cases are all test cases targeting the same test method or the same service with different return values, which to some extent indicates that the southbound gateway has a certain degree of complexity.
[0073] In another scenario, the test data is as follows:
[0074] @DisplayName("Query ERP orders: Products containing Shadow Clone: Product code and product code are the same")
[0075] @Test
[0076] public void getErpOrderInfo_Shadow Clone Product_Product Code and Product Code are the Same(){
[0077] Test code (omitted)
[0078] }
[0079] @DisplayName("Query ERP orders: Products containing Shadow Clone: Product code and product code match")
[0080] @Test
[0081] public void getErpOrderInfo_Shadow Clone Product_Product Code and Product Code are Consistent(){
[0082] Test code (omitted)
[0083] }
[0084] The test data above includes two unit test cases. The description text within the @DisplayName tag of the two unit test cases is different, but the semantics are the same. In fact, they are the same unit test cases. In this case, it cannot be concluded that the southbound gateway has a certain degree of complexity, and the southbound gateway also has the risk of insufficient coverage of abnormal scenarios.
[0085] The same description refers to the coverage of unit test cases for the same southbound gateway in the same scenario. In a complex test project, there may be a large number of unit test cases in the test data. In this case, it is crucial to count the number of unit test cases to measure the scenario coverage and to judge the complexity of the southbound gateway.
[0086] Based on this, the technical solution provided in this disclosure extracts test case description text from multiple unit test cases of the southbound gateway, filters out test case description text similar to the target test case description text, clusters semantically identical test case description texts into one category, and determines the complexity of the southbound gateway and the scenario coverage of each southbound gateway unit test case based on the number of clustered similar test case description texts, thereby judging whether the unit test cases are qualified. This effectively reduces the cost of manual inspection, effectively identifies the complexity of the southbound gateway, and ensures the quality of the southbound gateway.
[0087] It should be noted that, unless otherwise specified, the embodiments of the present invention and the technical features thereof can be combined with each other.
[0088] The following detailed description of this exemplary implementation method is provided in conjunction with the accompanying drawings and embodiments.
[0089] First, this disclosure provides a southbound gateway detection method, which can be executed by any system with computing power.
[0090] Figure 1 This invention discloses a flowchart of a southbound gateway detection method according to an embodiment of the present invention, as shown below. Figure 1 As shown in the embodiments of this disclosure, the southbound gateway detection method includes the following steps:
[0091] S102. Extract the test case description text from the test data of multiple unit test cases to form a test case description text set.
[0092] In this embodiment, unit test cases for the southbound gateway are written based on the JUnit framework and Ant tools. The unit test cases and the code under test are stored in the same module, eliminating the need for a separate test module. The code directory is src / main / java.java, and the resource directory is src / main / resources; the unit test case directory is src / test / java, and the resource directory is src / test / resources. It should be noted that the unit test cases and the code under test are stored in different directories within the same package, `packag`.
[0093] Unit test case files are named by adding the suffix "Test" to the file name of the code being tested. For example, if the file name of the code being tested is "com.xx.b2b.xxx.xxx.OrderAuitService", the corresponding unit test case file is named "com.xx.b2b.xxx.xxx.OrderAuitServiceTest".
[0094] In this embodiment, the test case description text is extracted from the unit test case file. In a complex project, the unit test case data includes tests for different southbound gateways, and the number of unit test cases for different southbound gateways varies, meaning that the extracted test case description texts may belong to different southbound gateways.
[0095] It should be noted that the test case description text corresponds to the text in the @DisplayName tag. The test case description text includes test function description text and test result description text. The test function description text is used to distinguish different test methods; the test result description text is used to distinguish different test results under the same test method. Different test methods are distinguished by the test function description text, and thus the southbound gateway is distinguished. The test result description text can be used to characterize the unit test case coverage.
[0096] For example, in the first scenario above, the test case description text for the first unit test case is "Update order recycle bin status returns 200, request successful," where the test function description text is "Update order recycle bin status," and the test result description text is "Returns 200, request successful." In the second scenario above, the test case description text for the first unit test case is "Query ERP orders: Includes clone products," and the test result description text is "Product code and product code are the same."
[0097] Typically, the order of the test case description texts in the test case description text set is consistent with the order of the unit test case test data.
[0098] S104. Select test case description texts that are similar to the target test case description text from the test case description text set to form a similar test case description text set.
[0099] In this embodiment, the target use case description text is used to distinguish the southbound gateway in the unit test case test data. Typically, one target use case description text corresponds to one southbound gateway. By filtering test case description texts that are similar to the target use case description text, unit test cases for testing a southbound gateway can be obtained.
[0100] For example, the target use case description text can be text pre-defined by the user. Typically, the target use case description text can include only the test function description text, or it can include both the test function description text and the test result description text. For example, in the unit test case of the first scenario above, the target use case description text can be set to "Update order recycle bin status"; in the unit test case of the second scenario above, the target use case description text can be set to "Query ERP orders: including clone products".
[0101] For example, the target use case description text can also be the test case description text in the test case description text set. In this case, a test case description text can be selected sequentially from the test case description texts as the target use case description text, or a test case description text can be randomly selected from the test case description texts as the target use case description text. The target use case description text is compared with the remaining test case description texts in the test case description text set, and test case description texts similar to the target use case description text are selected to form a set of similar test case description texts for the target use case description text. At the same time, the selected similar test case description texts for the target use case description text are removed from the test case description text set until all test case description texts in the test case description text set have been selected, thus dividing the set of similar test case description texts corresponding to each target use case description text, that is, distinguishing multiple southbound gateways.
[0102] For example, the first and second scenarios mentioned above are test data for the same unit test case. Table 1 shows the test case description text corresponding to the unit test cases extracted from the test data.
[0103] Table 1
[0104] Unit test case 1 The update to the order recycle bin status returned 200, indicating the request was successful. Unit test case 2 ERP order query: Products containing "Shadow Clone" functionality: Product ID and Item Number are the same. Unit test case 3 The order recycle bin status update returned 420, indicating concurrency lock control; please try again later. Unit test case 4 ERP order query: Products containing "Shadow Clone" functionality: Product ID and product number match. Unit test case 5 The order recycle bin status update returned a 500 error, indicating an internal service exception.
[0105] The test case description text set is P1{{Update order recycle bin status returns 200, request successful},{Query ERP order: includes clone product: product number and product ID are the same},{Update order recycle bin status returns 420, concurrency lock control, please retry later},{Query ERP order: includes clone product: product number and product ID are the same},{Update order recycle bin status returns 500, internal service exception}}. As shown in Table 1, if unit test case 1 is used as the target test case description text, then unit test case 1, unit test case 3, and unit test case 5 are matched to the same set of similar test case description texts; then, if unit test case 2 is used as the target test case description text, then unit test case 2 and unit test case 4 are matched to another set of similar test case description texts.
[0106] S106. Cluster the test case description texts with the same semantics in the similar test case description text set into one class, and obtain the number of test case description texts in the clustered similar test case description text set.
[0107] In this embodiment, if two or more test case description texts in a similar test case description text set are identical or semantically identical, then when calculating the number of test cases for the southbound gateway unit, test case description texts with identical or semantically identical texts are counted as one case.
[0108] For example, unit test case 2 and unit test case 4 mentioned above are semantically identical unit test cases. They are clustered into one class in the set of similar test case description texts. After clustering, the number of test case description texts in the set of similar test case description texts is 1.
[0109] S108. Based on the number of test case description texts in the clustered similar test case description text set, determine the complexity of the southbound gateway corresponding to the target test case description text.
[0110] In this embodiment, the complexity of the southbound gateway is determined by the number of test case description texts in the clustered similar test case description text set. Generally, a large number of test case description texts in the clustered similar test case description text set indicates that the southbound gateway has a certain degree of complexity; a small number of test case description texts in the clustered similar test case description text set indicates that the unit test cases of the southbound gateway are qualified; a very small number of test case description texts in the clustered similar test case description text set indicates that the southbound gateway is simple and may have insufficient scenario coverage.
[0111] The southbound gateway detection method provided in this disclosure extracts test case description text from multiple unit test cases of the southbound gateway, filters out test case description text similar to the target test case description text, clusters semantically identical test case description texts into one category, and determines the complexity of the southbound gateway and the scenario coverage of each southbound gateway unit test case based on the number of similar test case description texts after clustering. This method effectively reduces the cost of manual inspection, effectively identifies the complexity of the southbound gateway, and ensures the quality of the southbound gateway.
[0112] In one embodiment, step S104 filters test case description texts similar to the target test case description text from the test case description text set to form a similar test case description text set, including:
[0113] Match the target use case description text with a single token as the key and the test case description text ID and text content in the test case description text set as the value.
[0114] Match test case description texts containing the same token to similar test case description text sets.
[0115] Based on the idea of naiveté, similar or identical sentences share certain commonalities in their composition. If only the semantics of words are considered, the semantic information contained in the syntax will be lost. This disclosure uses the ppJoin algorithm to filter test case description texts similar to the target test case description text. The ppJoin algorithm is a fast algorithm for filtering similar text based on character matching. It can accept a set of strings and output string pairs whose text similarity exceeds a threshold.
[0116] In this embodiment, during the MAP phase of the ppJoin algorithm based on string matching, a single token of the target test case description text is used as the key, where the token can be a character, word, or Ngram. The text ID and text content of the test case description texts in the test case description text set are used as the value for mapping. In this way, texts containing the same token are mapped to the same set of similar test case description texts. In other words, from a textual perspective, test case description texts similar to the target test case description text are mapped to the same node (the set of similar test case description texts), or texts with a text similarity greater than 0 between the target test case description text and the test case description text are mapped to the same node.
[0117] For example, in Table 1, the target use case description text is unit test case 1 {Update order recycle bin status returns 200, request successful}. The token can be update, order, recycle bin, status, return, etc. Taking the token as update, we can traverse unit test cases 2 to 5 in the test case description text set in turn. We can find that unit test cases 1, 3 and 5 contain the same token and are mapped to the same similar test case description text set.
[0118] Figure 2 This diagram illustrates another southbound gateway detection method provided in an embodiment of the present disclosure. Figure 1 Based on the embodiment, steps S202 and S204 are added between steps S104 and S106 to identify pairs of similar test case description texts in the set of similar test case description texts that may have the same semantics. For example... Figure 2 As shown, in this embodiment, the method includes steps S102-S104, steps S202-S204, and steps S106-S108, wherein,
[0119] S202. Calculate the text similarity of test case description text pairs within the set of similar test case description texts;
[0120] S204. Output the first test case description text and the second test case description text whose text similarity exceeds the first similarity threshold, wherein the first test case description text and the second test case description text are test case description text pairs within the set of similar test case description texts.
[0121] It should be noted that steps S102-S108 are implemented in the same way as in the aforementioned embodiments, and will not be described again here.
[0122] In this embodiment, the text similarity of the test case description text pairs is calculated by segmenting the text into words and then using the Jaccard algorithm. Intuitively, the more common parts two sentences have, the more co-occurring words there are, and the higher the text similarity between the two sentences. The proportion of co-occurring words relative to all words in the two sentences can numerically reflect the text similarity between the two sentences.
[0123] The first similarity threshold can be preset, and the size of the first similarity threshold can be set according to the actual situation. This application does not make any specific limitations.
[0124] Figure 3 A flowchart illustrating the output of similar test case text pairs provided in an embodiment of this disclosure is shown. In this embodiment, in Figure 2 Based on the embodiment, step S202 is further refined into S302-S308, such as... Figure 3 As shown, the method includes:
[0125] S302. Perform word segmentation on the test case description text pairs to obtain the lexical intersection and lexical union of the test case description text pairs;
[0126] S304. Calculate the text similarity of test case description text pairs based on lexical intersection and lexical union;
[0127] S306. Determine whether the text similarity exceeds the first similarity threshold. If it does, proceed to step S204; if it does not, proceed to step S308.
[0128] S308. This test case describes text pairs with different semantics, so clustering is not required.
[0129] It should be noted that step S204 is implemented in the same way as in the above embodiment, and will not be described again here.
[0130] In this embodiment, a word segmentation tool (such as jieba) can be used for word segmentation. For example, unit test case 2 and unit test case 4 in Table 1 are segmented, and the resulting word sets are denoted as {A} and {B}, respectively. Where, {A} = {query, erp, order, contain, clone, product, product number, and, product number, same}, and {B} = {query, erp, order, contain, clone, product, product number, and, product number, consistent}. In {A} and {B}, the number of co-occurring words is 9, that is, the word intersection of the test case description text pair is 9, and the word union of the test case description text pair is 11. The text similarity S = 9 / 11 = 81.8%. If the preset first similarity threshold is 80%, then the test case description text pair is determined to be texts that may have the same semantics.
[0131] Figure 4 This diagram illustrates a flowchart of yet another southbound gateway detection method provided in an embodiment of this disclosure. Figure 2 Based on the embodiment, step S106 is further refined into steps S402-S404, specifically, as follows: Figure 4 As shown, the method includes:
[0132] S402. Calculate the semantic similarity between the first test case description text and the second test case description text;
[0133] S404. Cluster the first test case description text and the second test case description text whose semantic similarity exceeds the second similarity threshold into one class.
[0134] The second similarity threshold in this embodiment can be preset, and the size of the first similarity threshold can be set according to the actual situation. This application does not make any specific limitations.
[0135] In this embodiment, the semantic similarity between the first test case description text and the second test case description text is calculated by using a search website (such as CNKI, Baidu, etc.) to calculate the semantic similarity of each sentence's words, and then the overall semantic similarity between the first test case description text and the second test case description text is calculated. In the following embodiment, the semantic similarity between the first test case description text and the second test case description text is calculated based on the noun analysis method of CNKI.
[0136] In one embodiment, step S402 calculates the semantic similarity between the first test case description text and the second test case description text, including:
[0137] The first test case description text is segmented into words to obtain the first segmented word set of the first test case description text.
[0138] The second test case description text is segmented into words to obtain the second segmented word set of the second test case description text.
[0139] Calculate the word segmentation similarity between the first word segmentation set and the second word segmentation set;
[0140] The calculated word segmentation similarity is normalized to obtain the semantic similarity between the first test case description text and the second test case description text.
[0141] After calculation by the ppJoin algorithm, the first test case description text and the second test case description text are output as input for the noun analysis method, which uses words as the basic unit. Figure 5 This diagram illustrates the calculation of semantic similarity between similar test case text pairs provided in an embodiment of this disclosure.
[0142] like Figure 5 As shown, the first and second test case description texts are segmented using a word segmentation tool to obtain the first set of segmented words for the first test case description text, denoted as {C} = {c1, c2, ..., c n}, and the second set of word segments of the text describing the second test case, denoted as {D} = {d1, d2, ..., d...} n}
[0143] For a noun c in set {C} i Using the tree structure of a search website (such as CNKI), calculate the relationship between each noun d in the set {D} and the search term d. i Word similarity S i1 S i2 S in .
[0144] The similarity matrix S between all nouns in set {C} and all nouns in set {D} is calculated sequentially:
[0145]
[0146] In the similarity matrix S, S ij Let represent the similarity between the i-th noun in set {C} and the j-th noun in set {D}.
[0147] From the similarity matrix S, determine the three elements with the highest similarity values, and denote them as Si in descending order. max1 S max2 and S max3 Calculate the normalized similarity S CD This refers to the semantic similarity between the description text of the first test case and the description text of the second test case, as follows:
[0148]
[0149] It should be noted that the number of elements with the highest similarity value can be determined based on the number of elements in the similarity matrix, or the number of elements with the highest similarity value can be a fixed value; this application does not impose any specific limitations.
[0150] In one embodiment, the method further includes:
[0151] Obtain the first word segmentation vector of the first test case description text;
[0152] Obtain the second word segmentation vector of the description text of the second test case;
[0153] Calculate the word distance between the first test case description text and the second test case description text based on the first word segmentation vector and the second word segmentation vector;
[0154] The semantic similarity between the description text of the first test case and the description text of the second test case is corrected based on word distance.
[0155] If the first word vector is denoted as C and the second word vector as D, then the word distance between the first test case description text and the second test case description text can be obtained using the cosine similarity calculation method. Of course, any similarity algorithm can be used, not just the cosine similarity algorithm.
[0156] To make the technical solutions of the embodiments of this disclosure clearer, a brief introduction to the cosine similarity algorithm is given below. This algorithm determines the similarity between two vectors or the word distance between two test case description texts by calculating the cosine value of the angle between the vectors.
[0157] For example, if c and d are two vectors, then their cosine similarity is:
[0158]
[0159] Where θ is the angle between vectors a and b.
[0160] Taking the test case description texts corresponding to unit test case 2 and unit test case 4 in the above embodiments as examples, the vocabulary sets are denoted as {A} and {B}, respectively. {A} = {query, erp, order, contain, clone, product, product number, and, product number, same}, {B} = {query, erp, order, contain, clone, product, product number, and, product number, consistent}, where the number of times each word appears is:
[0161] Set {A}: Query 1, erp1, order 1, contain 1, clone 1, product 1, product number 1, and 1, product number 1, same 1, identical 0;
[0162] Set {B}: Query 1, erp1, order 1, contain 1, clone 1, product 1, product number 1, and 1, product number 1, same 0, identical 1.
[0163] The cosine similarity between the description texts of the two test cases is:
[0164]
[0165] θ is calculated using Formula 1 and defined as the word distance between vectors C and D. Based on the correspondence between word distance and word similarity, the corrected semantic similarity S is... CD The relationship between the word distances of the first test case description text and the second test case description text is as follows:
[0166]
[0167] Among them, D CD β is the word distance between the first word vector and the second word vector; β is an adjustable parameter, usually β < 1, β = 0.5 represents the word distance when the similarity between the first test case description text and the second test case description text is 0.5, which is convenient for clustering. The value of β can be determined according to the user's experience.
[0168] Generally, the smaller the word distance, the higher the semantic similarity between the first test case description text and the second test case description text; the larger the word distance, the smaller the semantic similarity between the first test case description text and the second test case description text.
[0169] It should be noted that the specific structures and contents of the aforementioned sets {A} and {B}, as well as the lexicon, are merely examples provided to illustrate embodiments of this disclosure and should not be considered as limitations on the scope of protection of this disclosure. Depending on the specific implementation (e.g., specific word segmentation techniques), sets {A}, {B}, and the lexicon may also have different structures and forms in other implementations.
[0170] exist Figure 1 Based on the previous embodiment, step S108 is further refined. In one embodiment, step S108 determines the complexity of the southbound gateway corresponding to the target test case description text based on the number of test case description texts in the clustered similar test case description text set, including:
[0171] Determine whether the number of test case description texts in the clustered similar test case description text set is greater than or equal to a first preset threshold.
[0172] If the conditions are met, the test scenario for the southbound gateway is deemed to meet the test requirements.
[0173] If the number of test case description texts in the clustered similar test case description text set is less than the first preset threshold, then the unit test case test scenarios of the southbound gateway are deemed insufficient.
[0174] The first preset threshold in this embodiment can be determined according to the actual situation. For example, the first preset threshold is 2. This application does not make a specific limitation.
[0175] For example, when the number of unit test cases for the same southbound gateway is greater than or equal to 2, it indicates to some extent that the unit test cases of the test method are qualified; when the number of unit test cases for the same southbound gateway is less than 2, it indicates that the number of unit test cases for the test method is insufficient, and there is a risk of insufficient unit test case coverage.
[0176] When the number of test case description texts in the clustered similar test case description text set is greater than or equal to the first preset threshold, it is also necessary to determine whether the number of test case description texts in the clustered similar test case description text set is greater than the second preset threshold, wherein the second preset threshold is greater than the first preset threshold;
[0177] If the conditions are met, then the southbound gateway is determined to have complexity.
[0178] The second preset threshold in this embodiment can be determined according to the actual situation. For example, the second preset threshold is 5. This is only an illustrative example and is not specifically limited in this application.
[0179] For example, when the number of unit test cases for the same southbound gateway is greater than 5, it indicates to some extent that the internal implementation of the southbound gateway has a certain degree of complexity.
[0180] Figure 6 This diagram illustrates a flowchart of yet another southbound gateway detection method provided in an embodiment of this disclosure. Figure 1 Based on the embodiment, step S602 is added between steps S102 and S104, such as... Figure 6 As shown, the method includes S102, S602, and S104-S108, specifically including:
[0181] S602. Preprocess multiple test case description texts in the test case description text set.
[0182] The preprocessing methods in this embodiment include, but are not limited to, filtering out test case description texts that mix Chinese and English while ensuring structural integrity, filtering out excessively short test case description texts while ensuring semantic integrity, deleting special symbols (such as null characters, "-", ":", "," etc.) in the test case description text, and replacing English in the test case description text with Chinese characters that have the same meaning, etc.
[0183] It should be noted that the specific implementation of the above preprocessing is merely an example provided to illustrate the embodiments of this disclosure and should not be regarded as a limitation on the scope of protection of this disclosure.
[0184] Figure 7 A schematic diagram illustrating the southbound gateway detection method provided in this embodiment of the present disclosure is shown. Figure 7 As shown, after the test is completed, a test report is generated. Test case description text is extracted from the test data of multiple unit test cases. The test case description text and target test case description text are preprocessed, such as removing English test case description text and performing word segmentation. ppJoin is used to quickly filter test case description texts similar to the target test case description text, forming a set of similar test case description texts. Semantic similarity is calculated using noun method, and test case description texts with semantic similarity exceeding the similarity threshold in the set of similar test case description texts are clustered into one category. The number of unit test cases in this category of similar test case description texts is counted. If different target test case description texts are selected, the test case description texts can be matched to different sets of similar test case description texts, thus obtaining the number of unit test cases corresponding to different southbound gateways. The complexity of the corresponding southbound gateway can then be determined based on the number of unit test cases.
[0185] Based on the same inventive concept, this disclosure also provides a southbound gateway detection device, as described in the following embodiments. Since the principle by which this device solves the problem is similar to that of the above-described method embodiments, the implementation of this device embodiment can refer to the implementation of the above-described method embodiments, and repeated details will not be elaborated further.
[0186] Figure 8 A schematic diagram of a southbound gateway detection device according to an embodiment of this disclosure is shown. Figure 8 As shown, the southbound gateway detection device in this embodiment includes a text extraction module 801, a text filtering module 802, a text clustering module 803, and a complexity determination module 804, wherein...
[0187] The text extraction module 801 is used to extract the test case description text from multiple unit test cases of the southbound gateway and form a test case description text set.
[0188] The text filtering module 802 is used to filter test case description texts that are similar to the target test case description text from the test case description text set, and form a similar test case description text set;
[0189] The text clustering module 803 is used to cluster test case description texts with the same semantics in the similar test case description text set into one class, and obtain the number of test case description texts in the clustered similar test case description text set.
[0190] The complexity determination module 804 is used to determine the complexity of the southbound gateway corresponding to the target test case description text based on the number of test case description texts in the clustered similar test case description text set.
[0191] In one embodiment, the text filtering module 802 includes a text matching submodule not shown in the accompanying drawings.
[0192] The text matching submodule is used to match the target test case description text with a single token as the key and the text ID and text content of the test case description text in the test case description text set as the value.
[0193] Match test case description texts containing the same token to similar test case description text sets.
[0194] It should be noted that the text filtering module 802 also includes a text similarity calculation submodule, which is not shown in the attached figures.
[0195] The text similarity calculation submodule is used to calculate the text similarity between pairs of test case description texts within a set of similar test case description texts;
[0196] Output the first test case description text and the second test case description text whose text similarity exceeds the first similarity threshold, wherein the first test case description text and the second test case description text are test case description text pairs within the set of similar test case description texts.
[0197] In one embodiment, the semantic similarity of test case description text pairs within a set of similar test case description texts is obtained in the following way:
[0198] The test case description text pairs are segmented to obtain the lexical intersection and lexical union of the test case description text pairs;
[0199] The text similarity of test case description text pairs is calculated based on the lexical intersection and lexical union.
[0200] In one embodiment, the text clustering module 803 includes a semantic similarity calculation submodule (not shown in the figures) and a text clustering submodule, wherein...
[0201] The semantic similarity calculation submodule is used to calculate the semantic similarity between the first test case description text and the second test case description text.
[0202] The text clustering submodule is used to cluster the first test case description text and the second test case description text, whose semantic similarity exceeds the second similarity threshold, into one class.
[0203] Specifically, the semantic similarity calculation submodule is used to perform word segmentation on the first test case description text pair to obtain the first word segmentation set of the first test case description text;
[0204] The second test case description text is segmented into words to obtain the second segmented word set of the second test case description text.
[0205] Calculate the word segmentation similarity between the first word segmentation set and the second word segmentation set;
[0206] The calculated word segmentation similarity is normalized to obtain the semantic similarity between the first test case description text and the second test case description text.
[0207] In an optional embodiment of this disclosure, the text clustering module 803 further includes a semantic similarity correction module (not shown in the figures) for obtaining a first word segmentation vector of the first test case description text;
[0208] Obtain the second word segmentation vector of the description text of the second test case;
[0209] Calculate the word distance between the first test case description text and the second test case description text based on the first word segmentation vector and the second word segmentation vector;
[0210] The semantic similarity between the description text of the first test case and the description text of the second test case is corrected based on word distance.
[0211] In one embodiment of this disclosure, the complexity determination module 804 is used to determine whether the number of test case description texts in the clustered similar test case description text set is greater than or equal to a first preset threshold.
[0212] If the conditions are met, the test scenario for the southbound gateway is deemed to meet the test requirements.
[0213] If the number of test case description texts in the clustered similar test case description text set is less than the first preset threshold, then the unit test case test scenarios of the southbound gateway are deemed insufficient.
[0214] In one embodiment, the complexity determination module 804 is further used to determine whether the number of test case description texts in the clustered similar test case description text set is greater than a second preset threshold, wherein the second preset threshold is greater than a first preset threshold.
[0215] If the conditions are met, then the southbound gateway is determined to have complexity.
[0216] In one embodiment, the test case description text includes test function description text and test result description text, wherein the test function description text is used to distinguish different test methods; and the test result description text is used to distinguish different test results under the same test method.
[0217] In one embodiment, the target use case description text is the test case description text in the test case description text set; or...
[0218] The target use case description text is pre-defined text.
[0219] Optionally, the device also includes a text preprocessing module (not shown in the figures) for preprocessing multiple test case description texts in the test case description text set.
[0220] Those skilled in the art will understand that various aspects of the present invention can be implemented as systems, methods, or program products. Therefore, various aspects of the present invention can be specifically implemented in the following forms: entirely hardware implementations, entirely software implementations (including firmware, microcode, etc.), or implementations combining hardware and software aspects, collectively referred to herein as “circuits,” “modules,” or “systems.”
[0221] This embodiment provides a southbound gateway detection method and apparatus. It extracts test case description text from multiple unit test cases of a southbound gateway, filters out test case description text similar to the target test case description text, and clusters semantically identical test case description texts within the similar texts. Based on the number of clustered similar test case description texts, the complexity of the southbound gateway and the scenario coverage of each southbound gateway unit test case can be easily and quickly determined, judging whether the unit test cases are qualified. This effectively identifies the complexity of the southbound gateway and ensures its quality. Furthermore, this embodiment first filters out test case description texts similar to the target test case description text, and then clusters semantically identical test case description texts within the similar texts, thereby reducing the sample size for each category of similar test case description texts and improving detection efficiency.
[0222] Figure 9 An exemplary system architecture 900 is shown that can be applied to the southbound gateway detection method or southbound gateway detection apparatus of the present disclosure embodiments.
[0223] like Figure 9 As shown, the system architecture 900 may include a terminal device 910, a network 920, and a server 930.
[0224] Network 920 is a medium used to provide a communication link between terminal device 910 and server 930, and can be a wired network or a wireless network.
[0225] Users can use terminal device 910 to interact with server 930 via network 920 to receive or send messages.
[0226] Terminal device 910 can be any electronic device with a display screen that supports unit test cases for the southbound gateway, including but not limited to smartphones, tablets, laptops, and desktop computers.
[0227] The clients for applications that can be installed on the 910 terminal device are the same, or clients for the same type of application based on different operating systems. Depending on the terminal platform, the specific form of the application client can also differ; for example, the application client can be a mobile client, a PC client, etc.
[0228] For example, the terminal device 910 is equipped with the JUnit unit testing framework and the Ant software development tool. Users can achieve automated testing of unit test cases by combining the JUnit unit testing framework and the Ant software development tool.
[0229] Server 930 can be a server that provides various services, such as a backend management server that supports the devices operated by users using terminal device 910. The backend management server can analyze and process received data such as requests (e.g., test case description text of unit test cases) and feed back the processing results (e.g., complexity information of the southbound gateway) to terminal device 910.
[0230] Optionally, the server can be a standalone physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.
[0231] Those skilled in the art will know that Figure 9 The number of terminal devices, networks, and servers shown is merely illustrative; any number of terminal devices, networks, and servers can be included depending on actual needs. This disclosure does not limit the scope of the embodiments.
[0232] The following reference Figure 10 To describe an electronic device 1000 according to this embodiment of the present invention. Figure 10 The electronic device 1000 shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.
[0233] like Figure 10 As shown, the electronic device 1000 is manifested in the form of a general-purpose computing device. The components of the electronic device 1000 may include, but are not limited to: at least one processing unit 1010, at least one storage unit 1020, and a bus 1030 connecting different system components (including storage unit 1020 and processing unit 1010).
[0234] The storage unit stores program code that can be executed by the processing unit 1010, causing the processing unit 1010 to perform the steps described in the "Exemplary Methods" section of this specification according to various exemplary embodiments of the present invention.
[0235] Storage unit 1020 may include readable media in the form of volatile storage units, such as random access memory (RAM) 10201 and / or cache memory 10202, and may further include read-only memory (ROM) 10203.
[0236] Storage unit 1020 may also include a program / utility 10204 having a set (at least one) program module 10205, such program module 10205 including but not limited to: operating system, one or more application programs, other program modules and program data, each or some combination of these examples may include an implementation of a network environment.
[0237] Bus 1030 can represent one or more of several types of bus structures, including a memory cell bus or memory cell controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local bus using any of the multiple bus structures.
[0238] Electronic device 1000 can also communicate with one or more external devices 1040 (e.g., keyboard, pointing device, Bluetooth device, etc.), one or more devices that enable a user to interact with system 1000, and / or any device that enables electronic device 1000 to communicate with one or more other computing devices (e.g., router, modem, etc.). This communication can be performed via input / output (I / O) interface 1050. Furthermore, system 1000 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 1060. As shown, network adapter 1060 communicates with other modules of electronic device 1000 via bus 1030. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with electronic device 1000, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0239] From the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, terminal device, or network device, etc.) to execute the methods according to the embodiments of this disclosure.
[0240] In exemplary embodiments of this disclosure, a computer-readable storage medium is also provided, on which a program product capable of implementing the methods described above is stored. In some possible embodiments, various aspects of the invention may also be implemented as a program product comprising program code that, when the program product is run on a terminal device, causes the terminal device to perform the steps of the various exemplary embodiments of the invention described in the "Exemplary Methods" section of this specification.
[0241] More specific examples of computer-readable storage media in this disclosure may include, but are not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), or any suitable combination of the foregoing.
[0242] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to embodiments of this disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.
[0243] Furthermore, although the steps of the method in this disclosure are described in a specific order in the accompanying drawings, this does not require or imply that the steps must be performed in that specific order, or that all the steps shown must be performed to achieve the desired result.
[0244] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the appended claims.
Claims
1. A method for detecting a southbound gateway, characterized in that, include: Extract the test case description text from multiple unit test cases of the southbound gateway to form a test case description text set; From the set of test case description texts, test case description texts that are similar to the target test case description text are selected to form a set of similar test case description texts. One target test case description text corresponds to one southbound gateway. Cluster test case description texts with the same semantics in the similar test case description text set into one class, and obtain the number of test case description texts in the clustered similar test case description text set. When calculating the number of test cases for the southbound gateway unit, test case description texts with the same semantics are counted as one. The complexity of the southbound gateway corresponding to the target test case description text is determined based on the number of test case description texts in the clustered similar test case description text set. The step of clustering semantically identical test case description texts in a similar test case description text set into one category, and obtaining the number of test case description texts in the clustered similar test case description text set, includes: Calculate the semantic similarity between the first test case description text and the second test case description text; wherein, the first test case description text and the second test case description text are test case description text pairs within the set of similar test case description texts; The first test case description text and the second test case description text, whose semantic similarity exceeds the second similarity threshold, are clustered into one class.
2. The southbound gateway detection method according to claim 1, characterized in that, The step of filtering test case description texts similar to the target test case description text from the test case description text set to form a similar test case description text set includes: The target use case description text is matched using a single token as the key and the test case description text ID and text content in the test case description text set as the value. The test case description texts containing the same token in the test case description text set are matched to the similar test case description text set.
3. The southbound gateway detection method according to claim 1, characterized in that, The method further includes: Calculate the text similarity of test case description text pairs within the set of similar test case description texts; Output the first test case description text and the second test case description text whose text similarity exceeds the first similarity threshold.
4. The southbound gateway detection method according to claim 3, characterized in that, The calculation of text similarity between test case description text pairs within the set of similar test case description texts includes: The test case description text pairs are segmented to obtain the lexical intersection and lexical union of the test case description text pairs; The text similarity of the test case description text pairs is calculated based on the lexical intersection and lexical union.
5. The southbound gateway detection method according to claim 1, characterized in that, The calculation of the semantic similarity between the first test case description text and the second test case description text includes: The first test case description text pair is segmented to obtain the first segmentation set of the first test case description text; The second test case description text is segmented to obtain a second segmentation set of the second test case description text. Calculate the word segmentation similarity between the first word segmentation set and the second word segmentation set; The calculated word segmentation similarity is normalized to obtain the semantic similarity between the first test case description text and the second test case description text.
6. The southbound gateway detection method according to claim 5, characterized in that, The method further includes: Obtain the first word segmentation vector of the first test case description text; Obtain the second word segmentation vector of the description text of the second test case; Calculate the word distance between the first test case description text and the second test case description text based on the first word segmentation vector and the second word segmentation vector; The semantic similarity between the first test case description text and the second test case description text is corrected based on the word distance.
7. The southbound gateway detection method according to claim 1, characterized in that, The step of determining the complexity of the southbound gateway corresponding to the target test case description text based on the number of test case description texts in the clustered similar test case description text set includes: Determine whether the number of test case description texts in the clustered similar test case description text set is greater than or equal to a first preset threshold; If the conditions are met, then the test scenario for the southbound gateway is deemed to meet the test requirements.
8. The southbound gateway detection method according to claim 7, characterized in that, The method further includes: If the number of test case description texts in the clustered similar test case description text set is less than the first preset threshold, then it is determined that the unit test case test scenarios of the southbound gateway are insufficient.
9. The southbound gateway detection method according to claim 7, characterized in that, The method further includes: Determine whether the number of test case description texts in the clustered similar test case description text set is greater than a second preset threshold, wherein the second preset threshold is greater than a first preset threshold; If the conditions are met, the southbound gateway is determined to have complexity.
10. The southbound gateway detection method according to claim 1, characterized in that, The test case description text includes a test function description text and a test result description text. The test function description text is used to distinguish different test methods, and the test result description text is used to distinguish different test results under the same test method.
11. The southbound gateway detection method according to claim 1, characterized in that, The target use case description text is the test case description text in the test case description text set; or... The target use case description text is a pre-defined text.
12. The southbound gateway detection method according to claim 1, characterized in that, The method further includes: The test case description texts in the test case description text set are preprocessed.
13. A southbound gateway detection device, characterized in that, include: The text extraction module is used to extract the test case description text from multiple unit test cases of the southbound gateway, forming a test case description text set; The text filtering module is used to filter test case description texts that are similar to the target test case description text from the test case description text set, forming a similar test case description text set, wherein one target test case description text corresponds to one southbound gateway; The text clustering module is used to cluster semantically identical test case description texts in a similar test case description text set into one class, and obtain the number of test case description texts in the clustered similar test case description text set. When calculating the number of test cases for the southbound gateway unit, semantically identical test case description texts are counted as one. The complexity determination module is used to determine the complexity of the southbound gateway corresponding to the target test case description text based on the number of test case description texts in the clustered similar test case description text set. The text clustering module is used to calculate the semantic similarity between the first test case description text and the second test case description text; wherein the first test case description text and the second test case description text are test case description text pairs within the set of similar test case description texts; and the first test case description text and the second test case description text whose semantic similarity exceeds a second similarity threshold are clustered into one class.
14. An electronic device, characterized in that, include: processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform the southbound gateway detection method as described in any one of claims 1-12 by executing the executable instructions.
15. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the southbound gateway detection method as described in any one of claims 1-12.
Citation Information
Patent Citations
Multi-dimension measurement method and device for test adequacy
CN106294174A
Method and device for processing test case
CN114490400A