Control combination test method and device, electronic equipment and storage medium

By analyzing test requirements, generating and executing test fragment collections, the problem that traditional test case design methods are difficult to fully cover test scenarios is solved, and efficient and simplified test case design and execution are achieved.

CN119759750AInactive Publication Date: 2025-04-04BEIJING CO WHEELS TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202410323957.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-03-20
Publication Date
2025-04-04
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Traditional test case design methods are difficult to cover all test scenarios in full, resulting in potential problems and defects that may be missed, and the number and complexity of test cases have increased dramatically, increasing maintenance difficulty.

Method used

By analyzing the test requirements in the target test scenario, obtaining preset test fragments, and generating a test fragment collection, selecting controls in the temporary control collection to generate a test case collection, executing test cases and obtaining test results.

Benefits of technology

It realizes covering all test scenarios in as few test cases as possible, reducing the complexity of test cases, improving the comprehensiveness and efficiency of tests, and reducing the possibility of omissions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119759750A_ABST
    Figure CN119759750A_ABST
Patent Text Reader

Abstract

The invention provides a control combination test method and device, electronic equipment and a storage medium, and the method comprises the steps: analyzing a test demand in a target test scene, and generating a test fragment set based on an analysis result; acquiring controls in a target test scene, and establishing a temporary control set; based on the test fragments in the test fragment set, selecting controls in the temporary control set and generating a test case set; and executing the test cases in the test case set for testing, and obtaining a test result in the target test scene. Compared with the prior art, the design of the test fragment set enables the test cases to be more standardized and normalized, each test fragment aims at specific test requirements and scenes, various test scenes can be covered more comprehensively, the complexity of the test cases is reduced, and therefore the possibility of test omission is reduced; and the test fragments are independent and reusable units, and can be flexibly combined and reused in different test scenes and test cases.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of testing technology, and in particular to a method and device for control combination testing, an electronic device, and a storage medium. Background Art

[0002] In the process of software development, quality assurance is a key link to ensure software stability and user experience. As one of the important means of quality assurance, functional automation testing plays a significant role in improving test efficiency and reducing test costs. The traditional test case design method is limited by the experience and thinking of testers, which makes it difficult to achieve the ideal number and coverage of test cases. Even within the limited number of test cases, it is impossible to ensure that all test scenarios can be fully covered. This limitation not only affects the comprehensiveness of the test, but also may cause potential problems and defects to be missed and the depth of test case verification to be inconsistent, which will affect the depth of the test. In addition, in order to cover comprehensive test scenarios, a single test point may need to design a large number of test cases. This not only increases the number of test cases, but also increases the complexity and maintenance difficulty of test cases. The traditional test case design method has obvious deficiencies in comprehensiveness and depth. Since the test scenarios cannot be fully covered and the number and complexity of test cases have increased dramatically, how to use as few test cases as possible to cover all test scenarios while reducing the complexity of test cases has become an urgent problem to be solved. Summary of the invention

[0003] The present disclosure provides a control combination test method and device, electronic device and storage medium, the main purpose of which is to reduce the complexity of test cases while covering as comprehensive test scenarios as possible.

[0004] According to a first aspect of the present disclosure, a method for controlling a combination of controls is provided, comprising:

[0005] Analyze the test requirements under the target test scenario, obtain the corresponding preset test fragments from the preset test fragment library based on the analysis results, and generate a test fragment set, wherein the test fragments are used to operate the control in a preset interactive manner for testing in different test scenarios;

[0006] Obtain controls in the target test scenario and establish a temporary control set;

[0007] Based on the preset test fragments in the test fragment set, select controls in the temporary control set and generate a test case set;

[0008] Execute the test cases in the test case set to perform testing, and obtain the test results under the target test scenario.

[0009] In some embodiments, before analyzing the test requirements in the target test scenario and generating the test segment set based on the analysis results, the method further includes:

[0010] Obtaining the association relationship between controls in different pages under different test scenarios, and establishing a map based on the association relationship and generating a preset map library, wherein the map is a collection of the pages under different test scenarios;

[0011] Obtain a collection of all controls in the preset atlas library and generate a preset control library;

[0012] Obtain preset test clips under different test scenarios and generate a preset test clip library.

[0013] In some embodiments, analyzing the test requirements in the target test scenario, acquiring corresponding preset test segments from a preset test segment library based on the analysis results, and generating a test segment set include:

[0014] Matching the target test scenario according to the analysis result to obtain a preset test segment in the preset test segment library that can meet the test requirements;

[0015] If the test requirements cannot be fully met, then the corresponding test fragments are obtained based on the unmet test requirements;

[0016] The preset test segments and / or the required test segments are combined into the test segment set.

