Automated testing method and device
By determining the test path and input condition matching in software automation testing to generate test cases, including error values, and using a tree diagram to determine the test path, the problems of unrealistic testing and low efficiency in the existing technology are solved, and global testing is realized Automation of target points and error input handling improves test efficiency and coverage.
Patent Information
- Application Number
- CN201810193871.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2018-03-09
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2038-03-09
AI Technical Summary
The existing technology lacks a global perspective in software automation testing, resulting in unrealistic testing, excessive interface and scenario input conditions, low efficiency, inability to predict system vulnerabilities and catastrophic results, and lack of system status tracking functions.
Using automated testing methods, test cases are generated by determining the test path and matching input conditions, including error values, using a tree diagram to determine the test path, realizing automated testing of global test target points, and quickly judging and handling exceptions.
It improves test efficiency and coverage, reduces test complexity and cost, avoids online failures, and enables processing of incorrect input conditions and system status tracking.
Smart Images

Figure CN110245065B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to an automated testing method and device. Background Art
[0002] In order to ensure continuous software integration and improve development efficiency, automated testing is required to ensure that each component runs at a high efficiency, is verified in a timely manner, and has complete testing functions.
[0003] Some existing technologies test the system based on code changes, while some existing technologies only test the system from the perspective of generating test cases.
[0004] In the process of implementing the present invention, the inventors found that there are at least the following problems in the prior art:
[0005] 1. Existing technologies usually solve problems from a certain aspect, and fail to comprehensively consider multiple factors to locate the test target from a global perspective, resulting in the defect that the test does not meet actual needs.
[0006] 2. The existing technology only uses the method of generating test cases to detect the target, which has a high threshold for subsequent access to other test cases, resulting in defects that cannot be reused.
[0007] 3. Some existing technologies have too many interface or scenario input conditions and complex test paths, resulting in low efficiency in determining the source of the problem.
[0008] 4. The existing technology does not consider the possibility that the input items may have incorrect values, which results in the inability to predict possible system vulnerabilities during the testing phase, resulting in catastrophic results.
[0009] 5. The existing technology lacks the function of tracking the system status and cannot clearly determine the source of the problem. Summary of the invention
[0010] In view of this, an embodiment of the present invention provides a method and device for automated testing, which can test the conditions of all test target points related to the scenario from a global perspective and improve test efficiency; flexibly adjust test cases to adapt to different automated testing scenarios; quickly determine whether there are problems with the test target points, improve test efficiency, and can implement the processing of abnormal test target points and the processing of erroneous input conditions, thereby achieving the beneficial effect of avoiding many online failures.
[0011] To achieve the above object, according to one aspect of an embodiment of the present invention, a method for automated testing is provided, comprising:
[0012] Determine the test path based on the test target points related to the test scenario;
[0013] Matching the input conditions determined according to the input item set with the test path, thereby developing a test case;
[0014] The test target point is automatically tested according to the test case.
[0015] Preferably, forming the input condition includes: according to all the input items in the input item set, performing permutations and combinations on each value in each input item, and the result of the permutations and combinations is the input condition.
[0016] Preferably, the value of the input item includes: an erroneous value that exceeds the value range of the input item and / or a correct value that meets the value range of the input item.
[0017] Preferably, the input condition is matched with the test path, including: pairing the input condition with the test path randomly and / or according to the priority of the test path.
[0018] Preferably, determining the test path according to the test target points related to the test scenario includes: using a tree diagram to determine the test path according to the test target points; wherein each leaf of the tree diagram is a test target point, and each branch from the root to the last leaf is a test path.
[0019] According to another aspect of an embodiment of the present invention, there is provided an automated testing apparatus, comprising:
[0020] A test path determination module, used to determine the test path according to the test target points related to the test scenario;
[0021] A test case development module, used to match input conditions determined according to the input item set with the test path, thereby developing a test case;
[0022] The automated testing module is used to perform automated testing on the test target points according to the test cases.
[0023] Preferably, forming the input condition includes: according to all the input items in the input item set, performing permutations and combinations on each value in each input item, and the result of the permutations and combinations is the input condition.
[0024] Preferably, the value of the input item includes: an erroneous value that exceeds the value range of the input item and / or a correct value that meets the value range of the input item.
[0025] Preferably, the input condition is matched with the test path, including: pairing the input condition with the test path randomly and / or according to the priority of the test path.
[0026] Preferably, determining the test path according to the test target points related to the test scenario includes: using a tree diagram to determine the test path according to the test target points; wherein each leaf of the tree diagram is a test target point, and each branch from the root to the last leaf is a test path.
[0027] According to another aspect of an embodiment of the present invention, there is provided an electronic device for automated testing, comprising:
[0028] one or more processors;
[0029] a storage device for storing one or more programs,
[0030] When one or more programs are executed by one or more processors, the one or more processors implement the automated testing method of the present invention.
[0031] According to another aspect of an embodiment of the present invention, a computer readable medium is provided, on which a computer program is stored, and when the program is executed by a processor, the method for automated testing of the present invention is implemented.
[0032] One embodiment of the above invention has the following advantages or beneficial effects:
[0033] 1. By adopting the means of matching the input conditions with the test path to develop test cases, the technical problems of high threshold for test case intervention, lack of testing from a global perspective, and complicated test paths in the prior art are overcome, thereby achieving the beneficial effects of flexibly adjusting test cases, adapting to different automated test scenarios, and facilitating reuse of testing from a global perspective of test scenarios.
[0034] 2. By means of arranging and combining the input item values, the technical defects of the existing technology that lack the function of tracking the system status and cannot clearly determine the source of the problem are overcome, thereby achieving the beneficial effect of quickly determining whether there is a problem with the test target point and improving test efficiency.
[0035] 3. By adopting the method of including erroneous values in the input items, the technical defects of the prior art that the various possible erroneous values are not taken into account, resulting in improper processing, causing loopholes in the product during the online operation and maintenance process and producing catastrophic consequences are overcome, thereby realizing the processing of erroneous input conditions and achieving the beneficial effect of avoiding many abnormal failures.
[0036] 4. By adopting the method of determining the test path through a tree diagram, the technical problem of the prior art that the test target is not located from the global perspective of the test scenario is overcome, and the technical defects of slow iteration speed and complicated test paths are avoided, thereby achieving the beneficial effect of testing all test target points related to the scenario from a global perspective and improving the test efficiency.
[0037] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.
[0039] Figure 1 is a schematic diagram of the main process of the automated testing method according to an embodiment of the present invention;
[0040] Figure 2 is a tree diagram of a specific embodiment of the method for automated testing according to an embodiment of the present invention;
[0041] Figure 3 is a schematic diagram of main modules of an automated testing apparatus according to an embodiment of the present invention;
[0042] Figure 4 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;
[0043] Figure 5 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION
[0044] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention 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 invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0045] Figure 1 is a method for automated testing according to an embodiment of the present invention, such as Figure 1 As shown,
[0046] Step S101, determining a test path according to test target points related to a test scenario;
[0047] Step S102, matching the input condition determined according to the input item set with the test path, thereby developing a test case;
[0048] Step S103: performing automated testing on the test target point according to the test case.
[0049] The present invention adopts a technical method of determining the test path by using the test target point, which can simultaneously test the related test target points in the same scene, solving the defect of the prior art that each test target point is tested only from the perspective of a certain target point and cannot be tested from a global perspective, thereby achieving accurate and efficient testing purposes.
[0050] The prior art does not distinguish between test scenarios, and tests all test target points of a system at the same time, resulting in a complex test path and low efficiency. For example, the entire system has 500 test target points, and the prior art tests 500 test target points at the same time, resulting in a complex test path and high test cost. The present method classifies the 500 test target points according to the test scenario. Assuming that there are 100 test target points related to test scenario 1, different test paths are set for test scenario 1, which reduces the defects of the prior art that does not distinguish between test scenarios, such as complex test paths and high test costs, thereby achieving the beneficial effect of improving test efficiency and judging the efficiency of test target points.
[0051] The technical means of determining input conditions by using an input item set achieves the beneficial effect of having a high coverage rate of the test path. In some embodiments, the input condition includes when the input item is at the test target point, multiple combinations of values of each input item are performed according to the input item. The technical means of determining input conditions according to the input item set makes the coverage rate of the test path high, thereby improving the test efficiency.
[0052] By using the technical means of matching input conditions with test paths, the input conditions of each test path can be set to be different, so that different input item values can be used when testing the same scenario, thereby achieving a high coverage rate. The technical means of developing test cases using matching results can reduce the complexity of the test and thus improve the efficiency of the test.
[0053] By performing automated testing on the test target points through the developed test cases, not only can the test status be tracked, but also the source of the test target points with abnormalities can be clearly determined. When changing the input item set or the test path, this embodiment can quickly iterate the regression test by only flexibly adjusting the test cases, thereby achieving the beneficial effect of convenient reuse, fast and efficient adaptation to different automated test scenarios.
[0054] In some embodiments, after the test case is run, the abnormal test target point can be quickly located according to the log generated by the test case execution. According to the report containing the cause of the abnormality in the log, the abnormal test target point can be quickly located and the cause of the abnormality can be extracted to achieve the test purpose.
[0055] Preferably, forming the input condition includes: according to all the input items in the input item set, performing permutations and combinations on each value in each input item, and the result of the permutations and combinations is the input condition.
[0056] In some embodiments, by arranging and combining each value in each input item according to each input item in the input item set, the limited values are divided into multiple groups in the form of combinations to be used to form test cases, thereby achieving the technical effect of low testing cost and high coverage.
[0057] Preferably, the value of the input item includes: an erroneous value that exceeds the value range of the input item and / or a correct value that meets the value range of the input item.
[0058] The selection of input items in the input item set is determined based on the test scenario. In order to improve the efficiency of the test, only the input items related to the test scenario are selected. The value of each input item also needs to be determined based on the test scenario. For each input item, one or more different values can be set in a specific test scenario. Depending on the test scenario, different values can exist for the same input item.
[0059] In the prior art, the values of input items are mostly correct values that meet the value range of the input items, while ignoring the test of erroneous values that exceed the value range of the input items. In practice, the prior art does not consider the situation where erroneous values cause the system to handle exceptions improperly during normal operation. When the above-mentioned inappropriate exception handling occurs, vulnerabilities may occur, resulting in catastrophic consequences. Therefore, in some optional embodiments of the present invention, adding erroneous values for testing can predict the consequences caused by abnormal information, avoiding the defect of not considering erroneous values and causing catastrophic consequences during system operation, thereby achieving the technical effect of reducing testing costs and improving coverage.
[0060] Preferably, the input condition is matched with the test path, including: pairing the input condition with the test path randomly and / or according to the priority of the test path.
[0061] In theory, the most comprehensive test cases are obtained by combining the test path with each value of each input item. However, in actual operation, considering the test cost and test time, it is not necessary to use theoretical methods to cover every case. By pairing the results of the permutation and combination with the test path randomly and / or according to the priority of the test path, the test cases can be generated to achieve a higher coverage rate and reduce the test cost and test time.
[0062] The pairing of input conditions with test paths randomly and / or according to the priority of the test paths includes: randomly pairing input conditions with test paths; or pairing input conditions with test paths according to the priority of the test paths; or determining the proportion of input conditions allocated to each test path according to the priority of the test paths, and randomly pairing input conditions in the same test path.
[0063] In the same test scenario, when the test paths have the same priority or the test path priority is not considered, the input conditions and test paths can be paired randomly. When some test paths are more important, the test paths are set as test paths with higher priority. When testing according to the priority, more input conditions can be matched; if some test paths have less influence on the scenario, the test paths can be set as test paths with lower priority. Therefore, fewer input conditions are matched during testing, which improves test efficiency.
[0064] In some embodiments, the ratio of input conditions allocated to each test path is determined according to the priority of the test path. The input conditions in the same test path are randomly paired. This can not only improve the test efficiency by focusing on important test paths through priority setting, but also make the test results more reliable through random pairing.
[0065] Preferably, determining the test path according to the test target points related to the test scenario includes: using a tree diagram to determine the test path according to the test target points; wherein each leaf of the tree diagram is a test target point, and each branch from the root to the last leaf is a test path.
[0066] In some embodiments, the test path is formed by connecting related test target points in the form of a tree diagram, where the test path is guided by the test purpose. Connecting the test target points in the form of a tree diagram locates the technical problems of the test target from the perspective of the global test scenario, facilitates the statistics of different test paths under the same scenario, avoids the technical defects of slow iteration speed and complex test paths, and thus achieves the beneficial effect of testing all test target points related to the scenario from the perspective of the global test scenario and improving the test efficiency.
[0067] The following describes the automated testing method in detail with a specific embodiment.
[0068] First, the test points related to the test scenario are represented in the form of a tree diagram, and then the test path is obtained. Figure 2 FIG. 1 is a tree diagram of a specific embodiment of the method for automated testing according to an embodiment of the present invention. Figure 2As shown in the figure, the test target points RA, RA1, RA2, RB, RB1, RB2, RC1, RC2, RD1, RD2, RE1, and RE2 are formed into a tree diagram based on the test purpose, and seven test paths are obtained, which are marked as P1, P2, P3, P4, P5, P6, and P7 respectively. Among them, RA→RA1→RC1 is P1, and the other six test paths can be deduced in turn.
[0069] Secondly, the input items in the input set of this specific embodiment are determined, which are: input item A, input item B, and input item C. For each input item, this embodiment selects three input item values. Specifically, the item values of input item A are A1, A2, and A3, the item values of input item B are B1, B2, and B3, and the item values of input item C are C1, C2, and C3. Among them, the values of A3, B3, and C3 are erroneous values that exceed the input item value range, and the remaining input item values are correct values that meet the input item value range. All the above input items, input item values, and test paths are summarized in the input parameter list of Table 1.
[0070] Table 1 Input parameter list
[0071] Input A Input B Input C Test Path A1 B1 C1 P1 A2 B2 C2 P2 A3 B3 C3 P3 P4 P5 P6 P7
[0072] Then, according to the input item A, input item B and input item C in the input item set, each value in each input item is arranged and combined to obtain 3*3*3=27 groups of input conditions. Then, the input conditions are randomly paired with the seven test paths to generate a pairing list of input conditions and test paths as shown in Table 2.
[0073] Table 2 Input conditions and test path pairing list
[0074] Serial number Input A Input B Input C Test Path 1 A1 B1 C1 P1 2 A1 B1 C2 P3 3 A1 B1 C3 P6 4 A1 B2 C1 P4 5 A1 B2 C2 P2 6 A1 B2 C3 P5 7 A1 B3 C1 P7 8 A1 B3 C2 P7 9 A1 B3 C3 P5 10 A2 B1 C1 P3 11 A2 B1 C2 P6 12 A2 B1 C3 P1 13 A2 B2 C1 P2 14 A2 B2 C2 P4 15 A2 B2 C3 P5 16 A2 B3 C1 P7 17 A2 B3 C2 P3 18 A2 B3 C3 P4 19 A3 B1 C1 P1 20 A3 B1 C2 P6 21 A3 B1 C3 P2 22 A3 B2 C1 P1 23 A3 B2 C2 P6 24 A3 B2 C3 P3 25 A3 B3 C1 P4 26 A3 B3 C2 P5 27 A3 B3 C3 P7
[0075] Finally, the test cases are automatically generated using Table 2, and then the target points are automatically tested. The abnormal test target points are quickly found through the logs generated by the test case execution, the causes of the abnormalities are extracted, and the test is completed.
[0076] Figure 3 is an automated testing device according to an embodiment of the present invention, such as Figure 3 As shown, an automated testing device 300 is provided, comprising:
[0077] Module 301, a test path determination module, is used to determine a test path according to test target points related to a test scenario;
[0078] Module 302, a test case development module, is used to match the input conditions determined according to the input item set with the test path, thereby developing a test case;
[0079] Module 303, an automated testing module, is used to perform automated testing on the test target point according to the test case.
[0080] Preferably, forming the input condition includes: according to all the input items in the input item set, performing permutations and combinations on each value in each input item, and the result of the permutations and combinations is the input condition.
[0081] Preferably, the value of the input item includes: an erroneous value that exceeds the value range of the input item and / or a correct value that meets the value range of the input item.
[0082] Preferably, the input condition is matched with the test path, including: pairing the input condition with the test path randomly and / or according to the priority of the test path.
[0083] Preferably, determining the test path according to the test target points related to the test scenario includes: using a tree diagram to determine the test path according to the test target points; wherein each leaf of the tree diagram is a test target point, and each branch from the root to the last leaf is a test path.
[0084] Figure 4 An exemplary system architecture 400 is shown to which the automated testing method or automated testing apparatus according to the embodiments of the present invention may be applied.
[0085] like Figure 4 As shown, system architecture 400 may include terminal devices 401, 402, 403, network 404 and server 405. Network 404 is used to provide a medium for communication links between terminal devices 401, 402, 403 and server 405. Network 404 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0086] Users can use terminal devices 401, 402, 403 to interact with server 405 through network 404 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 401, 402, 403, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only as examples).
[0087] The terminal devices 401 , 402 , and 403 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers.
[0088] The server 405 may be a server that provides various services, such as a backend management server (only an example) that provides support for shopping websites browsed by users using the terminal devices 401, 402, and 403. The backend management server may analyze and process the received data such as product information query requests, and feed back the processing results (such as target push information, product information - only an example) to the terminal device.
[0089] It should be noted that the automated testing method provided in the embodiment of the present invention is generally executed by the server 405 , and accordingly, the automated testing device is generally disposed in the server 405 .
[0090] It should be understood that Figure 4 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0091] Reference below Figure 5 , which shows a schematic diagram of the structure of a computer system 500 of a terminal device suitable for implementing an embodiment of the present invention. Figure 5 The terminal device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0092] like Figure 5 As shown, the computer system 500 includes a central processing unit (CPU) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage part 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the system 500 are also stored. The CPU 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0093] The following components are connected to the I / O interface 505: an input section 506 including a keyboard, a mouse, etc.; an output section 507 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN card, a modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the I / O interface 505 as needed. A removable medium 511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 510 as needed, so that a computer program read therefrom is installed into the storage section 508 as needed.
[0094] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 509, and / or installed from the removable medium 511. When the computer program is executed by the central processing unit (CPU) 501, the above-mentioned functions defined in the system of the present invention are executed.
[0095] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0096] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0097] The modules involved in the embodiments of the present invention may be implemented in software or hardware. The modules described may also be set in a processor. For example, they may be described as: a processor includes a sending module, an acquisition module, a determination module, and a first processing module. The names of these modules do not, in some cases, constitute limitations on the modules themselves. For example, the sending module may also be described as a "module for sending a picture acquisition request to the connected server."
[0098] As another aspect, the present invention further provides a computer-readable medium, which may be included in the device described in the above embodiment; or may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes:
[0099] Determine the test path based on the test target points related to the test scenario;
[0100] Matching the input conditions formed by the input item set with the test path, thereby developing a test case;
[0101] The test target point is automatically tested according to the test case.
[0102] According to the technical solution of the embodiment of the present invention, the following beneficial effects are achieved:
[0103] 1. By adopting the method of matching the input conditions with the test path to develop test cases, the technical problem of high threshold for test case intervention in the prior art is overcome, thereby achieving the beneficial effect of flexibly adjusting test cases to adapt to different automated test scenarios.
[0104] 2. By adopting the method of including erroneous values in the input items, the technical defects of the prior art that various possible erroneous values are not taken into account, resulting in improper processing, causing loopholes in the product during the online operation and maintenance process and catastrophic consequences are overcome, thereby realizing the processing of erroneous input conditions and achieving the beneficial effect of avoiding many abnormal failures.
[0105] 3. By means of arranging and combining the input item values, the technical defects of the existing technology that lack the function of tracking the system status and cannot clearly determine the source of the problem are overcome, thereby achieving the beneficial effect of quickly determining whether there is a problem with the test target point and improving test efficiency.
[0106] 4. By adopting the method of determining the test path through a tree diagram, the technical problem of the prior art that the test target is not located from the global perspective of the test scenario is overcome, and the technical defects of slow iteration speed and complicated test paths are avoided, thereby achieving the beneficial effect of testing all test target points related to the scenario from a global perspective and improving the test efficiency.
[0107] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for automated testing, characterized in that: include: Determine the test path based on the test target points related to the test scenario; Matching the input conditions determined according to the input item set with the test path, thereby developing a test case; Performing automated testing on the test target points according to the test cases; Matching the input condition with the test path includes: pairing the input condition with the test path according to the priority of the test path; The selection of input items in the input item set is related to the test scenario, and the value of each input item is determined according to the test scenario; a test path with a higher priority matches more input conditions, and a test path with a lower priority matches fewer input conditions.
2. The method according to claim 1, characterized in that The formation of the input condition includes: according to all the input items in the input item set, each value in each input item is permuted and combined, and the result of the permutation and combination is the input condition.
3. The method according to claim 1, characterized in that The values of the input items include: erroneous values that exceed the value range of the input items and / or correct values that meet the value range of the input items.
4. The method according to claim 1, characterized in that: The input condition is matched with the test path, and further includes: randomly pairing the input condition with the test path.
5. The method according to any one of claims 1 to 4, characterized in that: Determining the test path according to the test target points related to the test scenario includes: using a tree diagram to determine the test path according to the test target points; wherein each leaf of the tree diagram is a test target point, and each branch from the root to the last leaf is a path.
6. An automated testing device, characterized in that: include: A test path determination module, used to determine the test path according to the test target points related to the test scenario; A test case development module, used to match input conditions determined according to the input item set with the test path, thereby developing a test case; An automated testing module, used to perform automated testing on the test target points according to the test cases; Matching the input condition with the test path includes: pairing the input condition with the test path according to the priority of the test path; The selection of input items in the input item set is related to the test scenario, and the value of each input item is determined according to the test scenario; a test path with a higher priority matches more input conditions, and a test path with a lower priority matches fewer input conditions.
7. The device according to claim 6, characterized in that The formation of the input condition includes: according to all the input items in the input item set, each value in each input item is permuted and combined, and the result of the permutation and combination is the input condition.
8. The device according to claim 6, characterized in that The values of the input items include: erroneous values that exceed the value range of the input items and / or correct values that meet the value range of the input items.
9. The device according to claim 6, characterized in that The input condition is matched with the test path, and further includes: randomly pairing the input condition with the test path.
10. The device according to any one of claims 6 to 9, characterized in that Determining the test path according to the test target points related to the test scenario includes: using a tree diagram to determine the test path according to the test target points; wherein each leaf of the tree diagram is a test target point, and each branch from the root to the last leaf is a path.
11. An electronic device for automated testing, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 5.
12. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.
