A test method, device and electronic equipment

By acquiring and tagging the initial test script, generating the target test script, and automating the testing of each test case, the problem of inefficient boundary testing in complex business processes is solved, achieving accurate coverage and efficiency improvement.

CN116089312BActive Publication Date: 2025-12-30SHANGHAI ZHONGTONGJI NETWORK TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310180659.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-28
Publication Date
2025-12-30
Estimated Expiration
2043-02-28

AI Technical Summary

Technical Problem

Existing technologies are inefficient and inaccurate in boundary testing of complex business processes, requiring a large amount of manual test case writing.

Method used

By obtaining the initial test script, marking the content that meets the requirements of the test scenario, generating the target test script, analyzing and testing each test case one by one, automated testing is achieved.

Benefits of technology

It achieves precise coverage of complex business processes, improves testing efficiency and accuracy, and solves the problem of low efficiency in existing technologies.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116089312B_ABST
    Figure CN116089312B_ABST
Patent Text Reader

Abstract

The application belongs to the technical field of testing, and particularly relates to a testing method, device and electronic equipment, which obtains an initial testing script corresponding to a testing scene, marks content meeting the demand of the testing scene in the initial testing script to obtain a target testing script, analyzes the target testing script, obtains all possible use cases in the testing scene, tests each use case one by one to generate a testing result, and performs automatic testing through the marked target testing script, so that accurate coverage of testing use cases in boundary testing of a complex business process is realized, the testing efficiency is improved, and the problem that the prior art cannot efficiently and accurately perform boundary testing on the complex business process is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of testing technology, specifically relating to a testing method, apparatus, and electronic device. Background Technology

[0002] Currently, in integrated development scenarios, complex systems are essentially standard for medium to large companies. Examples include order processing, approval workflows, and other multi-state business processing objects. In complex business scenarios, testing these complex processes requires a large number of test cases to cover boundary conditions. Existing technical solutions use testing tools such as JMeter, Robot Framework, and Postman to perform boundary testing on specific complex business processes. While these tools are capable, they require a significant amount of manual work in writing test cases. This not only reduces overall testing efficiency but also lowers the accuracy of test cases due to the manual maintenance required. Summary of the Invention

[0003] In view of this, the purpose of the present invention is to provide a testing method, apparatus and electronic device to solve the problem that the existing technical solutions cannot efficiently and accurately perform boundary testing on complex business processes.

[0004] According to a first aspect of the present invention, a testing method is provided, comprising:

[0005] Obtain the initial test script corresponding to the test scenario;

[0006] Mark the content in the initial test script that meets the requirements of the test scenario to obtain the target test script;

[0007] Analyze the target test script to obtain all possible test cases in the test scenario, and test each test case one by one to generate test results.

[0008] Preferably, the step of marking the content in the initial test script that meets the requirements of the test scenario to obtain the target test script includes:

[0009] The business process of obtaining confirmation from business personnel;

[0010] Mark the content in the initial test script that corresponds to the business process.

[0011] Preferably, marking the content in the initial test script corresponding to the business process includes:

[0012] Add marker code to the content corresponding to the business process in the initial test script.

[0013] Preferably, the step of analyzing the target test script to obtain all possible use cases in the test scenario includes:

[0014] By analyzing the marked code in the target test script, all possible test cases in the test scenario can be obtained.

[0015] Preferably, the step of generating test results by testing each test case one by one includes:

[0016] The test is conducted by attempting the operation corresponding to each test case in the entire process.

[0017] Generate visual results.

[0018] Preferably, the method further includes:

[0019] The initial test script was pre-recorded using a packet capture tool;

[0020] Remove some unnecessary code from the initial test script, and / or mark some specific relationships.

[0021] According to a second aspect of the present invention, a testing apparatus is provided, comprising:

[0022] The acquisition module is used to retrieve the initial test script corresponding to the test scenario.

[0023] The tagging module is used to tag content in the initial test script that meets the requirements of the test scenario, thereby obtaining the target test script;