[0017] In some embodiments, the obtaining of controls in the target test scenario and establishing a temporary control set includes:

[0018] Capturing controls in all pages under the target test scenario, wherein the controls include real controls and virtual controls;

[0019] Based on the mapping relationship between the page and the control, the temporary control set in the target test scenario is established.

[0020] In some embodiments, the selecting controls in the temporary control set and generating a test case set based on the test fragments in the test fragment set includes:

[0021] Determining whether there is the preset test segment that must be executed in the target test scenario;

[0022] If the preset test fragment that must be executed exists, generating a set of controls that must be tested and selecting controls from the set of controls that must be tested to generate the set of test cases;

[0023] If the preset test segment that must be executed does not exist, determining whether there is an unexecuted control under the page of the target test scenario;

[0024] If there are unexecuted controls, generating an unexecuted control set and selecting controls from the unexecuted controls to generate the test case set;

[0025] If there is no unexecuted control, controls are randomly selected from the temporary control set according to preset weights to generate the test case set.

[0026] In some embodiments, after executing the test cases in the test case set for testing, the method further includes:

[0027] After the test case is executed, verify whether the test of the target test scenario reaches the scenario switching threshold;

[0028] If it is reached, switch to the next test scenario for testing; if it is not reached, retest the target test scenario.

[0029] According to a second aspect of the present disclosure, a device for controlling a combination of controls is provided, comprising:

[0030] An analysis unit, used to analyze the test requirements under the target test scenario, obtain corresponding preset test fragments from the preset test fragment library based on the analysis results, and generate a test fragment set, wherein the test fragments are used to operate the control in a preset interactive manner for testing in different test scenarios;

[0031] An acquisition unit, used to acquire controls in the target test scenario and establish a temporary control set;

[0032] A first generating unit, configured to select controls in the temporary control set and generate a test case set based on preset test fragments in the test fragment set;

[0033] The execution unit is used to execute the test cases in the test case set to perform testing and obtain the test results under the target test scenario.

[0034] In some embodiments, the apparatus further comprises:

[0035] The second generating unit is used for obtaining the association relationship between the controls in different pages under different test scenarios before the analyzing unit analyzes the test requirements under the target test scenario and generates the test fragment set based on the analysis result, and establishing a graph according to the association relationship and generating a preset graph library, wherein the graph is a set of the pages under different test scenarios;

[0036] A third generating unit is used to obtain a set of all controls in the preset atlas library and generate a preset control library;

[0037] The fourth generating unit is used to obtain preset test clips in different test scenarios and generate a preset test clip library.

[0038] In some embodiments, the analysis unit comprises:

[0039] An acquisition module, configured to match the target test scenario according to the analysis result, so as to acquire a preset test segment in the preset test segment library that can meet the test requirements;

[0040] Write a module for obtaining corresponding requirement test fragments based on the unmet test requirements if the test requirements cannot be fully met;

[0041] A combining module is used to combine the preset test segments and / or the required test segments into the test segment set.

[0042] In some embodiments, the acquisition unit includes:

[0043] A capture module, used to capture controls in all pages under the target test scenario, wherein the controls include real controls and virtual controls;

[0044] The establishment module is used to establish the temporary control set under the target test scenario based on the mapping relationship between the page and the control.

[0045] In some embodiments, the first generating unit includes:

[0046] A first determination module is used to determine whether there is a preset test segment that must be executed in the target test scenario;

[0047] A first generating module is used for generating a set of must-test controls and selecting controls from the set of must-test controls to generate the set of test cases when there is the preset test fragment that must be executed;

[0048] A second determination module is used to determine whether there is an unexecuted control under the page of the target test scenario when there is no preset test segment that must be executed;

[0049] A second generating module is used for generating a set of unexecuted controls when there are unexecuted controls and selecting controls from the unexecuted controls to generate the test case set;

[0050] The third generating module is used to randomly select controls in the temporary control set according to preset weights to generate the test case set when there are no unexecuted controls.

[0051] In some embodiments, the apparatus further comprises:

[0052] A verification unit is used to verify whether the test of the target test scenario reaches the scene switching threshold after the execution unit executes the test case in the test case set for testing and after the test case is executed; if reached, switch to the next test scenario for testing; if not reached, retest the target test scenario.

[0053] According to a third aspect of the present disclosure, there is provided an electronic device, including:

[0054] at least one processor; and

[0055] a memory communicatively connected to the at least one processor; wherein,

[0056] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method described in the first aspect.

[0057] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute the method described in the first aspect.

[0058] According to a fifth aspect of the present disclosure, a computer program product is provided, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the method as described in the first aspect above.

