Method and apparatus for testing
By building and correlating the test process page with the execution modules of each test node, the problem of incoherence of Java application testing process is solved, and the visual management and efficiency improvement of the test process is achieved.
Patent Information
- Application Number
- CN202010901522.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-08-31
- Publication Date
- 2024-11-22
- Estimated Expiration
- 2040-08-31
AI Technical Summary
In the existing Java-based application testing process, each test node uses different systems and platforms, which leads to incoherent testing processes, making it difficult to control and quantify, and affects testing efficiency.
Provide a testing method and device, by receiving instructions to create test tasks, construct test tasks, generate test process pages, and associate test process pages with execution modules of each test node, so as to realize the presentation and execution of test information and process operation instructions. .
It realizes visual management of the test process, simplifies the testing process management, and improves the testing efficiency.
Smart Images

Figure CN112015654B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present disclosure relate to the field of computer technology, specifically to the field of software testing, and more particularly to a method and apparatus for testing. Background Art
[0002] With the development of the Internet, various application software have emerged, bringing convenience to users. However, before an application software is widely promoted and applied, its correctness, integrity, security and quality need to be comprehensively evaluated, so software testing is an indispensable link.
[0003] In the related art, in the testing process of Java-based applications, each test node needs to use a different system and platform, but the connection between the systems or platforms used to execute the test nodes is not tight enough, resulting in the incoherence of the test process, which is not conducive to the management and quantification of the test process and affects the test efficiency. Summary of the invention
[0004] Embodiments of the present disclosure provide a method and apparatus for testing.
[0005] In a first aspect, an embodiment of the present disclosure provides a method for testing, the method comprising: in response to receiving an instruction requesting the creation of a test task, presenting a test task creation page, the test task creation page being used to receive the code library address and test strategy of the object to be tested; in response to receiving an instruction confirming the creation of the test task, constructing the test task based on the code library address and test strategy of the object to be tested, and determining the execution module of each test node in the test task; based on the order of each test node in the test task, generating a test flow page, the test flow page being used to present the test information and flow operation instructions of each test node; associating the test flow page with the execution module of each test node, so that the test flow page: receives the test information sent by the execution module of each test node and presents it on the test flow page; and, in response to the flow operation instruction being triggered, sends the flow operation instruction to the execution module of the corresponding test node, so that the execution module executes the flow operation instruction; and presents the test flow page.
[0006] In some embodiments, the test process page includes a test node identifier, which corresponds one-to-one to each test node; and the test information of the test node and the process operation instructions matching the test node are presented in a preset area corresponding to the test node identifier.
[0007] In some embodiments, the test information includes the test progress and test results of the test node corresponding to the test node identifier.
[0008] In some embodiments, the method further includes: in response to determining that the test progress of the current test node is completed, sending the test result of the current test node.
[0009] In some embodiments, the test information of the test node and the process operation instructions matching the test node are presented in a preset area corresponding to the test node identifier, including: determining the executable process operation instructions of the test node based on the test information of the test node; and determining the executable process operation instructions as the process operation instructions matching the test node.
[0010] In some embodiments, the test strategy includes a test task type; the method also includes: if the test task type is a manual test, the process operation instruction includes a process change instruction, the process change instruction includes skipping the current test node and repeating the historical test node; and, in response to the process change instruction being triggered, the process change instruction is sent to the execution module of the test node pointed to by the process change instruction, so that the execution module executes the process change instruction.
[0011] In some embodiments, the method also includes: if the test task type is automatic testing, presenting a test node parameter setting control and a test case association control on the test process page, wherein the test node parameter setting control is used to receive the pass threshold of each test node, and the test case association control is used to receive the storage address of the test case associated with the test node; and, sending the pass threshold of each test node to the execution module of each test node respectively; sending the storage address of the test case to the execution module of the test node associated with the test case respectively.
[0012] In some embodiments, the method further includes: in response to determining that the test task is terminated or completed, sending a test report, wherein the test report includes test information of each test node.
[0013] In a second aspect, an embodiment of the present disclosure provides a device for testing, the device comprising: a task receiving unit, configured to present a test task creation page in response to receiving an instruction requesting the creation of a test task, the test task creation page being used to receive the code library address and test strategy of the object to be tested; a task building unit, configured to build a test task based on the code library address and test strategy of the object to be tested in response to receiving an instruction confirming the creation of the test task, and determine the execution module of each test node in the test task; a page generating unit, configured to generate a test flow page based on the order of each test node in the test task, the test flow page being used to present the test information and flow operation instructions of each test node; a page associating unit, configured to associate the test flow page with the execution module of each test node, so that the test flow page: receives the test information sent by the execution module of each test node and presents it on the test flow page; and, in response to the flow operation instruction being triggered, sends the flow operation instruction to the execution module of the corresponding test node, so that the execution module executes the flow operation instruction; a page presenting unit, configured to present the test flow page.
[0014] In some embodiments, the test process page includes a test node identifier, which corresponds one-to-one to each test node; and the page generation unit is further configured to: present the test information of the test node and the process operation instructions matching the test node in a preset area corresponding to the test node identifier.
[0015] In some embodiments, the test information includes the test progress and test results of the test node corresponding to the test node identifier.
[0016] In some embodiments, the apparatus further includes a test result sending unit configured to: in response to determining that the test progress of the current test node is completed, send the test result of the current test node.
[0017] In some embodiments, the page generation unit is further configured to: determine the executable process operation instructions of the test node based on the test information of the test node; and determine the executable process operation instructions as the process operation instructions matching the test node.
[0018] In some embodiments, the test strategy includes a test task type; and the page generation unit also includes a manual test module, which is configured as follows: if the test task type is a manual test, the process operation instruction includes a process change instruction, and the process change instruction includes skipping the current test node and repeating the historical test node; and, in response to the process change instruction being triggered, the process change instruction is sent to the execution module of the test node pointed to by the process change instruction, so that the execution module executes the process change instruction.
[0019] In some embodiments, the page generation unit also includes an automatic testing module, which is configured to: if the test task type is automatic testing, present a test node parameter setting control and a test case association control on the test process page, wherein the test node parameter setting control is used to receive the pass threshold of each test node, and the test case association control is used to receive the storage address of the test case associated with the test node; and, send the pass threshold of each test node to the execution module of each test node respectively; send the storage address of the test case to the execution module of the test node associated with the test case respectively.
[0020] In some embodiments, the apparatus further includes a report sending unit configured to: in response to determining that the test task is terminated or completed, send a test report including test information of each test node.
[0021] The method and apparatus for testing provided by the embodiments of the present disclosure receive the code library address and test strategy of the object to be tested by presenting a test task creation page, then build a test task based on the code library address and test strategy of the object to be tested, and generate a test process page corresponding to the test task. By associating the test process page with the execution module of each test node, the test information and process operation instructions of each test node can be presented on the test process page, thereby realizing visual management and operation of the test process, which helps to simplify test process management and improve test efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Other features, objects and advantages of the present disclosure will become more apparent from the detailed description of non-limiting embodiments made with reference to the following drawings:
[0023] Figure 1 is an exemplary system architecture diagram in which some embodiments of the present disclosure may be applied;
[0024] Figure 2 is a flow chart of one embodiment of a method for testing according to the present disclosure;
[0025] Figure 3 yes Figure 2 A schematic diagram of a scenario embodiment of the process of the method for testing is shown;
[0026] Figure 4 is a flow chart of yet another embodiment of a method for testing according to the present disclosure;
[0027] Figure 5 is a schematic structural diagram of an embodiment of a device for testing according to the present disclosure;
[0028] Figure 6 It is a schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present disclosure. DETAILED DESCRIPTION
[0029] The present disclosure is further described in detail below in conjunction with the accompanying drawings and embodiments. It is understood that the specific embodiments described herein are only used to explain the relevant invention, rather than to limit the invention. It is also necessary to explain that, for ease of description, only the parts related to the relevant invention are shown in the accompanying drawings.
[0030] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present disclosure may be combined with each other. The present disclosure will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0031] Figure 1 An exemplary system architecture 100 is shown to which a method for testing or an apparatus for testing according to an embodiment of the present disclosure can be applied.
[0032] like Figure 1 As shown, the system architecture 100 may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0033] Through the network 104, users can exchange data between each terminal device 101, 102, 103 and the server 105. For example, each terminal device can obtain the code of the object to be tested from the server to execute one or more test nodes in the test task; it can also receive operation instructions for the test node sent by the test process page from other terminals (such as repeating the operation of the test node) and send the test information of the test node.
[0034] Terminal devices 101, 102, 103 can be hardware or software. When terminal devices 101, 102, 103 are hardware, they can be electronic devices with communication functions, including but not limited to smart phones, tablet computers, e-book readers, laptop computers, desktop computers, etc. When terminal devices 101, 102, 103 are software, they can be installed in the electronic devices listed above. They can be implemented as multiple software or software modules for providing distributed services, or they can be implemented as a single software or software module. No specific limitation is made here.
[0035] The server 105 may be a server providing data services, for example, a background data server providing code storage services for the terminal devices 101 , 102 , 103 , so that each terminal device may obtain the code of the object to be tested from the server according to the code library address.
[0036] It should be noted that the testing method provided in the embodiment of the present disclosure can be executed by the terminal devices 101, 102, 103, or by the server 105. Accordingly, the apparatus for testing can be set in the terminal devices 101, 102, 103, or in the server 105. No specific limitation is made here.
[0037] It should be noted that the server can be hardware or software. When the server is hardware, it can be implemented as a distributed server cluster consisting of multiple servers, or it can be implemented as a single server. When the server is software, it can be implemented as multiple software or software modules for providing distributed services, or it can be implemented as a single software or software module. No specific limitation is made here.
[0038] Continue to refer Figure 2 , shows a process 200 of an embodiment of a method for testing according to the present disclosure. The method for testing comprises the following steps:
[0039] Step 201, in response to receiving an instruction requesting to create a test task, presenting a test task creation page, the test task creation page being used to receive a code library address and a test strategy of a to-be-tested object.
[0040] When the execution subject (for example, Figure 1 When the terminal in receives the instruction of the user requesting to create a test task, a test task creation page is presented to facilitate the user to enter the code library address and test strategy of the object to be tested, wherein the execution module of each test node in the subsequently constructed test task can obtain the code of the object to be tested according to the code library address of the object to be tested; the test strategy is used to determine the test process of the test task, for example, it may include regression verification test or functional test, and the test process of the test task determined based on the test strategy may include: creating test nodes such as test request, application construction, scanning code, smoke test, and test acceptance.
[0041] As an example, the execution entity can present a code library address input box and a test strategy input box in the test task construction page. The user can enter the code library address of the object to be tested described in natural language in the code library address input box by clicking the browsing path or manually entering it. For example, the object to be tested can be selected in the pre-stored code library path (such as the code library address and branch corresponding to the JAVA application), and then the test strategy can be selected by manual input or in the drop-down list.
[0042] Step 202, in response to receiving an instruction to confirm the creation of a test task, construct a test task based on the code library address and test strategy of the object to be tested, and determine the execution module of each test node in the test task.
[0043] In this embodiment, the execution subject can determine the test nodes and their order included in the test task according to the test strategy, and determine the execution module of each test node. Each execution module can select the code library (for example, the code library stored in Figure 1 Get the code to be tested from the code repository on the server.
[0044] Typically, a test task includes the following test nodes in sequence: creating a test request, application building, code scanning, smoke testing, and test acceptance. The execution subject can determine the corresponding execution module based on the test environment and system conditions required by the test node. For example, the Maven module can be determined as the execution module of the application building node to package the code of the object to be tested into a war package; the Sonar module can be determined as the execution module of the code scanning node to perform the code coverage task of the object to be tested and count the results of the code scanning.
[0045] It is understandable that the execution module can be installed in the execution subject itself, or in other terminal devices that have the function of interacting with the execution subject's data. This application does not make any clear limitations on this.
[0046] Step 203: Generate a test flow page based on the order of each test node in the test task. The test flow page is used to present the test information and flow operation instructions of each test node.
[0047] In this embodiment, the test information is used to characterize the execution status of the test node, and may include, for example, test time, executor, test record, execution rate of test cases, etc., so that users can more conveniently and intuitively obtain the execution status of each test node. The process operation instruction is used to pass the user's instruction to the execution module of the test node, so that the user can adjust the test process according to actual needs.
[0048] As an example, the process operation instructions corresponding to the smoke test node may include an instruction to associate a test case. After the user clicks the instruction to associate a test case, the execution subject may present the storage path of the test case in a preset area of the test process page to receive the test case required by the smoke test node selected by the user. For another example, the execution subject may present a send email instruction at a preset location on the test process page. If the user clicks the send email instruction, the execution subject may present an email editing window on the test process page to receive the email content edited by the user.
[0049] In some optional implementations of this embodiment, the test process page includes a test node identifier, which corresponds one-to-one to each test node; the test information of the test node and the process operation instructions matching the test node are presented in a preset area corresponding to the test node identifier.
[0050] In this implementation, the process operation instructions matched with the test node refer to the operation instructions that can be executed by the execution module of the test node. For example, in the code scanning node, the manual scanning instruction can be presented, but the instruction of the associated test case will not be presented; for another example, in the smoke test node, the instruction of the associated test case can be presented, but the manual scanning instruction will not be presented. In this way, it is possible to avoid presenting the process operation instructions that cannot be executed on the test process page.
[0051] As an example, the execution entity can present the test node identification in the form of an icon, and arrange the test nodes according to the order in the test task, and then present the test information of the test node corresponding to the icon and the process operation instructions matching the test node in the form of a waterfall flow below the icon. In this way, the test process, as well as the test information and operation instructions of each test node in the test process can be presented more intuitively.
[0052] Preferably, the test information in this implementation may include the test progress and test results of the test node corresponding to the test node identifier, the test progress is used to characterize the execution progress of the test subtask undertaken by the test node, for example, the test progress can be divided into three types according to the execution progress: completed, testing, and to be tested. The test result is used to characterize the result output after the test subtask undertaken by the test node is completed.
[0053] As an example, the test node identifier can represent the test progress through color. For example, the test node identifier corresponding to the completed test node is displayed in bright color, the test node identifier corresponding to the running test node is displayed in flashing, and the test node identifier corresponding to the test node to be run is displayed in gray.
[0054] Furthermore, the present implementation may determine the process operation instructions that match the test node in the following manner: based on the test information of the test node, determine the executable process operation instructions of the test node; determine the executable process operation instructions as the process operation instructions that match the test node.
[0055] In a specific example of this implementation, the execution subject can determine the executable process operation instructions of the test node according to the test progress of the test node, for example, all process operation instructions of the test node to be run are non-executable operation instructions, and the repeat test instructions and query test details instructions of the completed test node are executable operation instructions; the executable operation instructions of the test node can also be determined according to the test results. For example, for the smoke test node with a failed test result, the manual trigger test instruction and the ignore smoke test instruction are all executable process operation instructions. For the code scanning node with too low code coverage, the manual rejection instruction and the repeat scan instruction are all executable process operation instructions. In this way, the non-executable process operation instructions can be filtered out from the test process page, thereby improving the accuracy of the process operation instructions presented in the test process page.
[0056] This implementation may further include: in response to determining that the test progress of the current test node is completed, sending the test result of the current test node. For example, the execution entity may pre-store the email address of the technician involved in each test node. When the test node completes the test progress, the execution entity may send the test result to the preset email address so that the relevant personnel can understand the progress of the test task in a timely manner.
[0057] Step 204, associates the test process page with the execution module of each test node, so that the test process page: receives the test information sent by the execution module of each test node and presents it on the test process page; and, in response to the process operation instruction being triggered, sends the process operation instruction to the execution module of the corresponding test node, so that the execution module executes the process operation instruction.
[0058] In this embodiment, associating the test flow page with the execution module of each test node refers to realizing data interaction between the test flow page and the execution module of each test node.
[0059] As an example, the execution subject can associate the test flow page with the execution module of each test node in the form of a WEB service, wherein the test flow page is deployed at the front end of the execution subject, and the execution module corresponding to each test node is deployed at the back end of the execution subject or other terminals, and the back end exposes the interface to the front end service. In this way, data interaction between the test flow page and the execution module corresponding to each test node can be realized.
[0060] Step 205: presenting the test process page.
[0061] In this embodiment, the execution entity presents the test process of the test task to the user by presenting a test process page, and receives the user's operation instruction for the test task.
[0062] Usually, a test task requires the collaboration of multiple departments. The execution entity can directly present the test process page after successfully associating the execution modules of each test node on the display device of the execution entity, or send the test process page to other terminals, or send the test process page to the server to present it to relevant personnel.
[0063] Continue to see Figure 3 , Figure 3 Yes Figure 2 A schematic diagram of a scenario of the method shown. Figure 3 In the example, the execution subject 301 can be a server or a terminal device. When receiving the instruction from the user requesting to create a test task, the execution subject presents a test task creation page to receive the relevant information of the test task to be created by the user, including the code library address and test strategy of the object to be tested; then, based on the received code library address and test strategy of the object to be tested, the test task is constructed and the execution module of each test node in the test task is determined, for example, it can be Figure 3 The terminal devices 302 and 303 in the test task; then, the execution subject generates a test process page based on the constructed test task, and associates the test process page with the execution module of each test node: the terminal devices 302 and 303; finally, the associated test process page is presented on the display device or other terminal device or server of the execution subject, so that the user can intuitively obtain the test information of each test node of the test task, and send operation instructions to the execution module of each test node through the test process page.
[0064] The method and apparatus for testing provided by the embodiments of the present disclosure receive the code base address and test strategy of the object to be tested by presenting a test task creation page, then build a test task based on the code base address and test strategy of the object to be tested, and generate a test process page corresponding to the test task. By associating the test process page with the execution module of each test node, the test information and process operation instructions of each test node can be presented on the test process page. Users can realize visual management and operation of the test process only through the test process page, which helps to simplify the test process management and improve the test efficiency.
[0065] Further references Figure 4 , which shows another embodiment of the method for testing. In this embodiment, the method for testing may further include a process 400, which specifically includes the following steps:
[0066] Step 401, determine the test task type.
[0067] In this embodiment, the execution subject receives the test strategy through the test task creation page, and the test strategy includes the test task type to be constructed. As an example, the execution subject can present a test task type selection box on the test task creation page to facilitate the user to determine the type of the test task.
[0068] Step 402, if the test task type is automatic testing, a test node parameter setting control and a test case association control are presented on the test process page, wherein the test node parameter setting control is used to receive the pass threshold of each test node, and the test case association control is used to receive the storage address of the test case associated with the test node.
[0069] Generally, automatic test tasks are suitable for the regression verification test phase. If the execution subject determines that the test task type is automatic testing, the test task constructed by the execution subject can automatically execute all test nodes in order, and the intermediate links after the test process is started do not require manual operation, but it is necessary to preset the pass threshold of each test node and associate the test case before starting the test process. The pass threshold is used to characterize whether the test result of the test node meets the test requirements. If the test result is higher than the pass threshold, it indicates that the test result meets the test requirements and the next test node can be started; conversely, if the test result is lower than the pass threshold, it indicates that the test result does not meet the test requirements and the test task is terminated. Test cases can include smoke test cases and automated test cases in testing, corresponding to smoke test nodes and nodes in testing, respectively.
[0070] As an example, the execution subject can present the node parameter setting control in the area corresponding to each test node identifier in the test process page, so that the user can intuitively set the pass threshold of each test node. For example, the pass threshold of the code scanning node can be set as: unit test coverage greater than 30%, the number of bugs (defects) less than 10, and code smells less than 200. After the test process is started, if the test results of the code scanning node cannot meet all the above conditions, the test task will be terminated; if the test results meet all the above conditions, the next test node will be opened to continue the test task.
[0071] Step 403: Send the passing threshold of each test node to the execution module of each test node respectively.
[0072] In this embodiment, the execution subject can send the pass threshold to the execution module of each test node respectively, and each execution module compares the test result with the pass threshold to determine whether the test result of the test node meets the test requirements. If the test result does not meet the pass threshold, the execution module sends a signal that the test has not passed to the execution subject, and the execution subject sends a stop operation instruction to the next test node to terminate the test task; if the test result meets the pass threshold, the execution module sends a signal that the test has passed to the execution subject, and the execution subject sends a start test instruction to the next test node to continue the test task.
[0073] Step 404: Send the storage addresses of the test cases to the execution modules of the test nodes associated with the test cases.
[0074] As an example, the execution subject can also present a smoke test case selection control in the area corresponding to the smoke test process node identifier to receive the storage address of the smoke test case selected by the user and send the storage address to the execution module corresponding to the smoke test. This method can also be used to determine the automation case in the test.
[0075] Step 405, if the test task type is manual testing, the process operation instruction includes a process change instruction, and the process change instruction includes an instruction to skip the current test node and an instruction to repeat the execution of the historical test node; and, in response to the process change instruction being triggered, the process change instruction is sent to the execution module of the test node pointed to by the process change instruction, so that the execution module executes the process change instruction.
[0076] Usually, manual test tasks are applicable to the functional test stage. The instruction to skip the current node is used to instruct the execution module corresponding to the current test node to stop running and start the next test node of the current test node; the historical test node refers to the test node that has been run and obtained the test results. The instruction to repeat the historical test node is used to instruct the execution module of the current test node to stop running and start the specified historical test node. In this way, the test nodes can be repeatedly executed according to actual needs.
[0077] Step 406: In response to determining that the test task is terminated, a test report is sent, where the test report includes test information of each test node.
[0078] In this embodiment, the execution entity can pre-store an email address. When the execution entity determines that the test task is terminated, for example, the termination condition may be that a certain test node is not passed in an automatic test task or all test nodes are completed; for example, the termination condition may also be manual termination of the test task or completion of all test nodes in a manual test task. The execution entity generates a test report based on the test information of the completed test nodes and sends the test report to the pre-stored email address.
[0079] from Figure 4 As can be seen in the figure, the process 400 of the method for testing in this embodiment can present different information and process operation instructions on the test process page according to different test task types to meet the test conditions of automatic test tasks and manual test tasks. In this way, the flexibility of the method for testing disclosed in the present invention can be improved.
[0080] It should be noted that the above step 406 is also applicable to Figure 2 The embodiment shown.
[0081] In some optional implementation methods of the above-mentioned multiple embodiments of the present invention, the test task creation page can simultaneously receive the code library addresses and corresponding test strategies of multiple objects to be tested. Accordingly, the execution entity can create multiple test tasks based on the received code library addresses and corresponding test strategies of the multiple objects to be tested, and generate a corresponding test process page. In this way, the test efficiency can be improved.
[0082] Further references Figure 5 As an implementation of the methods shown in the above figures, the present disclosure provides an embodiment of a device for testing. Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.
[0083] like Figure 5 As shown, the apparatus 500 for testing of this embodiment includes: a task receiving unit 501, configured to present a test task creation page in response to receiving an instruction requesting to create a test task, the test task creation page is used to receive the code library address and test strategy of the object to be tested; a task building unit 502, configured to build a test task based on the code library address and test strategy of the object to be tested in response to receiving an instruction confirming to create a test task, and determine the execution module of each test node in the test task; a page generating unit 503, configured to generate a test flow page based on the order of each test node in the test task, the test flow page is used to present the test information and flow operation instructions of each test node; a page associating unit 504, configured to associate the test flow page with the execution module of each test node, so that the test flow page: receives the test information sent by the execution module of each test node and presents it on the test flow page; and, in response to the flow operation instruction being triggered, sends the flow operation instruction to the execution module of the corresponding test node, so that the execution module executes the flow operation instruction; a page presenting unit 505, configured to present the test flow page.
[0084] In this embodiment, the test process page includes a test node identifier, which corresponds one-to-one to each test node; and the page generation unit 503 is further configured to: present the test information of the test node and the process operation instructions matching the test node in a preset area corresponding to the test node identifier.
[0085] In this embodiment, the test information includes the test progress and test result of the test node corresponding to the test node identifier.
[0086] In this embodiment, the apparatus further includes a test result sending unit configured to: in response to determining that the test progress of the current test node is completed, send the test result of the current test node.
[0087] In this embodiment, the page generating unit 503 is further configured to: determine the executable process operation instruction of the test node based on the test information of the test node; and determine the executable process operation instruction as the process operation instruction matching the test node.
[0088] In this embodiment, the test strategy includes a test task type; and the page generation unit 503 also includes a manual test module, which is configured as follows: if the test task type is a manual test, the process operation instruction includes a process change instruction, and the process change instruction includes skipping the current test node and repeating the historical test node; and, in response to the process change instruction being triggered, the process change instruction is sent to the execution module of the test node pointed to by the process change instruction, so that the execution module executes the process change instruction.
[0089] In this embodiment, the page generation unit 503 also includes an automatic testing module, which is configured to: if the test task type is automatic testing, present a test node parameter setting control and a test case association control on the test process page, wherein the test node parameter setting control is used to receive the pass threshold of each test node, and the test case association control is used to receive the storage address of the test case associated with the test node; and, send the pass threshold of each test node to the execution module of each test node respectively; send the storage address of the test case to the execution module of the test node associated with the test case respectively.
[0090] In this embodiment, the apparatus further includes a report sending unit configured to: in response to determining that the test task is terminated or completed, send a test report including test information of each test node.
[0091] Reference below Figure 6 , which shows an electronic device (eg, Figure 1The terminal device in the embodiment of the present disclosure may include but is not limited to mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 6 The terminal device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0092] like Figure 6 As shown, the electronic device 600 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic device 600 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0093] Typically, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 6 The electronic device 600 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead. Figure 6 Each block shown in the figure may represent one device, or may represent multiple devices as required.
[0094] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes 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 a communication device 609, or installed from a storage device 608, or installed from a ROM 602. When the computer program is executed by the processing device 601, the above functions defined in the method of the embodiment of the present disclosure are executed. It should be noted that the computer-readable medium described in the embodiment of the present disclosure can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can 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 conductors, 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 an embodiment of the present disclosure, 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, an apparatus, or a device. In an embodiment of the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in combination with an instruction execution system, an apparatus, or a device. The program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to: wire, optical cable, RF (radio frequency), etc., or any suitable combination of the foregoing.
[0095] The computer-readable medium may be included in the electronic device; or it may exist independently without being assembled into the electronic device. The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device: in response to receiving an instruction requesting the creation of a test task, presents a test task creation page, the test task creation page is used to receive the code library address and test strategy of the object to be tested; in response to receiving an instruction confirming the creation of a test task, based on the code library address and test strategy of the object to be tested, constructs a test task, and determines the execution module of each test node in the test task; based on the order of each test node in the test task, generates a test flow page, the test flow page is used to present the test information and flow operation instructions of each test node; associates the test flow page with the execution module of each test node, so that the test flow page: receives the test information sent by the execution module of each test node and presents it on the test flow page; and, in response to the process operation instruction being triggered, sends the process operation instruction to the execution module of the corresponding test node, so that the execution module performs the operation pointed to by the process operation instruction; presents the test flow page.
[0096] Computer program code for performing the operations of embodiments of the present disclosure may be written in one or more programming languages or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on a user's computer, partially on a user's computer, as a separate software package, partially on a user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0097] 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 disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square 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 square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / 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.
[0098] The units involved in the embodiments described in the present disclosure may be implemented by software or by hardware. The units described may also be arranged in a processor, for example, may be described as: a processor includes a task receiving unit, a task building unit, a page generating unit, a page associating unit and a page presenting unit. Among them, the names of these units do not constitute a limitation on the units themselves in certain cases, for example, the page presenting unit may also be described as a "unit for presenting a test process page".
[0099] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the embodiments of the present disclosure is not limited to the technical solutions formed by a specific combination of the above-mentioned technical features, but should also cover other technical solutions formed by any combination of the above-mentioned technical features or their equivalent features without departing from the above-mentioned inventive concept. For example, the above-mentioned features are replaced with the technical features with similar functions disclosed in the embodiments of the present disclosure (but not limited to) to form a technical solution.
Claims
1. A method for testing, comprising: In response to receiving an instruction requesting to create a test task, presenting a test task creation page, wherein the test task creation page is used to receive a code library address and a test strategy of the object to be tested; In response to receiving an instruction to confirm the creation of a test task, a test task is constructed based on the code library address of the object to be tested and the test strategy, and an execution module of each test node in the test task is determined, wherein the test strategy is used to determine the test nodes included in the test task and their order, as well as the execution module of each test node, and the test strategy includes any one of multiple types of tests; Based on the order of the test nodes in the test task, a test flow page is generated, wherein the test flow page is used to present the test information and flow operation instructions of the test nodes; Associating the test flow page with the execution modules of the test nodes, so that the test flow page: receives the test information sent by the execution modules of the test nodes and presents it on the test flow page; and, in response to the process operation instruction being triggered, sending the process operation instruction to an execution module of a corresponding test node so that the execution module executes the process operation instruction; The test flow page is presented.
2. The method according to claim 1, wherein: The test process page includes a test node identifier, and the test node identifier corresponds to each of the test nodes one by one; as well as, The test information of the test node and the process operation instructions matching the test node are presented in the preset area corresponding to the test node identifier.
3. The method according to claim 2, wherein: The test information includes the test progress and test results of the test node corresponding to the test node identifier.
4. The method according to claim 3, further comprising: In response to determining that the test progress of the current test node is completed, sending the test result of the current test node.
5. The method according to claim 3, wherein: Presenting the test information of the test node and the process operation instructions matching the test node in the preset area corresponding to the test node identifier includes: Determining executable process operation instructions of the test node based on the test information of the test node; The executable process operation instruction is determined as a process operation instruction matching the test node.
6. The method according to claim 1, wherein: The test strategy includes a test task type; the method further includes: If the test task type is a manual test, the process operation instruction includes a process change instruction, and the process change instruction includes an instruction to skip a current test node and an instruction to repeat execution of a historical test node; and, In response to the process change instruction being triggered, the process change instruction is sent to the execution module of the test node pointed to by the process change instruction, so that the execution module executes the process change instruction.
7. The method according to claim 6, further comprising: If the test task type is automatic testing, a test node parameter setting control and a test case association control are presented on the test process page, wherein the test node parameter setting control is used to receive the pass threshold of each test node, and the test case association control is used to receive the storage address of the test case associated with the test node; and, Sending the passing threshold of each test node to the execution module of each test node respectively; The storage addresses of the test cases are respectively sent to the execution modules of the test nodes associated with the test cases.
8. The method according to any one of claims 1 to 7, further comprising: In response to determining that the test task is terminated, a test report is sent, where the test report includes test information of each test node.
9. A device for testing, comprising: A task receiving unit is configured to present a test task creation page in response to receiving an instruction requesting to create a test task, wherein the test task creation page is used to receive a code library address and a test strategy of an object to be tested; A task construction unit is configured to, in response to receiving an instruction to confirm the creation of a test task, construct a test task based on the code library address of the object to be tested and the test strategy, and determine the execution module of each test node in the test task, wherein the test strategy is used to determine the test nodes included in the test task and their order, as well as the execution module of each test node, and the test strategy includes any one of multiple types of tests; A page generating unit, configured to generate a test flow page based on the order of each test node in the test task, wherein the test flow page is used to present the test information and flow operation instructions of each test node; The page association unit is configured to associate the test flow page with the execution module of each test node, so that the test flow page: receives the test information sent by the execution module of each test node and presents it on the test flow page; and, in response to the process operation instruction being triggered, sending the process operation instruction to an execution module of a corresponding test node so that the execution module executes the process operation instruction; The page presenting unit is configured to present the test process page.
10. The device according to claim 9, wherein: The test process page includes a test node identifier, and the test node identifier corresponds to each of the test nodes one by one; and The page generating unit is further configured to present the test information of the test node and the process operation instruction matching the test node in the preset area corresponding to the test node identifier.
11. The device according to claim 10, wherein: The test information includes the test progress and test results of the test node corresponding to the test node identifier. 12 . The apparatus according to claim 11 , further comprising a test result sending unit configured to: in response to determining that the test progress of the current test node is completed, send the test result of the current test node.
13. The device according to claim 11, wherein: The page generation unit is further configured to: Determining executable process operation instructions of the test node based on the test information of the test node; The executable process operation instruction is determined as a process operation instruction matching the test node.
14. The device according to claim 9, wherein: The test strategy includes a test task type; and the page generation unit also includes a manual test module configured to: If the test task type is a manual test, the process operation instruction includes a process change instruction, and the process change instruction includes an instruction to skip a current test node and an instruction to repeat execution of a historical test node; as well as, In response to the process change instruction being triggered, the process change instruction is sent to an execution module corresponding to the test node pointed to by the process change instruction, so that the execution module executes the process change instruction.
15. The device according to claim 14, wherein: The page generation unit also includes an automatic testing module configured to: If the test task type is automatic testing, a test node parameter setting control and a test case association control are presented on the test process page, wherein the test node parameter setting control is used to receive the pass threshold of each test node, and the test case association control is used to receive the storage address of the test case associated with the test node; and, Sending the passing threshold of each test node to the execution module of each test node respectively; The storage addresses of the test cases are respectively sent to the execution modules of the test nodes associated with the test cases.
16. The apparatus according to any one of claims 9 to 15, further comprising a report sending unit configured to: In response to determining that the test task is terminated, a test report is sent, where the test report includes test information of each test node.
17. An electronic device comprising: one or more processors; a storage device having one or more programs stored thereon, 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 8.
18. A computer readable medium having a computer program stored thereon, wherein: When the program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.
