Test case matching method and device, electronic equipment and storage medium

By matching and generating multi-level test cases, the problem of insufficient coverage and accuracy in complex automotive software testing is solved, and efficient functional testing is achieved.

CN117331818BActive Publication Date: 2026-11-27GUANGZHOU AUTOMOBILE GROUP CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311199701.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-15
Publication Date
2026-11-27
Estimated Expiration
2043-09-15

AI Technical Summary

Technical Problem

In complex automotive software testing environments, test accuracy and coverage are difficult to guarantee, especially due to differences in the technical skills and experience of testers, which makes it difficult to improve the efficiency and accuracy of functional testing.

Method used

By acquiring functional test information, matching the target functional module test case library, analyzing the conditional keywords in the first-level test cases, and combining them with the overall test case library, second-level and third-level test cases are generated to ensure coverage and stability.

Benefits of technology

It improves the functional module coverage and accuracy of test cases, ensuring high completeness and accuracy of testing, especially stability when testing specific functional modules.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117331818B_ABST
    Figure CN117331818B_ABST
Patent Text Reader

Abstract

The application discloses a test case matching method and device, electronic equipment and a storage medium. The test case matching method comprises the following steps: matching function test information with a corresponding target function module test case library to obtain a primary test case corresponding to the function test information; obtaining a first conditional characteristic word in the primary test case, matching the obtained first conditional characteristic word with a total test case library to obtain a secondary test case corresponding to the function test information; matching a second conditional characteristic word with an attribute label being a reverse test label with the total test case library to obtain a tertiary test case; and obtaining a target test case corresponding to the function test information according to the primary test case, the secondary test case and the tertiary test case. According to the target test case obtained from the primary test case, the secondary test case and the tertiary test case, high precision and high integrity of the matched test case can be ensured when a certain specific function module is tested.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of functional testing technology, and more specifically, to a test case matching method, apparatus, electronic device, and storage medium. Background Technology

[0002] Functional testing is one of the most important processes in the automotive industry. It involves verifying the correctness, completeness, and stability of the complex functions of modern cars and is a multi-faceted, iterative review or comparison process.

[0003] For test technicians, accuracy and coverage are two extremely important metrics in the field of functional testing. However, in the context of increasingly complex and integrated automotive software using various advanced technologies, coupled with the varying skill levels and testing experience of testers, achieving accurate and efficient testing of a specific function becomes even more challenging. Summary of the Invention

[0004] In view of the above problems, this application proposes a test case matching method, apparatus, electronic device and storage medium.

[0005] In a first aspect, embodiments of this application provide a test case matching method, the method comprising: acquiring functional test information; matching the functional test information with a total test case library to acquire a target functional module test case library corresponding to the functional test information, wherein the functional test information includes information for characterizing the functional module to which the functional test information is applied, and the total test case library includes multiple functional module test case libraries corresponding to functional modules; matching the functional test information with test cases in the target functional module test case library to acquire a first-level test case corresponding to the functional test information; acquiring a first conditional feature word whose frequency of occurrence in the first-level test case reaches a first preset threshold, matching the acquired first conditional feature word with the total test case library to acquire a second-level test case corresponding to the functional test information, wherein the conditional feature word is used to represent the condition for function triggering; acquiring a second conditional feature word whose frequency of occurrence in all inverse test cases in the first-level test case reaches a second preset threshold, matching the second conditional feature word with test cases in the total test case library to acquire a third-level test case; and acquiring a target test case corresponding to the functional test information based on the first-level test case, the second-level test case, and the third-level test case.

[0006] In some implementations, the step of matching the functional test information with test cases in the target functional module test case library to obtain the first-level test cases corresponding to the functional test information includes: decomposing the functional test information according to a preset format to obtain initial feature words; obtaining a test feature word library corresponding to the target functional module test case library; matching the initial feature words with the test feature word library; obtaining multiple feature words in the test feature word library whose feature similarity to the initial feature words reaches a similarity threshold; logically connecting the multiple feature words to form matching test cases; and matching the matching test cases with test cases in the target functional module test case library to obtain the first-level test cases corresponding to the functional test information.

[0007] In some implementations, the logical relationship includes an AND relationship. The step of obtaining multiple feature words in the test feature word library whose feature similarity to the initial feature word reaches a similarity threshold, and connecting these multiple feature words with a logical relationship to obtain matching test cases, includes: calculating the semantic similarity between the initial feature word and the test feature word library; obtaining multiple feature words in the test feature word library whose semantic similarity to the feature word reaches a similarity threshold; and connecting these multiple feature words with an AND relationship to obtain the matching test cases.