[0059] The present disclosure provides a method and device, electronic device and storage medium for control combination testing, which analyzes the test requirements under the target test scenario, obtains the corresponding preset test fragments from the preset test fragment library based on the analysis results, and generates a test fragment set, wherein the test fragment is used to operate the control in a preset interactive manner for testing in different test scenarios; obtains the control under the target test scenario and establishes a temporary control set; based on the preset test fragments in the test fragment set, selects the control in the temporary control set and generates a test case set; executes the test case in the test case set for testing, and obtains the test result under the target test scenario. Compared with the related art, the design of the test fragment set makes the test case more standardized and normalized, each test fragment is targeted at specific test requirements and scenarios, can more comprehensively cover various test scenarios, reduce the complexity of the test case, and can also reduce the possibility of test omissions; and the test fragments are independent and reusable units, which can be flexibly combined and reused in different test scenarios and test cases.

[0060] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present application, nor is it intended to limit the scope of the present application. Other features of the present application will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.

[0062] Figure 1 A flowchart of a control combination test method provided by an embodiment of the present disclosure;

[0063] Figure 2 A flowchart of another control combination testing method provided by an embodiment of the present disclosure;

[0064] Figure 3 A schematic diagram of the structure of a device for controlling a combination of tests provided by an embodiment of the present disclosure;

[0065] Figure 4 A schematic diagram of the structure of another device for controlling a combination of tests provided by an embodiment of the present disclosure;

[0066] Figure 5 A schematic block diagram of an exemplary electronic device provided for an embodiment of the present disclosure. DETAILED DESCRIPTION

[0067] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0068] The following describes the control combination test method and device, electronic device and storage medium of the embodiments of the present disclosure with reference to the accompanying drawings.

[0069] Figure 1 A flowchart of a control combination testing method provided in an embodiment of the present disclosure.

[0070] like Figure 1 As shown, the method comprises the following steps:

[0071] Step 101, analyze the test requirements under the target test scenario, obtain the corresponding preset test fragments from the preset test fragment library based on the analysis results, and generate a test fragment set, wherein the test fragments are used to operate the control in a preset interactive manner for testing in different test scenarios.

[0072] In the embodiments of the present disclosure, when analyzing the test requirements under the target test scenario, it is necessary to deeply understand the functional characteristics and business logic of the software product or system to be tested. This includes understanding the needs of users, the usage scenarios of the product, business processes, and potential risk points. Through in-depth research, it is possible to determine which functional points need to be tested in focus, and how to operate controls in different scenarios to verify the correctness and stability of these functional points.

[0073] Generate a set of test snippets based on the analysis results of the test requirements. Test snippets are a set of predefined, reusable test operations that describe how to operate controls in a preset interactive manner for testing in different test scenarios. Each test snippet targets a specific test requirement or scenario, and may include but is not limited to specific operation steps, expected results, and assertion conditions.

[0074] When generating test fragments, you need to identify different test scenarios related to the target test requirements, such as user interface interaction, business process verification, exception handling, etc. For each test scenario, analyze the controls that need to be operated and the interaction between them. This may include but is not limited to operations such as clicking, inputting, dragging, and selecting. Define the specific steps for how to interact with controls in different scenarios. For example, in a certain test scenario, you may need to click a button first, then enter specific data, and then verify whether the control's response is as expected. Prepare corresponding test data for each test fragment to ensure the effectiveness and reliability of the test.

[0075] By taking all these factors into consideration, a series of test fragments can be generated, each of which targets a specific test requirement and scenario. These test fragments can be combined into test cases to verify the functionality and performance of the software during the testing process. The benefit of generating a collection of test fragments is that they can be reused, improving the efficiency and maintainability of the test. In addition, by using standardized test fragments, test requirements can be expressed more clearly, reducing ambiguity and misunderstanding, thereby improving the quality and accuracy of the test.

[0076] Step 102, obtaining controls in the target test scenario and establishing a temporary control set.

[0077] In the embodiments of the present disclosure, in order to obtain the controls under the target test scenario and establish a temporary control set, it is necessary to determine the specific scope and context of the test scenario. This usually involves having a comprehensive understanding of the functions and interfaces of the software or system in order to identify all controls related to the target test scenario.

[0078] It is necessary to first identify all controls that appear in the target test scenario. This usually involves a careful review of the software interface to determine which controls are key points of interaction, as well as their functions and expected behaviors. Once the controls are identified, they are classified according to their type and function. For example, control types such as buttons, text boxes, drop-down menus, sliders, etc. may require different testing methods and focuses. For each control, it is also necessary to collect their attribute information, such as the control's ID, name, type, state, etc. This attribute information is critical for subsequent test automation and error diagnosis. After collecting all the necessary control information, organize these controls into a temporary control collection. This collection should be an ordered and accessible data structure to quickly reference and locate controls during subsequent testing.