[0024] The testing module is used to analyze the target test script, obtain all possible test cases in the test scenario, and test each test case one by one to generate test results.

[0025] According to a second aspect of the present invention, an electronic device is provided, comprising: the testing apparatus described above.

[0026] The technical solutions provided by the embodiments of the present invention may include the following beneficial effects:

[0027] By obtaining the initial test script corresponding to the test scenario, marking the content in the initial test script that meets the requirements of the test scenario to obtain the target test script, analyzing the target test script to obtain all possible test cases in the test scenario, and testing each test case one by one to generate test results, and performing automated testing through the marked target test script, accurate coverage of test cases is achieved when performing boundary testing on complex business processes, while improving testing efficiency and solving the problem that existing technical solutions cannot efficiently and accurately perform boundary testing on complex business processes.

[0028] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description

[0029] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0030] Figure 1 This is a flowchart illustrating a testing method according to an exemplary embodiment;

[0031] Figure 2 This is a schematic block diagram of a testing apparatus according to an exemplary embodiment. Detailed Implementation

[0032] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of apparatuses and methods consistent with some aspects of the invention as detailed in the appended claims.

[0033] Please see Figure 1 , Figure 1 This is a flowchart illustrating a testing method according to an exemplary embodiment, such as... Figure 1 As shown, the test method includes:

[0034] Step S11: Obtain the initial test script corresponding to the test scenario;

[0035] Step S12: Mark the content in the initial test script that meets the requirements of the test scenario to obtain the target test script;

[0036] Step S13: Analyze the target test script to obtain all possible test cases in the test scenario, and test each test case one by one to generate test results.

[0037] It should be noted that, in practice, the test method provided in this embodiment needs to be loaded into the controller of the electronic device and run.

[0038] The electronic devices include, but are not limited to: mobile phones, tablets, desktop computers, etc.

[0039] It is understood that the technical solution provided in this embodiment,

[0040] By obtaining the initial test script corresponding to the test scenario, marking the content in the initial test script that meets the requirements of the test scenario to obtain the target test script, analyzing the target test script to obtain all possible test cases in the test scenario, and testing each test case one by one to generate test results, and performing automated testing through the marked target test script, accurate coverage of test cases is achieved when performing boundary testing on complex business processes, while improving testing efficiency and solving the problem that existing technical solutions cannot efficiently and accurately perform boundary testing on complex business processes.

[0041] In practice, the "initial test script" mentioned in step S11 refers to a script pre-recorded using a packet capture tool in the corresponding test scenario. After obtaining the recorded initial test script, it is necessary to preprocess the initial test script. The preprocessing specifically includes: deleting some unnecessary code from the initial test script, and / or marking some specific relationships.

[0042] It should be noted that the specific relationship marked here refers to the necessary relationship when executing the script. For example, if the output parameter of script 1 is the input parameter of script 2, then the relationship between the two needs to be marked in the script before execution.

[0043] Step S12, "Marking the content in the initial test script that meets the test scenario requirements to obtain the target test script," includes:

[0044] 1. Business process for obtaining confirmation from business personnel.

[0045] In practice, for boundary testing of business processes in complex scenarios, it is first necessary to confirm with business personnel whether the business process is correct in order to mark the business process later.

[0046] 2. Mark the content in the initial test script that corresponds to the business process.

[0047] In practice, marking the content in the initial test script that corresponds to the business process involves adding marking code to the content in the initial test script that corresponds to the business process.

[0048] Understandably, by acquiring a confirmed business process, testers can add marker code to the content corresponding to the business process in the initial test script to obtain the target test script, facilitating the subsequent generation of test cases. This invention's method can attempt all operations in the business flow that might trigger changes to the target content (e.g., approval process status, order status). Since the number of correct process flows is relatively small, these correct flows can be manually marked. Compared to the workload of traditional manual maintenance of test cases, simply marking the test objects that need attention will significantly reduce labor costs.

[0049] Step S13, "Analyze the target test script to obtain all possible use cases in the test scenario," includes:

[0050] By analyzing the marked code in the target test script, all possible test cases in the test scenario can be obtained.