[0008] In some implementations, the step of obtaining conditional feature words whose frequency in the first-level test cases reaches a preset threshold, and matching the obtained conditional feature words with the total test case library to obtain the second-level test cases corresponding to the functional test information includes: extracting the first-level test cases according to a preset method to obtain multiple conditional feature words in the first-level test cases and the value range corresponding to each conditional feature word; obtaining conditional feature words whose frequency in the multiple conditional feature words exceeds a frequency threshold as first conditional feature words; matching the first conditional feature words and the value range corresponding to the first conditional feature words with the total test case library to obtain functional module test cases in the total test case library other than the target functional module test case library that match the first conditional feature words, and using these as the second-level test cases.

[0009] In some implementations, obtaining second conditional feature words whose frequency in all inverse test cases in the first-level test cases reaches a second preset threshold, and matching the second conditional feature words with test cases in the total test case library to obtain third-level test cases includes: using the inverse test tags in the first-level test cases to filter out all inverse test cases in the first-level test cases; obtaining second conditional feature words whose frequency in all inverse test cases reaches a second preset threshold; and matching the second conditional feature words with test cases in the total test case library to obtain the third-level test cases.

[0010] In some implementations, the step of matching the second conditional feature word with test cases in the overall test case library to obtain the third-level test cases includes: taking regular values ​​from the second conditional feature word to obtain matching words corresponding to the second feature word; and matching the matching words with test cases in the overall test case library to obtain the third-level test cases.

[0011] In some implementations, obtaining the target test case corresponding to the functional test information based on the first-level test case, second-level test case, and third-level test case includes: comparing the third-level test case with the first-level test case; if all test cases in the third-level test case are included in the first-level test case, then using the first-level test case and the second-level test case as the target test case corresponding to the functional test information; if one or more test cases in the third-level test case are different from the test cases in the first-level test case, then using the parts of the first-level test case, second-level test case, and third-level test case that are different from the first-level test case as the target test case corresponding to the functional test information.

[0012] Secondly, embodiments of this application provide a test case matching device, the device comprising: a target functional module test case library acquisition module, configured to acquire functional test information, match the functional test information with a total test case library, and acquire a target functional module test case library corresponding to the functional test information, wherein the functional test information includes information representing the functional module to which the functional test information is applied, and the total test case library includes multiple functional module test case libraries corresponding to functional modules; a first-level test case acquisition module, configured to match the functional test information with test cases in the target functional module test case library, and acquire first-level test cases corresponding to the functional test information; and a second-level test case acquisition module, configured to... The system obtains a first conditional feature word whose frequency in the first-level test cases reaches a first preset threshold, matches the obtained first conditional feature word with the total test case library, and obtains the second-level test case corresponding to the functional test information. The conditional feature word is used to represent the condition for triggering the function. The third-level test case acquisition module obtains a second conditional feature word whose frequency in all inverse test cases in the first-level test cases reaches a second preset threshold, matches the second conditional feature word with the test cases in the total test case library, and obtains the third-level test case. The target test case acquisition module obtains the target test case corresponding to the functional test information based on the first-level test cases, second-level test cases, and third-level test cases.

[0013] Thirdly, embodiments of this application provide an electronic device, including: one or more processors; a memory; and one or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the one or more processors, and the one or more application programs are configured to execute the test case matching method provided in the first aspect above.

[0014] Fourthly, embodiments of this application provide a computer-readable storage medium storing program code, which can be invoked by a processor to execute the test case matching method provided in the first aspect above.

[0015] The solution provided in this application first obtains the target functional module test case library corresponding to the functional test information based on the functional module corresponding to the functional test information. Then, based on a matching operation, it obtains test cases from this target functional module test case library as the first-level test cases for the functional test information. Next, it analyzes the first-level test cases to obtain first-condition feature words whose frequency reaches a preset threshold. These first-condition feature words are then matched with functional module test cases in the overall test case library, excluding the target functional module test case library, to obtain second-level test cases. Finally, it obtains second-condition feature words corresponding to the inverse test tags in the first-level test cases and matches these second-condition feature words with the overall test case library to obtain third-level test cases. Finally, it generates the target test cases for the functional test information based on the first-level, second-level, and third-level test cases. It not only fully considers the test cases of the functional modules corresponding to the functional test information, but also the test cases of other functional modules, and fully considers the potential impact of other functional module test case libraries on the functional test information, thus improving the functional module coverage of the obtained test cases. Moreover, it generates three-level test cases based on preset tags to supplement the functional test information with stability test cases. Based on the target test cases obtained from the first-level test cases, second-level test cases, and third-level test cases, it ensures high accuracy and high completeness of the matched test cases when testing the function of a specific functional module. Attached Figure Description