[0079] In other embodiments of the present disclosure, as the test proceeds, the temporary control set may need to be continuously updated and maintained. For example, if the software interface changes, the control set may need to be updated to reflect the changes.

[0080] Step 103: Based on the preset test segments in the test segment set, select controls in the temporary control set and generate a test case set.

[0081] In the embodiments of the present disclosure, the test fragment has predefined the specific steps and expected results of operating the controls in a preset interactive mode under different test scenarios. Each test fragment is designed for a specific test requirement or scenario, and they provide guidance for the testing work. According to the requirements of the test fragment, the corresponding controls are selected from the temporary control set. The controls associated with the test fragment will be selected based on the operating steps and interaction methods described in the test fragment. These controls will be the objects we operate when performing the test. When selecting controls, certain screening rules need to be followed, and it is necessary to ensure that the selected controls match the operations and interaction methods described in the test fragment.

[0082] After selecting the controls associated with the test fragments, you can start generating a collection of test cases. This process involves matching each test fragment with the selected controls and generating the corresponding test cases. Each test case should contain specific test steps, expected results, and assertion conditions to be verified when the test is executed. When generating a collection of test cases, you need to ensure that each test case is independent and executable.

[0083] Step 104: execute the test cases in the test case set to perform testing, and obtain the test results under the target test scenario.

[0084] In the embodiment of the present disclosure, before executing the test cases in the test case set for testing, it is necessary to prepare the test environment and ensure that the required hardware, software, network and other resources are ready and configured correctly. This can ensure the reliability and accuracy of the test results. The test cases are executed one by one in the order in the test case set. Each test case includes a set of predefined test steps and expected results.

[0085] During the test execution process, the test results corresponding to each test case in the target test scenario are collected and a data analysis report is generated. Various test data can also be collected, such as test execution time, resource consumption, error rate, etc. These data will be used to evaluate the effectiveness of the test and provide a reference for subsequent testing work. Through this process, we can comprehensively evaluate the functions and performance of the software in the target test scenario to ensure the quality and stability of the product.

[0086] The present disclosure provides a method for control combination testing, which analyzes the test requirements under the target test scenario, obtains the corresponding preset test fragments from the preset test fragment library based on the analysis results, and generates a test fragment set, wherein the test fragment is used to operate the control in a preset interactive manner for testing in different test scenarios; obtains the control under the target test scenario, and establishes a temporary control set; based on the preset test fragments in the test fragment set, selects the control in the temporary control set and generates a test case set; executes the test case in the test case set for testing, and obtains the test result under the target test scenario. Compared with the related art, the design of the test fragment set makes the test case more standardized and normalized, each test fragment is targeted at specific test requirements and scenarios, can cover various test scenarios more comprehensively, reduce the complexity of the test case, and thus reduce the possibility of test omissions; and the test fragments are independent, reusable units, which can be flexibly combined and reused in different test scenarios and test cases.

[0087] In order to clearly illustrate the embodiment of the present disclosure, this embodiment provides a flowchart of another method for controlling a combination of tests.

[0088] like Figure 2 As shown, the method comprises the following steps:

[0089] Step 201, obtaining the association relationship between controls in different pages under different test scenarios, and establishing a map based on the association relationship and generating a preset map library, wherein the map is a collection of the pages under different test scenarios.

[0090] Step 202, obtain a collection of all controls in the preset atlas library and generate a preset control library.

[0091] Step 203: Obtain preset test clips in different test scenarios and generate a preset test clip library.

[0092] Specifically, in steps 201 to 203, in order to obtain the association relationship between controls in different pages in different test scenarios, each test scenario needs to be analyzed in detail. This involves an in-depth investigation of the controls on each page to understand how they interact with each other and their position in the entire business process. The association relationship between controls may include but is not limited to parent-child relationship, dependency relationship, trigger relationship, etc., which are all necessary information for building a graph. After clarifying these association relationships, a graph can be built. This graph will show how the controls on each page are connected and interact with each other in different test scenarios. Each page can be regarded as a node in the graph, and the association relationship between controls can be represented by edges. In this way, we can clearly see the structure and position of each page and control in the entire test scenario. In order to better manage and use these graphs, they will be stored in a preset graph library. This library will contain a collection of pages in all test scenarios, each page has its associated controls and the relationship between them. In this way, when you need to refer to or use the graph of a certain test scenario, you can quickly find it from the library.

[0093] By extracting all controls from each graph and integrating them into a preset control library, this library will contain all controls that have appeared in all test scenarios, as well as their properties and functions. This makes it easy to find and reuse these controls later, improving the efficiency of testing work.