[0051] Understandably, by analyzing the marked code in the target test script, the boundaries of the test can be determined, thereby obtaining all possible test cases.

[0052] Step S13, "Test each test case one by one and generate test results," includes:

[0053] 1. Test by attempting the operation corresponding to each test case in the entire process;

[0054] 2. Generate visualized results.

[0055] In practice, the testing method of this invention tests the entire process by attempting all operations, including legal operations, business-illegal operations, and non-compliant operations, thereby achieving comprehensive integration test coverage.

[0056] Understandably, after analyzing the target test script, a comprehensive test of the business logic can be performed to ensure that all correct business processes are functional and all incorrect processes are not. Furthermore, the engine supports more granular assertion verification. During testing, the system automatically calculates the probability of logical connections between each process based on the overall process description, cross-compares possible operations to generate expected outcomes, and ultimately determines whether the expectations match the actual results. During automated testing, the system can archive each test result and input them graphically. Testers can then perform targeted, detailed testing based on a specific state or combination of states from historical test results.

[0057] Understandably, the testing method of this invention saves testing time while allowing testers to directly and rigorously control the entire system's flow. Furthermore, it visualizes the test path and outputs test results, significantly improving the testing implementation for the explosive growth of boundary combination test cases in complex software systems.

[0058] It is understood that the testing method provided in this application is used to perform boundary testing on complex business processes. By obtaining an initial test script corresponding to a test scenario, marking the content in the initial test script that meets the requirements of the test scenario to obtain a target test script, analyzing the target test script to obtain all possible test cases in the test scenario, and testing each test case one by one to generate test results, automated testing is performed using the marked target test script. This achieves accurate coverage of test cases when performing boundary testing on complex business processes, while improving testing efficiency and solving the problem that existing technical solutions cannot efficiently and accurately perform boundary testing on complex business processes.

[0059] Please see Figure 2 , Figure 2 This is a schematic block diagram of a testing apparatus according to an exemplary embodiment, such as... Figure 2 As shown, the testing apparatus 100 includes:

[0060] Module 101 is used to obtain the initial test script corresponding to the test scenario;

[0061] The marking module 102 is used to mark the content in the initial test script that meets the requirements of the test scenario, so as to obtain the target test script;

[0062] The test module 103 is used to analyze the target test script, obtain all possible test cases in the test scenario, and test each test case one by one to generate test results.

[0063] Regarding the testing device 100 in this embodiment, the specific manner in which its acquisition module 101, marking module 102, and testing module 103 execute the above method has been described in detail in the embodiments related to the method, and will not be elaborated here.

[0064] It is understood that the technical solution provided in this embodiment obtains an initial test script corresponding to the test scenario, marks the content in the initial test script that meets the requirements of the test scenario to obtain a target test script, analyzes the target test script to obtain all possible test cases in the test scenario, and tests each test case one by one to generate test results. By performing automated testing through the marked target test script, it achieves accurate coverage of test cases when performing boundary testing on complex business processes, improves testing efficiency, and solves the problem that existing technical solutions cannot efficiently and accurately perform boundary testing on complex business processes.

[0065] An electronic device is shown according to an exemplary embodiment, the electronic device including the test apparatus 100 described above.

[0066] Regarding the electronic device including the testing device in the above embodiments, the specific manner in which the testing device performs the above method has been described in detail in the embodiments related to the method, and will not be elaborated here.

[0067] In practice, the electronic device can be a mobile phone, tablet computer, desktop computer, etc., that has the testing device installed.

[0068] It is understood that the technical solution provided in this embodiment includes the aforementioned testing device. This testing device obtains a target test script by acquiring an initial test script corresponding to the test scenario, marking the content in the initial test script that meets the requirements of the test scenario, analyzing the target test script to obtain all possible test cases in the test scenario, and testing each test case one by one to generate test results. By performing automated testing through the marked target test script, accurate coverage of test cases is achieved when performing boundary testing on complex business processes. At the same time, testing efficiency is improved, and the problem that existing technical solutions cannot efficiently and accurately perform boundary testing on complex business processes is solved.