[0016] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0017] Figure 1 A flowchart illustrating a test case matching method provided in an embodiment of this application is shown.

[0018] Figure 2 A detailed flowchart of step S120 provided in an embodiment of this application is shown.

[0019] Figure 3 A detailed flowchart of step S130 provided in an embodiment of this application is shown.

[0020] Figure 4 A detailed flowchart of step S140 provided in an embodiment of this application is shown.

[0021] Figure 5 A structural block diagram of the test case matching device provided in an embodiment of this application is shown.

[0022] Figure 6 A structural block diagram of an electronic device for performing a test case matching method according to an embodiment of the present application is shown. Detailed Implementation

[0023] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.

[0024] To address the aforementioned issues, this application provides a test case matching method, apparatus, electronic device, and storage medium. First, based on the functional modules corresponding to the functional test information, a target functional module test case library is obtained. Then, test cases from this target functional module test case library are obtained as first-level test cases for the functional test information. Next, the first-level test cases are analyzed to obtain first conditional feature words whose frequency reaches a preset threshold. These first conditional feature words are matched with functional module test cases from the overall test case library (excluding the target functional module test case library) to obtain second-level test cases. Then, second conditional feature words corresponding to the inverse test tags in the first-level test cases are obtained and matched with the overall test case library to obtain third-level test cases. Finally, the target test cases for the functional test information are generated based on the first-level, second-level, and third-level test cases. It not only fully considers the test cases of the functional modules corresponding to the functional test information, but also the test cases of other functional modules, and fully considers the potential impact of other functional module test case libraries on the functional test information, thus improving the functional module coverage of the obtained test cases. Moreover, it generates three-level test cases based on preset tags to supplement the functional test information with stability test cases. Based on the target test cases obtained from the first-level test cases, second-level test cases, and third-level test cases, it ensures high accuracy and high completeness of the matched test cases when testing the function of a specific functional module.

[0025] Please see Figure 1 , Figure 1 A flowchart illustrating a test case matching method according to an embodiment of this application is shown. In a specific embodiment, the test case matching method is applied to, for example... Figure 5 The test case matching device 300 and the electronic device 100 configured with the test case matching device 300 are shown.

[0026] The following will address... Figure 1 The process shown will be explained in detail. The test case matching method may specifically include the following steps:

[0027] Step S110: Obtain functional test information, match the functional test information with the total test case library, and obtain the target functional module test case library corresponding to the functional test information. The functional test information includes information for characterizing the functional module to which the functional test information is applied, and the total test case library includes multiple functional module test case libraries corresponding to the functional modules.

[0028] Functional test information refers to information that needs to be tested, and this information includes details about the functional modules to which the test is performed. For example, if the functional test information is "the function of intelligent power distribution at different vehicle speeds," then the corresponding functional module is the intelligent power distribution module.

[0029] The overall test case library contains multiple test cases, which are then categorized according to functional modules, resulting in multiple functional module test case libraries for different functional modules. A test case refers to a test example used to test functional test information. For example, 'the function of intelligent power distribution at a speed of 50km / h' is a test case for 'the function of intelligent power distribution at different vehicle speeds'.

[0030] By comparing the information of the functional modules represented in the functional test information with the total test case library, the test case library of the target functional module corresponding to the functional test information is obtained.

[0031] Step S120: Match the functional test information with the test cases in the target functional module test case library to obtain the first-level test cases corresponding to the functional test information.

[0032] The functional test information is matched with the test case library of the target functional module to obtain the first-level test cases that match the functional test information.

[0033] Please see Figure 2 In some embodiments, step S120 may include steps S121 to S125, which are described in detail below:

[0034] Step S121: Decompose the functional test information according to the preset format to obtain initial feature words.

[0035] The preset format can be either characters or words.

[0036] The functional test information is decomposed based on characters or words to obtain initial feature words corresponding to multiple characters and / or multiple words.

[0037] Step S122: Obtain the test feature word library corresponding to the test case library of the target functional module.

[0038] The attributes corresponding to the functional module test cases in the target functional module test case library and the feature words corresponding to the associated logic are recorded in a unified manner, thereby obtaining the test feature word library corresponding to the target functional module test case library.

[0039] Step S123: Match the initial feature words with the test feature word library.