[0094] By collecting test clips in different test scenarios and organizing them into a preset test clip library, each test clip will be recorded and classified in detail so that it can be easily used in subsequent testing work. It can provide rich testing resources and experience to help us design and execute test cases more efficiently.

[0095] Step 204 : matching the target test scenario according to the analysis result to obtain preset test segments in the preset test segment library that can meet the test requirements.

[0096] Specifically, in step 204, after obtaining the analysis results of the test requirements in the target test scenario, these analysis results are matched with the preset test segment library to find the preset test segments that can meet the current test requirements.

[0097] Compare these analysis results with the preset test fragment library. This process involves reviewing each test fragment in the test fragment library to evaluate whether it can cover the key functions and business processes in the target test scenario. Factors such as the coverage of the test fragment, the level of detail of the test steps, and the accuracy of the expected results may be considered, but are not limited to.

[0098] After finding the preset test pieces that meet the test needs, they can be incorporated into our test plan. This may involve making appropriate modifications and adjustments to the test pieces to ensure that they can fully adapt to the specific needs of the target test scenario.

[0099] Step 205: If the test requirements cannot be fully met, then corresponding test requirement fragments are obtained based on the unmet test requirements.

[0100] Specifically in step 205, if it is found during the matching process that the test fragments in the preset test fragment library cannot fully meet all the test requirements of the target test scenario, then it is necessary to write corresponding new test fragments based on those unmet test requirements. Based on these unmet test requirements, start writing new test fragments. During the writing process, we need to ensure that the test fragments have clear test purposes and steps, and can accurately verify the specific requirements in the target test scenario. This may involve but is not limited to designing new test cases, writing detailed test steps, defining expected results, etc.

[0101] Step 206: Combine the preset test segments and / or the required test segments into the test segment set.

[0102] Specifically, in step 206, the test segments obtained in step 205 and / or step 206 are combined into a test segment set.

[0103] Step 207, capturing controls in all pages in the target test scenario, wherein the controls include real controls and virtual controls.

[0104] Step 208: Based on the mapping relationship between the page and the control, the temporary control set in the target test scenario is established.

[0105] Specifically, in step 207 to step 208, in order to comprehensively evaluate the page functions and user experience in the target test scenario, it is necessary to capture all controls in the page, including real controls and virtual controls. Real controls refer to elements that actually exist on the page and that users can directly interact with, such as buttons, input boxes, links, etc. Virtual controls refer to those controls that are generated by code logic or frameworks and are not directly displayed on the page, such as some hidden elements or content awakened by voice assistants.

[0106] In the process of grabbing controls, the control information on the page is identified and extracted. This information may include but is not limited to the type, name, properties, location, etc. of the control, which is crucial for subsequent testing and analysis. After obtaining the control information, temporary control sets corresponding to different pages are established according to the type of control and the page structure. These sets will contain all real controls and virtual controls on the page and are organized according to their logical structure on the page. This will provide a clearer understanding of the control layout and function distribution of the page, facilitating subsequent testing work.

[0107] At the same time, we also need to pay attention to the association between controls. For example, a button control may be associated with an input box control, and the content of the input box may change after the user clicks the button. Therefore, when establishing a temporary control collection, we also need to record the association information between controls so that we can more accurately simulate user operations during subsequent testing and analysis.

[0108] Step 209: Based on the preset test segments in the test segment set, select controls in the temporary control set and generate a test case set.

[0109] As an implementable manner of this embodiment, the selecting of controls in the temporary control set and generating a test case set based on the test fragments in the test fragment set may be in the following manners, but not limited to:

[0110] Determine whether there is a preset test fragment that must be executed under the target test scenario; if there is a preset test fragment that must be executed, generate a set of controls that must be tested and select controls from the set of controls that must be tested to generate the test case set; if there is no preset test fragment that must be executed, determine whether there are unexecuted controls on the page of the target test scenario; if there are unexecuted controls, generate a set of unexecuted controls and select controls from the unexecuted controls to generate the test case set; if there are no unexecuted controls, randomly select controls from the zero-time control set according to preset weights to generate the test case set.

[0111] Specifically in step 209, it is necessary to first determine whether there are test fragments that must be executed in the target test scenario. These fragments that must be executed are usually closely related to core functions or key business processes, and their execution is crucial to ensuring the quality and performance of the software. If there are fragments that must be executed, a set of must-test controls will be generated. This set will contain controls associated with these must-execute fragments. Controls are selected from the must-test control set to generate a test case set. This ensures that the test case set contains test cases for core functions and key business processes, thereby ensuring the comprehensiveness and accuracy of the test.