[0069] Furthermore, this application provides a computer-readable storage medium storing computer instructions for causing a computer to perform the steps of any of the methods described above. The storage medium may be a magnetic disk, optical disk, read-only memory (ROM), random access memory (RAM), flash memory, hard disk drive (HDD), or solid-state drive (SSD), etc.; the storage medium may also include combinations of the above types of memory.

[0070] It is understood that the same or similar parts in the above embodiments can be referred to each other, and the contents not described in detail in some embodiments can be referred to the same or similar contents in other embodiments.

[0071] It should be noted that in the description of this application, the terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance. Furthermore, in the description of this application, unless otherwise stated, "multiple" or "more" means at least two.

[0072] It should be understood that when an element is referred to as "fixed to" or "set on" another element, it may be directly on the other element or may have an intervening element present at the same time; when an element is referred to as "connected to" another element, it may be directly connected to the other element or may have an intervening element present at the same time. In addition, the term "connected" as used herein may include wireless connections; the word "and / or" as used includes any unit and all combinations of one or more of the associated listed items.

[0073] Any process or method description in the flowchart or otherwise herein can be understood as: representing a module, segment, or portion of code comprising one or more executable instructions for implementing a particular logical function or process, and the scope of the preferred embodiments of this application includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the function involved, as should be understood by those skilled in the art to which embodiments of this application pertain.

[0074] It should be understood that various parts of this application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.

[0075] Those skilled in the art will understand that all or part of the steps of the methods in the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, the program includes one or a combination of the steps of the method embodiments.

[0076] Furthermore, the functional units in the various embodiments of this application can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into a module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium.

[0077] The storage media mentioned above can be read-only memory, disk, or optical disk, etc.

[0078] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.

[0079] Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of this application.

Claims

1. A test method characterized by, The method comprises the following steps: acquiring an initial test script corresponding to a test scenario; marking contents in the initial test script that meet the requirements of the test scenario to obtain a target test script, including: acquiring a business flow confirmed by a business personnel; and marking contents in the initial test script that correspond to the business flow; the marking of the contents in the initial test script that correspond to the business flow comprises: adding a mark code to the contents in the initial test script that correspond to the business flow; analyzing the target test script to obtain all possible use cases in the test scenario, and testing each use case one by one to generate a test result; the all possible use cases in the test scenario comprise: determining a test boundary by analyzing the mark code in the target test script, and then obtaining all use cases; the testing each use case one by one to generate a test result comprises: testing a testable manner of an operation corresponding to each use case in the whole flow, the operation including a legal operation, a business illegal operation and a specification illegal operation; generating a visual result.

2. The method of claim 1, wherein, The method further comprises the following steps: pre-recording the initial test script by using a packet capturing tool; deleting some unnecessary codes of the initial test script, and / or marking some specific relations, the marked specific relations referring to necessary relations during execution of the script, including an out-parameter-in-parameter relation between scripts.

3. A test device, characterized in that The method comprises the following steps: an acquiring module, configured to acquire an initial test script corresponding to a test scenario; a marking module, configured to mark contents in the initial test script that meet the requirements of the test scenario to obtain a target test script, including: acquiring a business flow confirmed by a business personnel; and marking contents in the initial test script that correspond to the business flow; the marking of the contents in the initial test script that correspond to the business flow comprises: adding a mark code to the contents in the initial test script that correspond to the business flow; a testing module, configured to analyze the target test script to obtain all possible use cases in the test scenario, and test each use case one by one to generate a test result; the all possible use cases in the test scenario comprise: determining a test boundary by analyzing the mark code in the target test script, and then obtaining all use cases; the testing each use case one by one to generate a test result comprises: testing a testable manner of an operation corresponding to each use case in the whole flow, the operation including a legal operation, a business illegal operation and a specification illegal operation; generating a visual result.

4. An electronic device, comprising: The method comprises the following steps: the test device of claim 3.

Citation Information

Patent Citations

  • Method for reproducing test scripts based on data drive

    CN101526917A