[0040] Step S124: Obtain multiple feature words in the test feature word library whose feature similarity to the initial feature words reaches a similarity threshold, and connect the multiple feature words logically to form matching test cases.

[0041] The initial feature words are matched against the test feature word library. The matching method can be either exact match or similarity match; the specific matching method is not limited here. The words obtained by matching the initial feature words are used as matching feature words. Multiple matching feature words are connected according to logical relationships to form matching test cases. Logical relationships include, but are not limited to, logical relation words such as 'AND', 'NOT', and 'OR'.

[0042] Specifically, the initial feature word is used to calculate semantic similarity with the test feature word library; multiple feature words in the test feature word library whose semantic similarity with the feature word reaches a similarity threshold are obtained; and the multiple feature words are connected by an AND relationship to obtain the matching test case.

[0043] Matching is performed by semantic similarity to obtain matching feature words corresponding to multiple initial feature words. These matching feature words are then connected by an AND relationship to obtain matching test cases.

[0044] Step S125: Match the matching test cases with the test cases in the target functional module test case library to obtain the first-level test cases corresponding to the functional test information.

[0045] The obtained matching test cases are matched with the functional test cases in the target functional module test case library to obtain functional test cases that meet the matching criteria, which are then used as the first-level test cases for functional test information. The matching method can be semantic similarity matching, or it can be obtained through a trained matching neural network model. The specific matching method between matching test cases and functional test cases is not limited here.

[0046] Step S130: Obtain the first conditional feature word whose frequency of occurrence reaches the first preset threshold in the first-level test case, match the obtained first conditional feature word with the total test case library, and obtain the second-level test case corresponding to the functional test information, wherein the conditional feature word is used to represent the condition for function triggering.

[0047] The first conditional feature word appearing more than a preset threshold in the first-level test cases is matched with the total test case library to obtain the second-level test cases corresponding to the functional test information. For example, if the functional test information is 'the function of intelligent power distribution at different vehicle speeds', the first-level test cases include 'the function of intelligent power distribution at a vehicle speed of 20km / h', 'the function of intelligent power distribution at a vehicle speed of 50km / h', and 'the function of intelligent power distribution at a vehicle speed of 80km / h'. When the frequency is 2, 'vehicle speed is xx' is used as the first conditional feature word and matched with the total test case library to obtain the test cases matching the first conditional feature word from the total test case library containing test cases for all functional modules. Since the first-level test cases are obtained from the test case library of the target functional module corresponding to the functional test information, the second-level test cases do not include the test cases in the first-level test cases.

[0048] Please see Figure 3 In some embodiments, step S130 may include steps S131 to S133, which are described in detail below:

[0049] Step S131: Extract the first-level test cases according to a preset method to obtain multiple conditional feature words in the first-level test cases and the value range corresponding to each conditional feature word.

[0050] Conditions in primary test cases can be extracted using a conditional feature word extraction model, or by defining labels for all feature words in the test cases and then extracting conditional feature words based on these labels. This leads to the acquisition of primary feature words.

[0051] Step S132: Obtain the conditional feature words whose frequency exceeds the frequency threshold from the plurality of conditional feature words, and use them as the first conditional feature words.

[0052] Step S133: Match the first conditional feature word and the value range corresponding to the first conditional feature word with the total test case library, and obtain the functional module test cases that match the first conditional feature word in the test case libraries of other functional modules besides the target functional module test case library in the total test case library, as the secondary test cases.

[0053] Secondary conditional test cases are obtained by matching conditional keywords that appear more frequently than a preset threshold in the primary test cases with the value range of these keywords within the primary test cases. These secondary conditional test cases are then matched against test cases from other functional modules in the overall test case library (excluding the target functional module's test case library) to obtain secondary test cases that meet the matching conditions. The matching method and conditions can be the same as or different from those used for obtaining primary test cases; details are omitted here. For example, if the conditional keyword 'vehicle speed is xx' in a primary test case exceeds a preset threshold, the primary test case obtains the conditional keyword 'vehicle speed is xx' and the value range of its multiple corresponding values. For instance, if the primary test cases contain '20km / h', '50km / h', and '80km / h', the value range is '20-80km / h'. 'vehicle speed is xx' and '20-80km / h' are then matched against test cases from other functional modules in the overall test case library (excluding the target functional module's test case library) to obtain secondary test cases in the overall test case library. By removing the directional constraints of functional modules, and instead seeking triggering conditions and value ranges that exist between modules and may affect each other if their frequency of occurrence in test cases reaches a preset threshold, and deriving corresponding test cases, the non-explicit test cases that may potentially affect the user's tested functions are taken into account, thereby improving the coverage of functional module testing.