[0112] If there are no required sections in the target test scenario, it is necessary to determine whether there are unexecuted controls in the target test scenario page. These unexecuted controls are controls that were not covered in the previous test process. If there are unexecuted controls, an unexecuted control set will be generated, and controls will be selected from the set to generate a test case set. This ensures that the test case set contains test cases for controls that were not covered before, thereby improving the coverage and quality of the test.

[0113] If there are neither required execution segments nor unexecuted controls in the target test scenario, it is necessary to randomly select controls from the temporary control set according to the preset weights to generate a test case set. The preset weights here can be set based on factors such as the importance and frequency of use of the control. By randomly selecting controls, we can ensure the diversity and randomness of the test case set, thereby more comprehensively evaluating the quality and performance of the software.

[0114] Step 210: After the test case is executed, check whether the test of the target test scenario reaches the scenario switching threshold.

[0115] If it is reached, switch to the next test scenario for testing; if it is not reached, retest the target test scenario.

[0116] Specifically in step 210, after each test case is executed, it is necessary to verify whether the target test scenario meets a specific switching condition, i.e., the scene switching threshold. This threshold is set according to the test requirements and the characteristics of the target test scenario. It may involve multiple aspects such as test coverage, error rate, performance indicators, etc., or it may be set by the execution step length. By collecting relevant data after the test case is executed, including test results, performance data, error reports, etc. These data are important bases for evaluating whether the test scenario reaches the switching threshold. By analyzing these data, we can understand the test situation of the target test scenario, including which functions are covered, which parts have problems, and how the performance is. According to the collected data, it is compared with the switching threshold of the target test scenario. If the test coverage reaches the preset threshold, or the error rate is reduced to an acceptable range, or the performance indicator meets the requirements, then we can consider that the target test scenario has passed the test and can switch to the next test scenario for testing.

[0117] It should be noted that the embodiments of the present disclosure may include multiple steps. For the convenience of description, these steps are numbered, but these numbers do not limit the execution time slots or execution order between the steps; these steps can be implemented in any order, and the embodiments of the present disclosure do not limit this.

[0118] Corresponding to the above control combination test method, the present invention also provides a control combination test device. Since the device embodiment of the present invention corresponds to the above method embodiment, the details not disclosed in the device embodiment can be referred to the above method embodiment, and will not be repeated in the present invention.

[0119] Figure 3 A schematic diagram of a control combination test device provided by an embodiment of the present disclosure, such as Figure 3 As shown, including:

[0120] An analysis unit 31 is used to analyze the test requirements under the target test scenario, obtain the corresponding preset test fragments from the preset test fragment library based on the analysis results, and generate a test fragment set, wherein the test fragments are used to operate the control in a preset interactive manner for testing in different test scenarios;

[0121] An acquisition unit 32, used to acquire controls in the target test scenario and establish a temporary control set;

[0122] A first generating unit 33, configured to select controls in the temporary control set and generate a test case set based on preset test fragments in the test fragment set;

[0123] The execution unit 34 is used to execute the test cases in the test case set to perform testing and obtain the test results under the target test scenario.

[0124] The present disclosure provides a device for control combination testing, which analyzes the test requirements under the target test scenario, obtains the corresponding preset test fragments from the preset test fragment library based on the analysis results, and generates a test fragment set, wherein the test fragment is used to operate the control in a preset interactive manner for testing in different test scenarios; obtains the control under the target test scenario, and establishes a temporary control set; based on the preset test fragments in the test fragment set, selects the control in the temporary control set and generates a test case set; executes the test case in the test case set for testing, and obtains the test result under the target test scenario. Compared with the related art, the design of the test fragment set makes the test case more standardized and normalized, each test fragment is targeted at specific test requirements and scenarios, can more comprehensively cover various test scenarios, reduce the complexity of the test case, and thus reduce the possibility of test omissions; and the test fragments are independent, reusable units, which can be flexibly combined and reused in different test scenarios and test cases.

[0125] Furthermore, in a possible implementation of this embodiment, as Figure 4 As shown, the device also includes:

[0126] The second generating unit 35 is used for obtaining the association relationship between the controls in different pages under different test scenarios before the analyzing unit analyzes the test requirements under the target test scenario and generates the test fragment set based on the analysis result, and establishing a map according to the association relationship and generating a preset map library, wherein the map is a set of the pages under different test scenarios;

[0127] The third generating unit 36 ​​is used to obtain a set of all controls in the preset atlas library and generate a preset control library;

[0128] The fourth generating unit 37 is used to obtain preset test segments in different test scenarios and generate a preset test segment library.

[0129] Furthermore, in a possible implementation of this embodiment, as Figure 4 As shown, the analysis unit 31 includes:

[0130] An acquisition module 311 is used to match the target test scenario according to the analysis result to obtain a preset test segment in a preset test segment library that can meet the test requirements;