[0054] Step S140: Obtain the second conditional feature word whose frequency of occurrence reaches the second preset threshold in all inverse test cases in the first-level test cases, and match the second conditional feature word with the test cases in the total test case library to obtain the third-level test cases.

[0055] Reverse testing refers to using known results to reverse test whether the output of software or system meets the expected functions and performance, in order to test the stability and reliability of the software or system.

[0056] Determining inverse test cases from primary test cases can be done based on attribute tags within the test cases. Attribute tags are custom tags added during the creation of the overall test case library to label conditional keywords and / or test cases, indicating whether the conditional keyword represents a forward or reverse functional test. Attribute tags can be stability tags, including but not limited to tags for fault injection testing, stress testing, and durability testing. For example, if the functional test information is 'the function of intelligent power distribution at different vehicle speeds', and its stability tag is stress testing, then the stability tag corresponding to the conditional keyword 'vehicle speed is xx' is stress testing.

[0057] In some implementations, please refer to Figure 4 Step S140 includes steps S141 to S143, which are described in detail below:

[0058] Step S141: Use the inverse test tags in the first-level test cases to filter out all inverse test cases in the first-level test cases.

[0059] Reverse test tags refer to conditional feature words or test case tags that can be used for reverse testing. Reverse test tags are user-defined tags, and their specific forms are not limited here.

[0060] The primary test cases are filtered based on the inverse test label to obtain the inverse test cases with the inverse test label.

[0061] Step S142: Obtain the second conditional feature words whose frequency in all inverse test cases reaches the second preset threshold.

[0062] Step S143: Match the second conditional feature word with the test cases in the total test case library to obtain the third-level test cases.

[0063] The second preset threshold can be the same as or different from the first preset threshold; no specific limitation is made to the second preset threshold here.

[0064] The second conditional feature word is matched with test cases in the overall test case library to obtain third-level test cases containing the second feature word.

[0065] Specifically, the second conditional feature word is analyzed for regular values ​​to obtain the matching word corresponding to the second feature word. The matching word is then matched with test cases in the overall test case library to obtain the third-level test cases.

[0066] The values ​​selected based on patterns can be derived from experience or from a pattern selection model. No specific limitations are placed on the method of selecting patterns here.

[0067] The pattern-based value model can be a Markov process model, a Long Short Term Memory Network (LSTM) model, or a network model with memory or learning structures such as a Generative Adversarial Network (GAN). The pattern-based value model obtains the value patterns corresponding to inverse test cases based on memory or learning.

[0068] By using a pattern-based value model, we can obtain the pattern values ​​of the second conditional feature words corresponding to the inverse test cases, thus avoiding the randomness brought about by manual value selection.

[0069] Step S150: Based on the first-level test cases, second-level test cases, and third-level test cases, obtain the target test cases corresponding to the functional test information.

[0070] Based on the first-level test cases, second-level test cases, and third-level test cases obtained in the above implementation method, the target test cases corresponding to the functional test information are combined to form the test cases.

[0071] Specifically, the level 3 test cases are compared with the level 1 test cases. If all test cases in the level 3 test cases are included in the level 1 test cases, the level 1 and level 2 test cases are used as the target test cases corresponding to the functional test information. If one or more test cases in the level 3 test cases are different from the test cases in the level 1 test cases, the parts of the level 1, level 2, and level 3 test cases that are different from the level 1 test cases are used as the target test cases corresponding to the functional test information.

[0072] Since Level 3 test cases are generated based on conditional keywords whose frequency exceeds a preset threshold from Level 1 test cases, and are selected according to a pattern, some Level 3 test cases may overlap with Level 1 test cases. Redundant test cases not only utilize test resources during testing, but also result in identical data after testing, causing memory redundancy. Therefore, it is necessary to determine whether any Level 3 test cases are identical to those in Level 1 test cases. If so, only the test cases different from Level 1 test cases are designated as Level 3 test cases. Then, the Level 1, Level 2, and Level 3 test cases that differ from Level 1 test cases are used as target test cases for functional test information.

[0073] In this embodiment, firstly, based on the functional module corresponding to the functional test information, a test case library for the corresponding functional module is obtained. Then, based on a matching operation, test cases from this functional module test case library are obtained as first-level test cases for the functional test information. Next, by analyzing the first-level test cases, conditional feature words whose frequency in the first-level test cases reaches a preset threshold are obtained. These conditional feature words are then matched with functional module test cases in the total test case library, excluding the functional module test case library corresponding to the functional test information, to obtain second-level test cases. Then, conditional feature words with preset tags in the first-level test cases are obtained, and these preset tag conditional feature words are matched with the total test case library to obtain third-level test cases. Finally, the target test cases for the functional test information are generated based on the first-level, second-level, and third-level test cases. It not only fully considers the test cases of the functional modules corresponding to the functional test information, but also the test cases of other functional modules, and fully considers the potential impact of other functional module test case libraries on the functional test information, thus improving the functional module coverage of the obtained test cases. Moreover, it generates three-level test cases based on preset tags to supplement the functional test information with stability test cases. Based on the target test cases obtained from the first-level test cases, second-level test cases, and third-level test cases, it ensures high accuracy and high completeness of the matched test cases when testing the function of a specific functional module.

[0074] Please see Figure 5This diagram illustrates a structural block diagram of a test case matching device 300 provided in an embodiment of this application. The test case matching device 300 is applied to an electronic device 100 and includes: a target functional module test case library acquisition module 310, used to acquire functional test information, match the functional test information with a total test case library, and acquire the target functional module test case library corresponding to the functional test information. The functional test information includes information characterizing the functional module to which the functional test information is applied, and the total test case library includes multiple functional module test case libraries corresponding to functional modules; a first-level test case acquisition module 320, used to match the functional test information with test cases in the target functional module test case library to acquire the first-level test cases corresponding to the functional test information; and a second-level test case acquisition module. 330 is used to obtain first conditional feature words whose frequency of occurrence reaches a first preset threshold in the first-level test cases, and match the obtained first conditional feature words with the total test case library to obtain the second-level test cases corresponding to the functional test information, wherein the conditional feature words are used to represent the conditions for function triggering; the third-level test case acquisition module 340 is used to obtain second conditional feature words whose frequency of occurrence reaches a second preset threshold in all inverse test cases in the first-level test cases, and match the second conditional feature words with the test cases in the total test case library to obtain the third-level test cases; the target test case acquisition module 350 is used to obtain the target test cases corresponding to the functional test information based on the first-level test cases, second-level test cases, and third-level test cases.

[0075] In some embodiments of this application, the first-level test case acquisition module 320 includes: an initial feature word acquisition module, used to decompose the functional test information according to a preset format to acquire initial feature words; a test feature word library acquisition module, used to acquire a test feature word library corresponding to the target functional module test case library; an initial feature word matching module, used to match the initial feature words with the test feature word library; a matching test case acquisition module, used to acquire multiple feature words in the test feature word library whose feature similarity to the initial feature words reaches a similarity threshold, and logically connect the multiple feature words to form matching test cases; and a matching test case matching module, used to match the matching test cases with test cases in the target functional module test case library to acquire the first-level test cases corresponding to the functional test information.

[0076] In some embodiments of this application, the logical relationship includes an AND relationship, and the matching test case acquisition module includes: a semantic similarity calculation module, used to perform semantic similarity calculation between the initial feature word and the test feature word library; a feature word acquisition module, used to acquire multiple feature words in the test feature word library whose semantic similarity with the feature word reaches a similarity threshold; and a feature word connection module, used to connect the multiple feature words with an AND relationship to obtain the matching test case.

[0077] In some embodiments of this application, the secondary test case acquisition module 330 includes: a conditional feature word acquisition module, used to extract the primary test cases according to a preset method, and acquire multiple conditional feature words in the primary test cases and the value range corresponding to each conditional feature word; a first conditional feature word acquisition module, used to acquire conditional feature words whose frequency of occurrence exceeds a frequency threshold among the multiple conditional feature words, as first conditional feature words; and a first conditional feature word matching module, used to match the first conditional feature word and the value range corresponding to the first conditional feature word with the total test case library, and acquire functional module test cases in the total test case library other than the target functional module test case library that match the first conditional feature word, as the secondary test cases.

[0078] In some embodiments of this application, the level 3 test case acquisition module 340 includes: an inverse test case acquisition module, used to filter out all inverse test cases in the level 1 test cases using inverse test tags in the level 1 test cases; a second conditional feature word acquisition module, used to acquire second conditional feature words in all inverse test cases whose frequency reaches a second preset threshold; and a level 3 test case matching acquisition module, used to match the acquired second conditional feature words with test cases in the total test case library to obtain the level 3 test cases.