[0131] A writing module 312 is used to obtain corresponding requirement test fragments based on the unsatisfied test requirements if the test requirements cannot be fully met;

[0132] The combining module 313 is configured to combine the preset test segments and / or the required test segments into the test segment set.

[0133] Furthermore, in a possible implementation of this embodiment, as Figure 4 As shown, the acquisition unit 32 includes:

[0134] A capture module 321 is used to capture controls in all pages under the target test scenario, wherein the controls include real controls and virtual controls;

[0135] The establishing module 322 is used to establish the temporary control set in the target test scenario based on the mapping relationship between the page and the control.

[0136] Furthermore, in a possible implementation of this embodiment, as Figure 4 As shown, the first generating unit 33 includes:

[0137] A first determination module 331 is used to determine whether there is a preset test segment that must be executed in the target test scenario;

[0138] The first generating module 332 is used for generating a set of must-test controls and selecting controls from the set of must-test controls to generate the set of test cases when there is the preset test segment that must be executed;

[0139] A second determination module 333 is used to determine whether there is an unexecuted control under the page of the target test scenario when there is no preset test segment that must be executed;

[0140] The second generating module 334 is used for generating a set of unexecuted controls when there are unexecuted controls and selecting controls from the unexecuted controls to generate the test case set;

[0141] The third generating module 335 is used to randomly select controls from the zero-time control set according to preset weights to generate the test case set when there are no unexecuted controls.

[0142] Furthermore, in a possible implementation of this embodiment, as Figure 4 As shown, the device also includes:

[0143] The verification unit 38 is used to verify whether the test of the target test scenario reaches the scene switching threshold after the execution unit executes the test case in the test case set for testing and after the test case is executed; if reached, switch to the next test scenario for testing; if not reached, retest the target test scenario.

[0144] It should be noted that the above explanation of the method embodiment is also applicable to the device of this embodiment, and the principle is the same, which is not limited in this embodiment.

[0145] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.

[0146] Figure 5 A schematic block diagram of an example electronic device 400 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.

[0147] like Figure 5As shown, the device 400 includes a computing unit 401, which can perform various appropriate actions and processes according to a computer program stored in a ROM (Read-Only Memory) 402 or a computer program loaded from a storage unit 408 to a RAM (Random Access Memory) 403. In the RAM 403, various programs and data required for the operation of the device 400 can also be stored. The computing unit 401, the ROM 402, and the RAM 403 are connected to each other via a bus 404. An I / O (Input / Output) interface 405 is also connected to the bus 404.

[0148] A number of components in the device 400 are connected to the I / O interface 405, including: an input unit 406, such as a keyboard, a mouse, etc.; an output unit 407, such as various types of displays, speakers, etc.; a storage unit 408, such as a disk, an optical disk, etc.; and a communication unit 409, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 409 allows the device 400 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0149] The computing unit 401 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 401 include, but are not limited to, a CPU (Central Processing Unit), a GPU (Graphic Processing Units), various dedicated AI (Artificial Intelligence) computing chips, various computing units running machine learning model algorithms, a DSP (Digital Signal Processor), and any appropriate processor, controller, microcontroller, etc. The computing unit 401 performs the various methods and processes described above, such as a method for control combination testing. For example, in some embodiments, the method for control combination testing may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 408. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 400 via the ROM 402 and / or the communication unit 409. When the computer program is loaded into the RAM 403 and executed by the computing unit 401, one or more steps of the method described above may be performed. Alternatively, in other embodiments, the computing unit 401 may be configured to execute the aforementioned control combination test method in any other appropriate manner (for example, by means of firmware).

[0150] Various embodiments of the systems and techniques described above herein may be implemented in digital electronic circuit systems, integrated circuit systems, FPGAs (Field Programmable Gate Arrays), ASICs (Application-Specific Integrated Circuits), ASSPs (Application Specific Standard Products), SOCs (System On Chips), CPLDs (Complex Programmable Logic Devices), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include: being implemented in one or more computer programs that may be executed and / or interpreted on a programmable system including at least one programmable processor that may be a dedicated or general-purpose programmable processor that may receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0151] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0152] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any suitable combination of the foregoing. More specific examples of machine-readable storage media may include electrical connections based on one or more lines, portable computer disks, hard disks, RAM, ROM, EPROM (Electrically Programmable Read-Only-Memory) or flash memory, optical fiber, CD-ROM (Compact Disc Read-Only Memory), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0153] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (Cathode-Ray Tube) or LCD (Liquid Crystal Display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0154] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: LAN (Local Area Network), WAN (Wide Area Network), the Internet, and blockchain networks.

[0155] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services ("Virtual Private Server", or "VPS" for short). The server may also be a server of a distributed system, or a server combined with a blockchain.