[0079] In some embodiments of this application, the acquisition of level 3 test cases includes: a matching word acquisition module, used to perform regular value extraction on the second conditional feature word to obtain the matching word corresponding to the second feature word; and a matching word matching module, used to match the matching word with test cases in the total test case library to obtain the level 3 test cases.

[0080] In some embodiments of this application, the target test case acquisition module 350 includes: a comparison module for comparing the third-level test cases with the first-level test cases; a first target test case determination module for determining the first-level test cases and the second-level test cases as target test cases corresponding to the functional test information if all test cases in the third-level test cases are included in the first-level test cases; and a second target test case determination module for determining the second target test cases as target test cases corresponding to the functional test information if one or more test cases in the third-level test cases are different from the test cases in the first-level test cases.

[0081] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the above-described device and module can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0082] In the several embodiments provided in this application, the coupling between modules can be electrical, mechanical, or other forms of coupling.

[0083] Furthermore, the functional modules in the various embodiments of this application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The integrated modules described above can be implemented in hardware or as software functional modules.

[0084] Please refer to Figure 6 This document illustrates a structural block diagram of an electronic device according to an embodiment of this application. The electronic device 100 can be a vehicle-mounted terminal, a computer, or a control unit with data transmission capabilities. The electronic device 100 in this application may include one or more of the following components: a processor 101, a memory 102, and one or more application programs. The one or more application programs may be stored in the memory 102 and configured to be executed by one or more processors 101. The one or more programs are configured to perform the methods described in the foregoing method embodiments.

[0085] Processor 101 may include one or more processing cores. Processor 101 connects to various parts within the electronic device 100 using various interfaces and lines, and performs various functions and processes data of the electronic device 100 by running or executing instructions, programs, code sets, or instruction sets stored in memory 102, and by calling data stored in memory 102. Optionally, processor 101 may be implemented using at least one hardware form of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). Processor 101 may integrate one or a combination of several of the following: Central Processing Unit (CPU), Graphics Processing Unit (GPU), and modem. The CPU primarily handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the displayed content; and the modem handles wireless communication. It is understood that the modem may also not be integrated into processor 101 and may be implemented separately using a communication chip.

[0086] The memory 102 may include random access memory (RAM) or read-only memory (ROM). The memory 102 can be used to store instructions, programs, code, code sets, or instruction sets. The memory 102 may include a program storage area and a data storage area. The program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as touch functionality, sound playback functionality, image playback functionality, etc.), and instructions for implementing the various method embodiments described below. The data storage area may also store data created by the electronic device 100 during use (such as phonebook data, audio and video data, chat log data, etc.).

[0087] This application also provides a computer-readable storage medium. This computer-readable storage medium stores program code that can be called by a processor to execute the methods described in the above method embodiments.

[0088] Computer-readable storage media can be electronic storage devices such as flash memory, EEPROM (Electrically Erasable Programmable Read-Only Memory), EPROM, hard disk, or ROM. Optionally, computer-readable storage media includes non-transitory computer-readable storage medium. The computer-readable storage medium has storage space for program code that performs any of the method steps described above. This program code can be read from or written to one or more computer program products. The program code can be compressed, for example, in a suitable form.

[0089] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.

Claims

1. A test case matching method, characterized in that, The method includes: Obtain functional test information, match the functional test information with the total test case library, and obtain the target functional module test case library corresponding to the functional test information. The functional test information includes information for characterizing the functional module to which the functional test information is applied, and the total test case library includes multiple functional module test case libraries corresponding to the functional modules. The functional test information is matched with the test cases in the target functional module test case library to obtain the first-level test cases corresponding to the functional test information; First conditional feature words that appear at a frequency of a first preset threshold in the first-level test cases are obtained. The obtained first conditional feature words are matched with the total test case library to obtain the second-level test cases corresponding to the functional test information. The conditional feature words are used to represent the conditions for triggering the function. Obtain the second conditional feature words whose frequency of occurrence reaches the second preset threshold in all inverse test cases in the first-level test cases, and match the second conditional feature words with the test cases in the total test case library to obtain the third-level test cases; Based on the first-level test cases, second-level test cases, and third-level test cases, obtain the target test cases corresponding to the functional test information.

2. The method according to claim 1, characterized in that, The step of matching the functional test information with test cases in the target functional module test case library to obtain the first-level test cases corresponding to the functional test information includes: According to a preset format, the functional test information is decomposed to obtain initial feature words; Obtain the test feature word library corresponding to the test case library of the target functional module; The initial feature words are matched with the test feature word library; Obtain multiple feature words from the test feature word library whose feature similarity to the initial feature words reaches a similarity threshold, and connect the multiple feature words logically to form matching test cases; The matching test cases are matched with the test cases in the target functional module test case library to obtain the first-level test cases corresponding to the functional test information.