[0156] It should be noted that artificial intelligence is a discipline that studies how computers can simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, planning, etc.), and includes both hardware-level and software-level technologies. Artificial intelligence hardware technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, and big data processing; artificial intelligence software technologies mainly include computer vision technology, speech recognition technology, natural language processing technology, as well as machine learning / deep learning, big data processing technology, knowledge graph technology, and other major directions.

[0157] The various numerical numbers such as first and second involved in the present disclosure are only for the convenience of description and are not used to limit the scope of the embodiments of the present disclosure, but also indicate the order of precedence.

[0158] At least one in the present disclosure may also be described as one or more, and a plurality may be two, three, four or more, which is not limited in the present disclosure. In the embodiments of the present disclosure, for a technical feature, the technical features in the technical feature are distinguished by "first", "second", "third", "A", "B", "C" and "D", etc., and there is no order of precedence or size between the technical features described by the "first", "second", "third", "A", "B", "C" and "D".

[0159] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

[0160] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. A method for controlling a combination of tests, characterized in that: include: Analyze the test requirements under the target test scenario, obtain the corresponding preset test fragments from the preset test fragment library based on the analysis results, and generate a test fragment set, wherein the preset test fragments are used to operate the control in a preset interactive manner for testing in different test scenarios; Obtain controls in the target test scenario and establish a temporary control set; Based on the preset test fragments in the test fragment set, select controls in the temporary control set and generate a test case set; Execute the test cases in the test case set to perform testing, and obtain the test results under the target test scenario.

2. The method according to claim 1, characterized in that Before analyzing the test requirements in the target test scenario and generating a test segment set based on the analysis results, the method further includes: Obtaining the association relationship between controls in different pages under different test scenarios, and establishing a map based on the association relationship and generating a preset map library, wherein the map is a collection of the pages under different test scenarios; Obtain a collection of all controls in the preset atlas library and generate a preset control library; Obtain preset test clips under different test scenarios and generate a preset test clip library.

3. The method according to claim 1, characterized in that: The test requirements under the target test scenario are analyzed, corresponding preset test segments are obtained from the preset test segment library based on the analysis results, and a test segment set is generated, including: Matching the target test scenario according to the analysis result to obtain a preset test segment in the preset test segment library that can meet the test requirements; If the test requirements cannot be fully met, then the corresponding test fragments are obtained based on the unmet test requirements; The preset test segments and / or the required test segments are combined into the test segment set.

4. The method according to claim 1, characterized in that The obtaining of the controls in the target test scenario and establishing a temporary control set includes: Capturing controls in all pages under the target test scenario, wherein the controls include real controls and virtual controls; Based on the mapping relationship between the page and the control, the temporary control set in the target test scenario is established.

5. The method according to claim 1, characterized in that The selecting controls in the temporary control set and generating a test case set based on the test fragments in the test fragment set includes: Determining whether there is the preset test segment that must be executed in the target test scenario; If the preset test fragment that must be executed exists, generating a set of controls that must be tested and selecting controls from the set of controls that must be tested to generate the set of test cases; If the preset test segment that must be executed does not exist, determining whether there is an unexecuted control under the page of the target test scenario; If there are unexecuted controls, generating an unexecuted control set and selecting controls from the unexecuted controls to generate the test case set; If there is no unexecuted control, controls are randomly selected from the temporary control set according to preset weights to generate the test case set.

6. The method according to claim 1, characterized in that After executing the test cases in the test case set for testing, the method further includes: After the test case is executed, verify whether the test of the target test scenario reaches the scenario switching threshold; If it is reached, switch to the next test scenario for testing; if it is not reached, retest the target test scenario.

7. A device for controlling a combination of tests, characterized in that: include: An analysis unit, used to analyze the test requirements under the target test scenario, obtain corresponding preset test fragments from the preset test fragment library based on the analysis results, and generate a test fragment set, wherein the test fragments are used to operate the control in a preset interactive manner for testing in different test scenarios; An acquisition unit, used to acquire controls in the target test scenario and establish a temporary control set; A generating unit, configured to select controls in the temporary control set and generate a test case set based on preset test fragments in the test fragment set; The execution unit is used to execute the test cases in the test case set to perform testing and obtain the test results under the target test scenario.

8. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 6.

9. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-6.

10. A computer program product, characterized in that The invention comprises a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Method for testing Android application controls

    CN104834600A

  • Control object library generation method and device and computer readable storage medium

    CN110413518A

  • Test method and device, storage medium and computer equipment

    CN110928763A

  • Test case generation method and device, medium and electronic equipment

    CN116401173A

  • Method for generating APP test script based on knowledge graph

    CN117591398A