3. The method according to claim 2, characterized in that, The logical relationship includes an AND relationship. The step of acquiring multiple feature words from the test feature word library whose feature similarity to the initial feature words reaches a similarity threshold, and connecting these multiple feature words logically to form matching test cases, includes: The initial feature words are compared with the test feature word library to calculate semantic similarity; Obtain multiple feature words from the test feature word library whose semantic similarity to the feature words reaches a similarity threshold; The multiple feature words are joined with relationships to obtain the matching test cases.

4. The method according to claim 1, characterized in that, The process of obtaining conditional feature words whose frequency in the first-level test cases reaches a preset threshold, matching the obtained conditional feature words with the total test case library, and obtaining the second-level test cases corresponding to the functional test information includes: The first-level test cases are extracted according to a preset method to obtain multiple conditional feature words in the first-level test cases and the value range corresponding to each conditional feature word; The conditional feature words whose frequency exceeds a frequency threshold among the plurality of conditional feature words are selected as the first conditional feature words; The first conditional feature word and the value range corresponding to the first conditional feature word are matched with the total test case library to obtain the functional module test cases that match the first conditional feature word in the test case libraries of other functional modules besides the target functional module test case library in the total test case library, and these are used as the secondary test cases.

5. The method according to claim 1, characterized in that, The process involves obtaining second conditional feature words whose frequency in all inverse test cases of the first-level test cases reaches a second preset threshold, matching these second conditional feature words with test cases in the total test case library to obtain third-level test cases, including: Using the inverse test tags in the first-level test cases, all inverse test cases in the first-level test cases are filtered out; Obtain second conditional feature words whose frequency in all inverse test cases reaches a second preset threshold; The second conditional feature word is matched with the test cases in the total test case library to obtain the third-level test cases.

6. The method according to claim 5, characterized in that, The step of matching the second conditional feature word with test cases in the overall test case library to obtain the third-level test cases includes: By taking regular values ​​for the second conditional feature words, the matching words corresponding to the second feature words are obtained; The matching words are matched with test cases in the overall test case library to obtain the third-level test cases.

7. The method according to claim 1, characterized in that, The step of obtaining the target test cases corresponding to the functional test information based on the first-level test cases, second-level test cases, and third-level test cases includes: Compare the Level 3 test cases with the Level 1 test cases; If all test cases in the third-level test cases are included in the first-level test cases, the first-level test cases and the second-level test cases shall be used as the target test cases corresponding to the functional test information. If one or more test cases in the third-level test cases are different from the test cases in the first-level test cases, the parts of the first-level test cases, the second-level test cases, and the third-level test cases that are different from the first-level test cases shall be used as the target test cases corresponding to the functional test information.

8. A test case matching device, characterized in that, The device includes: The target functional module test case library acquisition module is used to acquire functional test information, match the functional test information with the total test case library, and acquire the target functional module test case library corresponding to the functional test information. The functional test information includes information for characterizing the functional module to which the functional test information is applied, and the total test case library includes multiple functional module test case libraries corresponding to the functional modules. The first-level test case acquisition module is used to match the functional test information with the test cases in the target functional module test case library to obtain the first-level test cases corresponding to the functional test information. The secondary test case acquisition module is used to acquire first conditional feature words that appear at a frequency of a first preset threshold in the primary test cases, match the acquired first conditional feature words with the total test case library, and acquire the secondary test cases corresponding to the functional test information, wherein the conditional feature words are used to represent the conditions for triggering the function; The Level 3 Test Case Acquisition Module is used to acquire second conditional feature words whose frequency of occurrence reaches a second preset threshold in all inverse test cases of the Level 1 test cases, and match the second conditional feature words with test cases in the total test case library to obtain Level 3 test cases. The target test case acquisition module is used to acquire the target test cases corresponding to the functional test information based on the first-level test cases, second-level test cases, and third-level test cases.

9. An electronic device, characterized in that, include: One or more processors; Memory; One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more applications being configured to perform the method as described in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium contains program code that can be invoked by a processor to execute the method as described in any one of claims 1-7.

Citation Information

Patent Citations

  • Test method of vehicle-mounted controller and generation method and device of test script

    CN115687102A

  • Devices, systems, and methods for use in automation

    US10102449B1