WO2017193737A1 - 一种软件测试方法及系统 - Google Patents

一种软件测试方法及系统 Download PDF

Info

Publication number
WO2017193737A1
WO2017193737A1 PCT/CN2017/079617 CN2017079617W WO2017193737A1 WO 2017193737 A1 WO2017193737 A1 WO 2017193737A1 CN 2017079617 W CN2017079617 W CN 2017079617W WO 2017193737 A1 WO2017193737 A1 WO 2017193737A1
Authority
WO
WIPO (PCT)
Prior art keywords
execution
task
controller
agent
test case
Prior art date
Application number
PCT/CN2017/079617
Other languages
English (en)
French (fr)
Inventor
徐虎生
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2017193737A1 publication Critical patent/WO2017193737A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites

Definitions

  • This article refers to, but is not limited to, the field of software testing, and in particular to a software testing method and system.
  • the serial test method is usually used, and the serial test method has a long test time for a single test case, and the serial test method uses less test resources, and There is a problem with resources being idle.
  • Embodiments of the present invention provide a software testing method and system, which can reduce the length of testing time and avoid resource idleness.
  • the embodiment of the invention provides a software testing method, including:
  • the controller acquires test cases and task information according to the received task unique code ID
  • the controller decomposes the test case to obtain two or more execution steps, and applies for a proxy resource to the resource management center; wherein the proxy resource includes an execution proxy that executes the execution step and task information;
  • the controller sends the execution step and the task information to the applied execution agent, and the executed execution step is performed by the execution agent according to the task information.
  • the software testing method further includes:
  • test case After all execution steps of the test case are performed, the test case is returned to the resource pool.
  • the software testing method further includes:
  • the execution agent executing the execution step is returned to the resource management center to update the execution agent in the resource management center.
  • the software testing method further includes:
  • the received test result information is integrated into the test result file of the test case.
  • a software testing system further provided by the embodiment of the present invention includes: a task center, a resource management center, a controller, and an execution agent;
  • the task center is configured to, after determining the job to be executed, apply to the resource management center for a controller resource, and send the task identity ID included in the job to the applied controller;
  • the controller is configured to: after receiving the task ID, acquire test case and task information according to the task ID, decompose the test case to obtain two or more execution steps, and apply to the resource management center for execution. And the agent resource, the execution step and the task information that are required to be executed by the execution agent, where the agent resource includes an execution agent that executes the execution step and the task information;
  • the execution agent is configured to perform the executing step according to the task information after receiving the execution step and the task information;
  • the resource management center is configured to be responsible for the controller resource and the application for executing the proxy resource.
  • system further includes a data server and a file server; wherein
  • the data server is configured to: save a correspondence between the task ID and the task information;
  • the file server is configured to: save a correspondence between a task ID and a test case, and a resource pool of the test case;
  • the controller is further configured to: after receiving the task ID, acquire task information corresponding to the task ID from the data server, and acquire the task from the file server The test case corresponding to the ID.
  • the execution proxy is further configured to: after executing the received execution step, feed back the generated log file and test result information of the execution step to the controller;
  • the controller is further configured to: integrate the received test result information into a test result file of the test case, and send the received log file and the test result file to the data server and the file server. save.
  • the controller is further configured to: register with the resource management center after starting, and maintain a heartbeat; the execution agent is further configured to: register the module type to the resource management center after startup, and keep Heartbeat
  • the resource management center is further configured to: be responsible for registration of the controller and registration of a module type of the execution agent.
  • controller is further configured to:
  • the module type corresponding to the execution step is determined, and an execution agent having the same module type is applied to the resource management center, and the execution agent is sent to the applied execution agent respectively.
  • the execution steps and the task information that the execution agent needs to perform are described.
  • the execution agent is set to:
  • the task information After receiving the task information of the execution step and the execution step, determining whether the corresponding module is available according to the module type of the execution step, and if the corresponding module is determined according to the module type of the execution step, the task information is passed according to the task information.
  • the module performs the performing steps.
  • the software testing method and system provided by the present invention, in which the controller obtains the test case and the task information according to the task ID after receiving the task ID, and decomposes the test case to obtain a plurality of execution steps, and manages the resource
  • the center applies the proxy resource, and sends the execution step and task information that the execution agent needs to execute to the applied execution agent, and the execution agent executes the received execution step according to the received task information.
  • FIG. 1 is a schematic structural diagram of a software testing system according to a first embodiment of the present invention
  • FIG. 2 is a schematic structural diagram of a software testing system according to a second embodiment of the present invention.
  • FIG. 3 is a schematic flowchart of a software testing method in a third embodiment of the present invention.
  • FIG. 4 is a schematic flowchart of a software testing method in a fourth embodiment of the present invention.
  • FIG. 5 is a schematic diagram of an interaction process of a software testing method according to a fifth embodiment of the present invention.
  • testing the software has the problems of long test time and idle resources.
  • the present invention provides a software testing method and system, which can effectively shorten the testing time, improve the testing efficiency, and can fully utilize the testing resources to avoid resource idle.
  • FIG. 1 is a schematic structural diagram of a software testing system according to a first embodiment of the present invention, including:
  • Task center 101 resource management center 102, controller 103 and execution agent 104;
  • the task center 101 is configured to, after determining the job to be executed, apply to the resource management center 102 for the controller resource, and send the task identity (ID, IDentity) included in the job to the applied controller 103;
  • the controller 103 is configured to: after receiving the task ID, acquire test case and task information according to the task ID, decompose the test case to obtain two or more execution steps, and apply to the resource management center 102 for available execution agent resources, Executing the execution steps and task information that the execution agent 104 needs to perform, respectively, to the execution agent 104 to be applied; wherein the agent resource includes an execution agent that executes the execution step and the task information;
  • the execution agent 104 is configured to perform the received execution step according to the task information after receiving the execution step and the task information;
  • the resource management center 102 is set up to be responsible for controller resources and applications for executing proxy resources.
  • the software testing system may include two or more controllers 103 and two or more execution agents 104, and the controller 103 will send resources to the resources after startup.
  • the management center 102 sends a registration request, and after receiving the registration request, the resource management center 102 will save the registration information of the controller 103 to complete the registration of the controller 103 and maintain the heartbeat.
  • the execution agent 104 sends a module type registration request to the resource management center 102 after startup, and after receiving the registration request, the resource management center 102 will save the registration information and module type of the execution agent to complete the execution agent 104. Register and keep your heartbeat.
  • the resource management center 102 can implement registration of the controller 103 and the execution agent 104, that is, the resource management center 102 is configured to be responsible for registration of the controller, and to perform registration of the module type of the agent.
  • the resource management center 102 can also manage the already registered controller 103 and the execution agent 104. For example, after receiving the request of the task center 102 to apply for the controller resource, the task center 101 is based on the request. The idle controller 103 is allocated, and upon receiving a request from the controller 103 to apply for execution of the proxy resource, the controller 103 is assigned an available execution agent 104 based on the request. That is, the resource management center 102 is also set up to be responsible for the controller resources and the application for executing the proxy resources.
  • the controller 103 and the execution agent 104 allocated by the resource management center 102 may be the controller 103 and the execution agent 104 that have completed registration in the resource management center 102 and keep the heartbeat.
  • the task center 101 is further configured to receive a task request, where the task request includes a job and a time for executing the job, and if the time for executing the job is real time, the request is a real-time task request, and the task center 101 adding the job in the task request to the batch job queue, wherein the batch job queue is configured to save the jobs that need to be executed, and the task center 101 will also determine the current order according to the arrangement order in the batch job queue.
  • the job that needs to be processed that is, the job to be executed.
  • the task center 101 puts the job in the task request into a timed job queue, wherein the timed job queue stores jobs that need to be executed at a fixed time.
  • the task center 101 also monitors the timed job queue. If there is a job-to-execution time in the timed job queue, the job is moved into the batch job queue to start the execution of the job.
  • the task center 101 after determining the job to be executed, the task center 101 will apply for the controller resource to the resource management center 101, and send the task ID included in the to-be-executed job to the applied controller 103.
  • the resource management center 102 Applying a controller 103, if the job includes a plurality of task IDs, applying to the resource management center 102 a corresponding number of controllers 103, that is, the task center 101 will apply to the controller 103 based on the number of task IDs included in the job, so that For each task ID, there is a corresponding controller 103 to perform a test process based on the task ID.
  • Parallel testing can effectively shorten the test time for a job and make full use of test resources to avoid resource idle.
  • the controller 103 acquires the test case and the task information according to the received task ID, and decomposes the test case to obtain multiple The steps are executed, and the resource management center 102 is applied to execute the proxy resource, and the execution step and the task information that are required to be executed are sent to the applied execution agent 104 respectively.
  • an execution agent needs to be requested for each execution step, so that the execution steps of the test cases can be deployed on different execution agents for processing, which can effectively shorten the test time and pass multiple Performing proxy parallel processing can make full use of test resources and avoid resource idle.
  • the test case may be an automated test case, which may be designed by an automated test case tool, and the test case is composed of execution steps. Therefore, the controller 103 may decompose the obtained test case into two or two. The above steps are performed.
  • the task information includes test parameters when testing the test case, such as environment parameters and configuration parameters.
  • the execution agent 104 After receiving the execution step and the task information, the execution agent 104 executes the received execution step according to the task information. For each test case, after each execution step is executed by the execution agent 104, the completion is completed. Test of this test case.
  • the software testing system includes a task center 101, a resource management center 102, a controller 103, and an execution agent 104, and after determining the job to be executed, the task center 101 applies to the resource management center 102 for controller resources. And sending the task ID included in the job to the applied controller 103, the controller 103 acquires the test case and the task information according to the task ID, decomposes the test case to obtain two or more execution steps, and provides resources to the resource.
  • the management center 102 applies for executing the proxy resource, and sends the execution step and the task information that the execution proxy 104 needs to execute to the applied execution proxy 104, respectively, and is executed by the execution proxy 104 according to the received task information.
  • the execution steps received by the line By decomposing the test case into two or more execution steps and sending them to different execution agents 104 for execution, the time for testing the test cases can be shortened, and the controller can be fully utilized by means of parallel testing. Resources and execution of proxy resources to avoid resource idling.
  • FIG. 2 is a schematic structural diagram of a software testing system according to a second embodiment of the present invention.
  • the software testing system includes the first implementation shown in FIG.
  • the software testing system further includes: a data server 201 and a file server 202, the data server 201 is configured to: save a correspondence between the task ID and the task information; and the file server 202 is configured to: save the task ID Correspondence with test cases and resource pools for test cases;
  • the controller 103 is further configured to acquire the task information corresponding to the task ID from the data server 201 after receiving the task ID, and acquire the test case corresponding to the task ID from the file server 202. That is, the controller 103 can acquire task information and test cases from the data server 201 and the file server 202, respectively.
  • the file server 202 stores the test case through the resource pool.
  • the controller 103 may first search for the correspondence between the task ID and the test case that have been saved in the file server 202 to determine the test corresponding to the received task ID. Use case and get the test case from the resource pool.
  • the data server 201 and the file server 202 can also be set as the same server, that is, the correspondence between the task ID and the task information is saved on the same server, and the task ID and the test case are saved. The correspondence between the resources and the resource pool of the test case.
  • the execution agent 104 is further configured to feed back the generated log file and the test result information of the execution step to the controller 103 after executing the received execution step; and the controller 103 is further configured to receive The obtained test result information is integrated into the test result file of the test case, and the received log file and the test result file are sent to the data server 201 and the file server 202 for storage.
  • the controller 103 sends the execution step AC to the execution agent AC
  • the execution agent A sends the log file A and the test result information A generated after the execution of the received execution step A to the controller 103, and executes the agent B.
  • the log file B and the test result information B generated after the step B are sent to the controller 103, and the execution agent C sends the log file C and the test result information C generated after executing the received execution step B to the controller 103, and the controller 103, the test result information AC is integrated into a test result file, and the log file AC and the test result file are sent to the data server 201 and the file server 202, and the log file AC and the test result file are saved by the data server 201 and the file server 202. .
  • the controller 103 after decomposing the test case into two or more execution steps, the controller 103 will determine the corresponding execution agent 104 for the two or more execution steps respectively.
  • the module type corresponding to each execution step is applied to the resource management center 102 for an execution agent having the same module type, and the task information of the corresponding execution step and execution step is sent to the applied execution agent 104.
  • the module type corresponding to the steps 1-3 is AC
  • the execution agent 104 of the module type A needs to be applied for the execution of step 1.
  • the execution agent 104 of the module type B needs to be applied.
  • an execution agent 104 of module type C needs to be applied.
  • the resource management center 102 assigns the execution agent 104 to the execution step according to the module type that needs to be applied, so that each execution step can be applied to the execution agent 104 having the module type it needs. And before executing the received execution step, the execution agent 104 will determine if the module executing the execution step is available.
  • the module in the execution agent is a component, such as QTP (QuickTest Professional, an automatic test tool.
  • QTP Quality of Test
  • the purpose of using QTP is to use it to perform repeated tests, mainly for regression testing and testing new versions of the same software. .
  • SilkTest SiliconkTest, a product for enterprise-level applications for functional testing, can be used to test Web, Java or traditional C/S structures), etc.
  • the execution agent 104 can perform the received execution steps. Executed by calling the component. It should be noted that the execution agent 104 needs to determine whether the component has been started when the calling component runs the execution step. If it is already started, the component is currently unavailable, and the component resource needs to be released. If the component is not started, The component can be called to perform the received execution steps in accordance with the task information.
  • the architecture of the software testing system further includes a data server 201 and a file server 202, which are respectively configured to store task information and test cases, so that software testing is performed.
  • the required task information and test cases can be obtained from the data server 201 and the file server 202, respectively, and data is provided for the software test.
  • the execution agent 104 sends the log file and the test result information generated during the execution to the controller 103, so that the controller 103 integrates the test result information belonging to the same test case into the test.
  • the test result file of the use case, and the received log file and the integrated test result file belonging to the test case are sent to the data server 201 and the file server 202, so that the generated log file and the save test during the test process can be effectively saved. result.
  • FIG. 3 is a schematic flowchart of a software testing method according to a third embodiment of the present invention.
  • the software testing method is described from the perspective of the controller 103, and Software testing methods include:
  • Step 301 The controller acquires test cases and task information according to the received task unique code (ID).
  • ID task unique code
  • Step 302 The controller decomposes the test case to obtain two or more execution steps, and applies to the resource management center for the proxy resource; wherein the proxy resource includes an execution proxy that executes the execution step and the task information;
  • Step 303 The controller sends the execution step and the task information to the applied execution agent, and the execution agent executes the received execution step according to the task information.
  • the controller 103 acquires the test case and the task information according to the received task ID, and decomposes the test case to obtain multiple The steps are executed, and the resource management center 102 is applied to execute the proxy resource, and the execution step and the task information that are required to be executed are sent to the applied execution agent 104 respectively.
  • an execution agent needs to be requested for each execution step, so that the execution steps of the test cases can be deployed on different execution agents for processing, which can effectively shorten the test time and pass multiple Performing proxy parallel processing can make full use of test resources and avoid resource idle.
  • the test case may be an automated test case, which may be designed by an automated test case tool, and the test case may be composed of execution steps. Therefore, the controller 103 may decompose the obtained test case into two or more. Steps.
  • the task information includes test parameters when testing the test case, such as an environment parameter. Parameters such as number and configuration parameters.
  • the execution agent 104 After receiving the execution step and the task information, the execution agent 104 executes the received execution step according to the task information. For each test case, after each execution step is executed by the execution agent 104, the completion is completed. Test of this test case.
  • the controller 103 decomposes the test case into multiple execution steps and sends them to different execution agents for execution, so that the test time of the test case can be shortened, and the method of parallel test is adopted. Can fully utilize the execution agent resources to avoid resource idle.
  • controller 103 in the third embodiment shown in FIG. 3 also performs the following steps:
  • test case After all execution steps of the test case are executed, the test case is returned to the resource pool.
  • the file server 202 stores the correspondence between the task ID and the test case, and the test case is saved in the resource pool of the test case, and the controller 103 is based on the task ID and the test case. After the correspondence determines the test case, the corresponding test case is obtained from the resource pool.
  • the controller 103 After acquiring the test case and completing the software test based on the test case, the controller 103 returns the test case to the resource pool to facilitate the reuse of the test case.
  • the controller 103 in the third embodiment shown in FIG. 3 also performs the following steps:
  • the execution agent executing the execution step is returned to the resource management center.
  • the controller 103 sends each execution step to the corresponding execution agent separately, and each execution agent returns the test result information after completing the execution, and the controller 103 receives the test result information. , indicating that the execution agent that sent the test result information has completed the execution of the execution step, is in an idle state, and the controller 103 returns the execution agent to the resource management center, so that the execution agent in the resource management center 102 can be updated in time, which is convenient.
  • the execution proxy resources are assigned to other controllers 103.
  • FIG. 4 is a schematic flowchart of an implementation process of a software testing method according to a fourth embodiment of the present invention.
  • the software testing method includes:
  • Step 401 After receiving the task ID, the controller acquires test cases and task information according to the task ID.
  • Step 402 The controller decomposes the test case to obtain two or more execution steps, and applies to the resource management center for the proxy resource; wherein the proxy resource includes an execution proxy that executes the execution step and the task information;
  • Step 403 The controller sends the execution step and task information that the execution agent needs to execute to the executed execution agent, and the execution agent executes the received execution step according to the task information.
  • Steps 401 to 403 are similar to those described in steps 301 to 303 in the third embodiment shown in FIG. 3, and details are not described herein.
  • Step 404 Receive test result information of performing execution agent feedback; and the test result information includes: performing, by the execution agent, the received execution step;
  • Step 405 After receiving the test result information of the two or more execution steps, the test result information of all the execution steps is integrated into the test result file of the test case.
  • the execution agent 104 performs the received execution step according to the task information, and executes After completion, the execution agent 104 will feed back the test result information to the controller 103, and after receiving the test result information of all the execution steps of a test case, the controller 103 integrates all the test result information into the test result of the test case. In addition, the controller 103 will also receive the log file fed back by the execution agent 104, and send the received log file and the synthesized test result file to the data server 201 and the file server 202 for storage.
  • the execution agent A sends the log file A and the test result information A generated after the execution of the received execution step A to the controller 103, and executes the agent B.
  • the log file B and the test result information B generated after the execution of the received execution step B are sent to the controller 103, and the execution agent C sends the log file C and the test result information C generated after the execution of the received execution step B.
  • the controller 103 integrates the test result information AC into a test result file, and sends the log file AC and the test result file to the data server 201 and the file server. 202.
  • the log file A-C and the test result file are saved by the data server 201 and the file server 202.
  • the controller 103 after the controller 103 decomposes the test case into two or more execution steps, in order to separately apply the corresponding execution agent 104 to the plurality of execution steps, the controller 103 will determine each execution step.
  • Corresponding module types are applied to the resource management center 102 for execution agents having the same module type, and the corresponding execution steps and task information of the execution steps are sent to the applied execution agent 104.
  • the module type corresponding to the steps 1-3 is AC
  • the execution agent 104 of the module type A needs to be applied for the execution of step 1.
  • the execution agent 104 of the module type B For the execution of step 2, the execution agent 104 of the module type B needs to be applied.
  • an execution agent 104 of module type C needs to be applied.
  • the resource management center 102 assigns the execution agent 104 to the execution step according to the module type that needs to be applied, so that each execution step can be applied to the execution agent 104 having the module type it needs. And before executing the received execution step, the execution agent 104 will determine if the module executing the execution step is available.
  • the modules in the execution agent are components, such as QTP, SilkTest, etc., and the execution agent 104 performs the execution of the received execution steps by calling the component. It should be noted that the execution agent 104 needs to determine whether the component has been started when the calling component runs the execution step. If it is already started, the component is currently unavailable, and the component resource needs to be released. If the component is not started, The component can be called to perform the received execution steps in accordance with the task information.
  • the resource management center 102 classifies the execution agent based on the module type of the execution agent, and Record the number of execution agents belonging to this type.
  • the controller 103 decomposes the test case into two or more execution steps and sends them to different execution agents for execution, so that the test time of the test case can be shortened, and the parallel The way of testing can make full use of the execution agent resources to avoid resource idle.
  • the embodiment of the invention further provides a computer storage medium, wherein the computer storage medium stores the meter
  • the computer executable instructions are used to execute the above software testing method.
  • the embodiment of the invention further provides a software testing device, including: a memory and a processor; wherein
  • the processor is configured to execute program instructions in the memory
  • the proxy resource includes an execution agent that executes the execution step and task information
  • the execution step and the task information are sent to the applied execution agent, and the execution step is performed by the execution agent according to the task information.
  • FIG. 5 A schematic diagram of the interaction process of the software testing method, including:
  • Step 501 After determining the job to be executed, the task center 101 sends the task ID included in the job to the controller 103 that is applied for;
  • the software testing system includes a plurality of controllers 103 and a plurality of execution agents 104.
  • a registration request is sent to the resource management center 102, and the resource management center 102 receives the registration request.
  • the registration information of the controller 103 will be saved to complete the registration of the controller 103 and maintain the heartbeat.
  • the execution agent 104 sends a module type registration request to the resource management center 102 after startup, and after receiving the registration request, the resource management center 102 will save the registration information and module type of the execution agent to complete the execution agent 104. Register and keep your heartbeat.
  • the resource management center 102 can implement registration of the controller 103 and the execution agent 104, that is, the resource management center 102 is responsible for registration of the controller, and registration of the module type of the execution agent.
  • the resource management center 102 may also manage the already registered controller 103 and the execution agent 104, and after receiving the request of the task center 102 to apply for the controller resource, allocate the idle to the task center 101 based on the request.
  • the controller 103 and upon receiving the request from the controller 103 to execute the proxy resource, assigns the controller 103 an available execution agent 104 based on the request. That is, the resource management center 102 is also used to be responsible for the controller resources and the application for executing the proxy resources.
  • the controller 103 and the execution agent 104 allocated by the resource management center 102 are the controller 103 and the execution agent 104 that have completed registration in the resource management center 102 and keep the heartbeat.
  • the task center 101 is further configured to receive a task request, where the task request includes a job and a time for executing the job, and if the time for executing the job is real time, the request is a real-time task request, and the task center 101 adding the job in the task request to the batch job queue, wherein the batch job queue is used to save the jobs that need to be executed, and the task center 101 will also determine the current order according to the arrangement order in the batch job queue.
  • the job that needs to be processed that is, the job to be executed.
  • the task center 101 puts the job in the task request into a timed job queue, wherein the timed job queue stores jobs that need to be executed at a fixed time.
  • the task center 101 also monitors the timed job queue. If there is a job-to-execution time in the timed job queue, the job is moved into the batch job queue to start the execution of the job.
  • the task center 101 after determining the job to be executed, the task center 101 will send the task ID included in the job to the controller 103 that is applied for.
  • Step 502 The controller 103 acquires task information corresponding to the task ID from the data server 201, and acquires a test case corresponding to the task ID from the file server 202.
  • the data server 201 is configured to store the correspondence between the task ID and the task information
  • the file server 202 is configured to save the correspondence between the task ID and the test case and the resource pool of the test case.
  • the controller 103 After receiving the task ID, the controller 103 acquires task information corresponding to the task ID from the data server 201, and acquires a test case corresponding to the task ID from the file server 202. That is, the controller 103 can acquire task information and test cases from the data server 201 and the file server 202, respectively.
  • the data server 201 and the file server 202 can also be set in the application. Set to the same server, that is, the correspondence between the task ID and the task information is saved on the same server, and the correspondence between the task ID and the test case and the resource pool of the test case are saved.
  • Step 503 the controller 103 decomposes the test case into two or more execution steps
  • Step 504 The controller sends the execution step and task information to the applied execution agent 104.
  • Step 505 The execution agent 104 performs the received execution step according to the task information.
  • the controller 103 acquires the test case and the task information according to the received task ID, and decomposes the test case to obtain two. Or more than two execution steps, and apply to the resource management center 102 to execute the proxy resource, and send the executed execution step and task information to the applied execution proxy 104 respectively.
  • an execution agent needs to be requested for each execution step, so that the execution steps of the test cases can be deployed on different execution agents for processing, which can effectively shorten the test time and pass parallel processing. The way to make full use of test resources to avoid resource idle.
  • the test case may be an automated test case, which may be designed by an automated test case tool, and the test case is composed of execution steps. Therefore, the controller 103 may decompose the obtained test case into two or two. The above steps are performed.
  • the task information includes test parameters when testing the test case, such as environment parameters and configuration parameters.
  • the execution agent 104 After receiving the execution step and the task information, the execution agent 104 executes the received execution step according to the task information. For each test case, after each execution step is executed by the execution agent 104, the completion is completed. Test of this test case.
  • the controller 103 determines the module type corresponding to each execution step, and applies to the resource management center 102 for an execution agent having the same module type, to the applied execution agent 104.
  • the module type corresponding to the steps 1-3 is AC
  • the execution agent 104 of the module type A needs to be applied for the execution of step 1.
  • the execution agent 104 of the module type B needs to be applied.
  • an execution agent 104 of module type C needs to be applied.
  • the resource management center 102 will apply for the module according to the need.
  • the type assigns the execution agent 104 to the execution step so that each execution step can be applied to the execution agent 104 having the module type it needs.
  • the execution agent 104 will determine if the module executing the execution step is available.
  • the modules in the execution agent are components, such as QTP, SilkTest, etc., and the execution agent 104 performs the execution of the received execution steps by calling the component. It should be noted that the execution agent 104 needs to determine whether the component has been started when the calling component runs the execution step. If it is already started, the component is currently unavailable, and the component resource needs to be released. If the component is not started, The component can be called to perform the received execution steps in accordance with the task information.
  • Step 506 the execution agent 104 feeds back the generated log file and test result information to the controller 103;
  • Step 507 the controller 103 sends the integrated test result file and the received log file to the data server 201;
  • Step 508 The controller 103 sends the integrated test result file and the received log file to the file server 202.
  • the execution agent 104 is further configured to feed back the generated log file and the test result information of the execution step to the controller 103 after executing the received execution step; and the controller 103 is further configured to receive The obtained test result information is integrated into the test result file of the test case, and the received log file and the test result file are sent to the data server 201 and the file server 202 for storage.
  • the controller 103 sends the execution step AC to the execution agent AC
  • the execution agent A sends the log file A and the test result information A generated after the execution of the received execution step A to the controller 103, and executes the agent B.
  • the log file B and the test result information B generated after the execution of the received execution step B are sent to the controller 103, and the execution agent C sends the log file C and the test result information C generated after the execution of the received execution step B.
  • the controller 103 integrates the test result information AC into a test result file, and sends the log file AC and the test result file to the data server 201 and the file server 202, and the log is saved by the data server 201 and the file server 202.
  • File AC and the test result file It should be noted that the dotted line portion in the embodiment shown in FIG. 3 is responsive.
  • the task center 101 after determining the job to be executed, applies to the resource management center 102 for the controller resource, and sends the application to the controller 103 to be included in the job.
  • the task ID is obtained by the controller 103 according to the task ID
  • the test case and the task information are obtained
  • the test case is decomposed to obtain a plurality of execution steps
  • the resource management center 102 is requested to execute the agent resource
  • the agent resource is sent to the applied execution agent 104.
  • Execution steps and task information that the agent 104 needs to perform are executed, and the execution step is performed by the execution agent 104 in accordance with the received task information.
  • the controller 103 and the execution agent 104 can complete the registration by sending a registration message to the resource management center 102, wherein the registration message includes registration information. And after registration, it is also necessary to send a detection message to detect whether the registered controller 103 and the execution agent 104 are online to maintain the heartbeat.
  • each module/unit in the foregoing embodiment may be implemented in the form of hardware, for example, by implementing an integrated circuit to implement its corresponding function, or may be implemented in the form of a software function module, for example, being executed by a processor and stored in a memory. Programs/instructions to implement their respective functions.
  • the invention is not limited to any specific form of combination of hardware and software.
  • the above technical solution shortens the time for testing the test cases, fully utilizes the controller resources and executes the proxy resources, and avoids resource idle.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Test And Diagnosis Of Digital Computers (AREA)
  • Debugging And Monitoring (AREA)

Abstract

一种软件测试方法及系统,包括:控制器(103)在接收到任务唯一编码(ID)之后,根据该任务ID获取测试用例和任务信息,并分解该测试用例得到两个或两个以上执行步骤,并向资源管理中心(102)申请代理资源,并向申请到的执行代理(104)发送该执行代理(104)所需要执行的执行步骤及任务信息,由执行代理(104)按照接收到的任务信息执行接收到的执行步骤。本方法缩短了对测试用例进行测试的时间,充分利用了控制器资源及执行代理资源,避免了资源闲置。

Description

一种软件测试方法及系统 技术领域
本文涉及但不限于软件测试领域,尤其涉及一种软件测试方法及系统。
背景技术
随着软件规模的增大和软件复杂性的增加,对软件进行测试的需求也日益增多,软件测试的自动化技术在软件测试领域悄然兴起。
目前在使用软件测试的自动化技术时,通常使用的是串行测试方式,而串行测试方式存在对单个测试用例的测试时间长的问题,且串行测试方式所使用到的测试资源少,还存在资源闲置的问题。
上述内容仅用于辅助理解本发明实施例的技术方案,并不代表承认上述内容是现有技术。
发明概述
以下是对本文详细描述的主题的概述。本概述并非是为了限制权利要求的保护范围。
本发明实施例提供一种软件测试方法及系统,能够减少测试时间长度及避免资源闲置。
本发明实施例提供了一种软件测试方法,包括:
控制器根据接收到的任务唯一编码ID获取测试用例和任务信息;
所述控制器分解所述测试用例得到两个或两个以上执行步骤,并向资源管理中心申请代理资源;其中,所述代理资源包括执行所述执行步骤及任务信息的执行代理;
所述控制器向申请到的执行代理发送所述执行步骤及所述任务信息,由所述执行代理按照所述任务信息执行接收到的执行步骤。
可选地,所述软件测试方法还包括:
在所述测试用例的所有执行步骤执行完后,将所述测试用例返还资源池。
可选地,所述软件测试方法还包括:
在所述测试用例的任意一个执行步骤执行完后,将执行所述执行步骤的执行代理返还所述资源管理中心,以更新所述资源管理中心内执行代理。
可选地,所述软件测试方法还包括:
接收所述执行代理反馈的所述执行代理执行所述执行步骤后获得的测试结果信息;
在接收到所述两个或两个以上执行步骤的测试结果信息后,将接收到的所述测试结果信息整合成所述测试用例的测试结果文件。
本发明实施例还提供的一种软件测试系统,包括:任务中心、资源管理中心、控制器和执行代理;
所述任务中心,设置为在确定待执行的作业之后,向所述资源管理中心申请控制器资源,并向申请到的控制器发送所述作业包含的任务身份标识ID;
所述控制器,设置为在接收到任务ID之后,根据所述任务ID获取测试用例和任务信息,分解所述测试用例得到两个或两个以上执行步骤,并向所述资源管理中心申请执行代理资源,分别向申请到的执行代理发送所述执行代理所需要执行的执行步骤及所述任务信息;其中,所述代理资源包括执行所述执行步骤及任务信息的执行代理;
所述执行代理,设置为在接收到执行步骤和任务信息之后,按照所述任务信息执行所述执行步骤;
所述资源管理中心,设置为负责控制器资源和执行代理资源的申请。
可选地,所述系统还包括数据服务器和文件服务器;其中,
所述数据服务器设置为:保存任务ID与任务信息之间的对应关系;
所述文件服务器设置为:保存任务ID与测试用例之间的对应关系及测试用例的资源池;
所述控制器还设置为:在接收到所述任务ID之后,从所述数据服务器获取与所述任务ID对应的任务信息,及从所述文件服务器获取与所述任务 ID对应的测试用例。
可选地,所述执行代理还设置为:在执行完接收到的执行步骤之后,将生成的日志文件及所述执行步骤的测试结果信息反馈给所述控制器;
所述控制器还设置为:将接收到的测试结果信息整合成所述测试用例的测试结果文件,将接收到的日志文件及所述测试结果文件发送给所述数据服务器及所述文件服务器进行保存。
可选地,所述控制器还设置为:在启动之后向所述资源管理中心注册,并保持心跳;所述执行代理还设置为:在启动之后向所述资源管理中心注册模块类型,并保持心跳;
则所述资源管理中心还设置为:负责所述控制器的注册及所述执行代理的模块类型的注册。
可选地,所述控制器还设置为:
在将所述测试用例分解为两个或两个执行步骤之后,确定执行步骤对应的模块类型,并向所述资源管理中心申请具有相同模块类型的执行代理,分别向申请到的执行代理发送所述执行代理所需要执行的执行步骤及所述任务信息。
可选地,所述执行代理是设置为:
在接收到执行步骤及执行步骤的任务信息之后,根据所述执行步骤的模块类型确定相应的模块是否可用,若根据所述执行步骤的模块类型确定相应的模块可用,则按照所述任务信息通过所述模块执行所述执行步骤。
本发明提供的软件测试方法及系统,在该方法中,控制器在接收到任务ID之后,根据该任务ID获取测试用例和任务信息,并分解该测试用例得到多个执行步骤,且向资源管理中心申请代理资源,并向申请到的执行代理发送该执行代理所需要执行的执行步骤及任务信息,由执行代理按照接收到的任务信息执行接收到的执行步骤。通过将测试用例分解为多个执行步骤,并分别发送给不同的执行代理进行执行,缩短了对测试用例进行测试的时间,且通过并行测试的方式,充分利用了执行代理资源,避免了资源闲置。
在阅读并理解了附图和详细描述后,可以明白其他方面。
附图概述
图1为本发明第一实施例中软件测试系统的结构示意图;
图2为本发明第二实施例中软件测试系统的结构示意图;
图3为本发明第三实施例中软件测试方法的流程示意图;
图4为本发明第四实施例中软件测试方法的流程示意图;
图5为本发明第五实施例中软件测试方法的交互流程示意图。
详述
下文中将结合附图对本申请的实施例进行详细说明。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互任意组合。
由于相关技术中,对软件进行测试存在测试时间长及资源闲置的问题。
为此,本发明提出一种软件测试方法及系统,能够有效的缩短测试时间,提高测试效率,且能够充分利用测试资源,避免资源闲置。
请参阅图1,为本发明第一实施例中软件测试系统的结构示意图,包括:
任务中心101、资源管理中心102、控制器103及执行代理104;
其中,任务中心101,设置为在确定待执行的作业之后,向资源管理中心102申请控制器资源,并向申请到的控制器103发送作业包含的任务身份标识(ID,IDentity);
控制器103,设置为在接收到任务ID之后,根据该任务ID获取测试用例和任务信息,分解测试用例得到两个或两个以上执行步骤,并向资源管理中心102申请可用的执行代理资源,分别向申请到的执行代理104发送该执行代理104所需要执行的执行步骤及任务信息;其中,代理资源包括执行执行步骤及任务信息的执行代理;
执行代理104,设置为在接收到执行步骤和任务信息之后,按照任务信息执行接收到的执行步骤;
资源管理中心102,设置为负责控制器资源和执行代理资源的申请。
在本发明实施例中,该软件测试系统中可以包含两个或两个以上控制器103及两个或两个以上执行代理104,且控制器103在启动之后,将向资源 管理中心102发送注册请求,资源管理中心102在接收到该注册请求之后,将保存该控制器103的注册信息,以完成该控制器103的注册,并保持心跳。
此外,执行代理104在启动之后,向资源管理中心102发送模块类型的注册请求,资源管理中心102在接收到该注册请求之后,将保存该执行代理的注册信息及模块类型,以完成执行代理104的注册,并保持心跳。
通过上述方式,资源管理中心102能够实现控制器103及执行代理104的注册,即资源管理中心102配置为负责控制器的注册,及执行代理的模块类型的注册。
在本发明实施例中,资源管理中心102还可以对已经注册的控制器103及执行代理104进行管理,例如:在接收到任务中心102申请控制器资源的请求后,基于该请求为任务中心101分配空闲的控制器103,及在接收到控制器103申请执行代理资源的请求后,基于该请求为控制器103分配可用的执行代理104。即资源管理中心102还设置为负责控制器资源和执行代理资源的申请。其中,资源管理中心102分配的控制器103及执行代理104可以是已经在资源管理中心102完成注册,且保持心跳的控制器103及执行代理104。
在本发明实施例中,任务中心101还设置为接收任务请求,该任务请求中包含作业及执行该作业的时间,若执行该作业的时间为实时,则表明该请求是实时任务请求,任务中心101将该任务请求中的作业添加到批次作业队列中,其中,该批次作业队列配置为保存需要执行的作业,且任务中心101还将按照该批次作业队列中的排列顺序依次确定当前需要处理的作业,即确定待执行的作业。或者,若任务请求中包含的执行作业的时间为定时的,则任务中心101将该任务请求中的作业放入定时作业队列中,其中,该定时作业队列中保存需要在固定时间执行的作业,且任务中心101还将对该定时作业队列进行监测,若监测到定时作业队列中有作业到执行时间时,将该作业移入批次作业队列,以启动对该作业的执行程序。
在本发明实施例中,任务中心101在确定待执行的作业之后,将向资源管理中心101申请控制器资源,并向申请到的控制器103发送该待执行的作业包含的任务ID。其中,若该作业包含一个任务ID,则向资源管理中心102 申请一个控制器103,若该作业包含多个任务ID,则向资源管理中心102申请相应个数的控制器103,即任务中心101将基于作业包含的任务ID的个数申请控制器103,使得对于每一个任务ID,都有一个对应的控制器103基于该任务ID进行测试过程,通过这样的方式,能够将一个作业中的两个或两个以上任务ID部署到不同的控制器103,实现并行测试,能够有效缩短对一个作业的测试时间,且充分利用测试资源,避免资源闲置。
在本发明实施例中,对于每一个接收到任务ID的控制器103,在接收到任务ID之后,控制器103将根据接收到的任务ID获取测试用例和任务信息,分解该测试用例得到多个执行步骤,并向资源管理中心102申请执行代理资源,分别向申请到的执行代理104发送其所需要执行的执行步骤及任务信息。例如,若有四个执行步骤,则需要为每一个执行步骤申请一个执行代理,使得能够将测试用例的执行步骤部署在不同的执行代理上进行处理,能够有效的缩短测试时间,且通过多个执行代理并行处理的方式,能够充分利用测试资源,避免资源闲置。
其中,测试用例可以是自动化测试用例,可以是由自动化测试用例工具设计出来的,且测试用例是由执行步骤构成的,因此,控制器103可以将获取到的测试用例分解成两个或两个以上执行步骤。
其中,任务信息中包含对测试用例进行测试时的测试参数,例如环境参数、配置参数等参数。
其中,执行代理104在接收到执行步骤和任务信息之后,将按照该任务信息执行接收到的执行步骤,对于一个测试用例,在其每一个执行步骤都分别由执行代理104执行完之后,则完成该测试用例的测试。
在本发明实施例中,软件测试系统中包含任务中心101、资源管理中心102、控制器103及执行代理104,且在确定待执行的作业之后,任务中心101向资源管理中心102申请控制器资源,并向申请到的控制器103发送该作业中包含的任务ID,由控制器103根据该任务ID获取测试用例和任务信息,分解该测试用例得到两个或两个以上执行步骤,并向资源管理中心102申请执行代理资源,分别向申请到的执行代理104发送该执行代理104所需要执行的执行步骤及任务信息,并由执行代理104按照接收到的任务信息执 行接收到的执行步骤。通过将测试用例分解为两个或两个以上执行步骤,并分别发送给不同的执行代理104进行执行,使得能够缩短对测试用例进行测试的时间,且通过并行测试的方式,能够充分利用控制器资源及执行代理资源,避免资源闲置。
基于图1所示第一实施例,请参阅图2,为本发明第二实施例中软件测试系统的结构示意图,在该第二实施例中,软件测试系统包含如图1所示第一实施例中的任务中心101、控制器103、执行代理104及资源管理中心102。且与图1所示第一实施例中描述的内容相似,此处不做赘述。
在本发明实施例中,软件测试系统还包括:还包括数据服务器201和文件服务器202,数据服务器201设置为:保存任务ID与任务信息之间的对应关系;文件服务器202设置为:保存任务ID与测试用例之间的对应关系及测试用例的资源池;
控制器103还设置为:在接收到任务ID之后,从数据服务器201获取与任务ID对应的任务信息,及从文件服务器202获取与任务ID对应的测试用例。即控制器103能够从数据服务器201及文件服务器202分别获取任务信息及测试用例。
其中,文件服务器202中是通过资源池存储测试用例的,控制器103可以先查找文件服务器202中已经保存的任务ID与测试用例之间的对应关系,以确定与接收到的任务ID对应的测试用例,并从资源池中获取该测试用例。
需要说明的是,在应用中还可以将数据服务器201及文件服务器202设置为同一个服务器,即在同一个服务器上保存任务ID与任务信息之间的对应关系,及保存任务ID与测试用例之间的对应关系及测试用例的资源池。
在本发明实施例中,执行代理104还设置为在执行完接收到的执行步骤之后,将生成的日志文件及执行步骤的测试结果信息反馈给控制器103;且控制器103还设置为将接收到的测试结果信息整合成测试用例的测试结果文件,将接收到的日志文件及测试结果文件发送给数据服务器201及文件服务器202进行保存。例如,若控制器103将执行步骤A-C分别发送给执行代理A-C,则执行代理A将执行完接收到的执行步骤A后生成的日志文件A及测试结果信息A发送给控制器103,执行代理B将执行完接收到的执行 步骤B后生成的日志文件B及测试结果信息B发送给控制器103,执行代理C将执行完接收到的执行步骤B后生成的日志文件C及测试结果信息C发送给控制器103,控制器103将测试结果信息A-C整合成一个测试结果文件,并将日志文件A-C及测试结果文件发送给数据服务器201及文件服务器202,由数据服务器201及文件服务器202保存该日志文件A-C及该测试结果文件。
在本发明实施例中,控制器103在将测试用例分解为两个或两个以上执行步骤之后,为了分别给该两个或两个以上执行步骤申请相应的执行代理104,控制器103将确定每一个执行步骤所对应的模块类型,并向资源管理中心102申请具有相同模块类型的执行代理,向申请到的执行代理104发送对应的执行步骤及执行步骤的任务信息。例如,若执行步骤1-3分别对应的模块类型为A-C,则对于执行步骤1,需要申请模块类型为A的执行代理104,对于执行步骤2,需要申请模块类型为B的执行代理104,对于执行步骤3,需要申请模块类型为C的执行代理104。且资源管理中心102在接收到申请请求后,将根据需要申请的模块类型为执行步骤分配执行代理104,使得能够为每一个执行步骤申请到具有其所需要的模块类型的执行代理104。且执行代理104在执行接收到的执行步骤之前,将确定执行该执行步骤的模块是否可用。
其中,执行代理中的模块即组件,例如QTP(QuickTest Professional,是一种自动测试工具,使用QTP的目的是想用它来执行重复的测试,主要是用于回归测试和测试同一软件的新版本。),SilkTest(SilkTest一款用于企业级应用进行功能测试的产品,可用于测试Web、Java或是传统的C/S结构)等,且执行代理104在执行接收到的执行步骤时,可以通过调用组件进行执行的。需要说明的是,执行代理104在调用组件运行执行步骤时,需要确定该组件是否已经启动,若已经启动则说明该组件当前不可用,需要等待该组件资源被释放,若该组件未启动,则可调用该组件按照任务信息执行接收到的执行步骤。
在本发明实施例中,软件测试系统的架构中还包括数据服务器201及文件服务器202,分别设置为存储任务信息及测试用例,使得在进行软件测试 时,能够从数据服务器201和文件服务器202分别获取所需要的任务信息及测试用例,为软件测试提供数据。且执行代理104在执行完接收到的执行步骤之后,将执行过程中生成的日志文件及测试结果信息发送给控制器103,使得控制器103将属于同一个测试用例的测试结果信息整合成该测试用例的测试结果文件,并将接收到的属于该测试用例的日志文件及整合的测试结果文件发送给数据服务器201和文件服务器202,使得能够有效的保存测试过程中的生成的日志文件及保存测试结果。
为了更好的理解本发明实施例中的技术方案,请参阅图3,为本发明第三实施例中软件测试方法的流程示意图,该软件测试方法是从控制器103的角度描述的,且该软件测试方法包括:
步骤301、控制器根据接收到的任务唯一编码(ID)获取测试用例和任务信息;
步骤302、控制器分解测试用例得到两个或两个以上执行步骤,并向资源管理中心申请代理资源;其中,代理资源包括执行所述执行步骤及任务信息的执行代理;
步骤303、控制器向申请到的执行代理发送执行步骤及任务信息,由执行代理按照任务信息执行接收到的执行步骤。
在本发明实施例中,对于每一个接收到任务ID的控制器103,在接收到任务ID之后,控制器103将根据接收到的任务ID获取测试用例和任务信息,分解该测试用例得到多个执行步骤,并向资源管理中心102申请执行代理资源,分别向申请到的执行代理104发送其所需要执行的执行步骤及任务信息。例如,若有四个执行步骤,则需要为每一个执行步骤申请一个执行代理,使得能够将测试用例的执行步骤部署在不同的执行代理上进行处理,能够有效的缩短测试时间,且通过多个执行代理并行处理的方式,能够充分利用测试资源,避免资源闲置。
其中,测试用例可以是自动化测试用例,可以由自动化测试用例工具设计出来的,且测试用例可以由执行步骤构成的,因此,控制器103可以将获取到的测试用例分解成两个或两个以上执行步骤。
其中,任务信息中包含对测试用例进行测试时的测试参数,例如环境参 数、配置参数等参数。
其中,执行代理104在接收到执行步骤和任务信息之后,将按照该任务信息执行接收到的执行步骤,对于一个测试用例,在其每一个执行步骤都分别由执行代理104执行完之后,则完成该测试用例的测试。
在本发明实施例中,控制器103通过将测试用例分解为多个执行步骤,并分别发送给不同的执行代理进行执行,使得能够缩短对测试用例进行测试的时间,且通过并行测试的方式,能够充分利用执行代理资源,避免资源闲置。
可选的,为了实现资源的重复利用,图3所示第三实施例中的控制器103还将执行以下步骤:
在测试用例的所有执行步骤执行完后,将测试用例返还资源池。
在本发明实施例中,文件服务器202中保存了任务ID与测试用例之间的对应关系,而测试用例是保存在测试用例的资源池的,控制器103在基于任务ID与测试用例之间的对应关系确定测试用例之后,将从该资源池中获取相应的测试用例。
控制器103在获取到测试用例,并基于该测试用例完成软件测试之后,将该测试用例返还资源池,便于测试用例的重复利用。
可选的,为了实现测试资源的及时更新,图3所示第三实施例中的控制器103还将执行以下步骤:
在测试用例的任意一个执行步骤执行完后,将执行执行步骤的执行代理返还资源管理中心。
在本发明实施例中,控制器103在将每一个执行步骤分别发送给对应的执行代理,且每一个执行代理在完成执行之后,都将返回测试结果信息,控制器103若接收到测试结果信息,则表明发送该测试结果信息的执行代理已完成执行步骤的执行,处于空闲状态,控制器103将该执行代理返还资源管理中心,使得能够及时对资源管理中心102中的执行代理进行更新,便于为其他控制器103分配执行代理资源。
基于图3所示第三实施例,请参阅图4,为本发明第四实施例中软件测试方法的实现流程示意图,该软件测试方法包括:
步骤401、控制器在接收到任务ID后,根据任务ID获取测试用例和任务信息;
步骤402、控制器分解测试用例得到两个或两个以上执行步骤,并向资源管理中心申请代理资源;其中,代理资源包括执行执行步骤及任务信息的执行代理;
步骤403、控制器向申请到的执行代理发送执行代理所需要执行的执行步骤及任务信息,由执行代理按照任务信息执行接收到的执行步骤;
步骤401至步骤403分别与图3所示第三实施例中的步骤301至步骤303描述的内容相似,此次不做赘述。
步骤404、接收执行代理反馈的测试结果信息;测试结果信息包括:执行代理执行接收到的执行步骤得到的;
步骤405、在接收到两个或两个以上执行步骤的测试结果信息后,将所有执行步骤的测试结果信息整合成测试用例的测试结果文件。
在本发明实施例中,控制器103在向申请到的执行代理发送该执行代理所需要执行的执行步骤及任务信息之后,执行代理104将按照该任务信息执行接收到的执行步骤,且在执行完成之后,该执行代理104将向控制器103反馈测试结果信息,控制器103在接收到一个测试用例的所有执行步骤的测试结果信息之后,将所有的测试结果信息整合成该测试用例的测试结果文件,此外,控制器103还将接收到执行代理104反馈的日志文件,且将接收到的日志文件及合成的测试结果文件发送给数据服务器201及文件服务器202进行保存。例如,若控制器103将执行步骤A-C分别发送给执行代理A-C,则执行代理A将执行完接收到的执行步骤A后生成的日志文件A及测试结果信息A发送给控制器103,执行代理B将执行完接收到的执行步骤B后生成的日志文件B及测试结果信息B发送给控制器103,执行代理C将执行完接收到的执行步骤B后生成的日志文件C及测试结果信息C发送给控制器103,控制器103将测试结果信息A-C整合成一个测试结果文件,并将日志文件A-C及测试结果文件发送给数据服务器201及文件服务器 202,由数据服务器201及文件服务器202保存该日志文件A-C及该测试结果文件。
在本发明实施例中,控制器103在将测试用例分解为两个或两个以上执行步骤之后,为了分别给该多个执行步骤申请相应的执行代理104,控制器103将确定每一个执行步骤所对应的模块类型,并向资源管理中心102申请具有相同模块类型的执行代理,向申请到的执行代理104发送对应的执行步骤及执行步骤的任务信息。例如,若执行步骤1-3分别对应的模块类型为A-C,则对于执行步骤1,需要申请模块类型为A的执行代理104,对于执行步骤2,需要申请模块类型为B的执行代理104,对于执行步骤3,需要申请模块类型为C的执行代理104。且资源管理中心102在接收到申请请求后,将根据需要申请的模块类型为执行步骤分配执行代理104,使得能够为每一个执行步骤申请到具有其所需要的模块类型的执行代理104。且执行代理104在执行接收到的执行步骤之前,将确定执行该执行步骤的模块是否可用。
其中,执行代理中的模块即组件,例如QTP,SilkTest等,且执行代理104在执行接收到的执行步骤时,是通过调用组件进行执行的。需要说明的是,执行代理104在调用组件运行执行步骤时,需要确定该组件是否已经启动,若已经启动则说明该组件当前不可用,需要等待该组件资源被释放,若该组件未启动,则可调用该组件按照任务信息执行接收到的执行步骤。
需要说明的是,在执行代理103执行完执行步骤,且控制器103将该执行代理104返还给资源管理中心102之后,资源管理中心102将基于该执行代理的模块类型对执行代理进行分类,并记录属于该类型的执行代理的数目。
在本发明实施例中,控制器103通过将测试用例分解为两个或两个以上执行步骤,并分别发送给不同的执行代理进行执行,使得能够缩短对测试用例进行测试的时间,且通过并行测试的方式,能够充分利用执行代理资源,避免资源闲置。
本发明实施例还提供一种计算机存储介质,计算机存储介质中存储有计 算机可执行指令,计算机可执行指令用于执行上述软件测试方法。
本发明实施例还提供一种软件测试装置,包括:存储器和处理器;其中,
处理器被配置为执行存储器中的程序指令;
程序指令在处理器读取执行以下操作:
根据接收到的任务唯一编码ID获取测试用例和任务信息;
分解所述测试用例得到两个或两个以上执行步骤,并向资源管理中心申请代理资源;其中,所述代理资源包括执行所述执行步骤及任务信息的执行代理;
向申请到的执行代理发送执行步骤及任务信息,由执行代理按照任务信息执行接收到的执行步骤。
为了更好的理解基于本发明图2所示第二实施例中的软件测试系统进行软件测试,下面将介绍本发明实施例中软件测试方法,请参阅图5,为本发明第五实施例中软件测试的方法的交互流程示意图,包括:
步骤501、任务中心101在确定待执行的作业之后,向申请到的控制器103发送作业包含的任务ID;
在本发明实施例中,软件测试系统中包含多个控制器103及多个执行代理104,其中,控制器103在启动之后,将向资源管理中心102发送注册请求,资源管理中心102在接收到注册请求之后,将保存该控制器103的注册信息,以完成该控制器103的注册,并保持心跳。
此外,执行代理104在启动之后,向资源管理中心102发送模块类型的注册请求,资源管理中心102在接收到该注册请求之后,将保存该执行代理的注册信息及模块类型,以完成执行代理104的注册,并保持心跳。
通过上述方式,资源管理中心102能够实现控制器103及执行代理104的注册,即,资源管理中心102用于负责控制器的注册,及执行代理的模块类型的注册。
在本发明实施例中,资源管理中心102还可以对已经注册的控制器103及执行代理104进行管理,在接收到任务中心102申请控制器资源的请求后,基于该请求为任务中心101分配空闲的控制器103,及在接收到控制器103申请执行代理资源的请求后,基于该请求为控制器103分配可用的执行代理104。即资源管理中心102还用于负责控制器资源和执行代理资源的申请。其中,资源管理中心102分配的控制器103及执行代理104是已经在资源管理中心102完成注册,且保持心跳的控制器103及执行代理104。
在本发明实施例中,任务中心101还用于接收任务请求,该任务请求中包含作业及执行该作业的时间,若执行该作业的时间为实时,则表明该请求是实时任务请求,任务中心101将该任务请求中的作业添加到批次作业队列中,其中,该批次作业队列用于保存需要执行的作业,且任务中心101还将按照该批次作业队列中的排列顺序依次确定当前需要处理的作业,即确定待执行的作业。或者,若任务请求中包含的执行作业的时间为定时的,则任务中心101将该任务请求中的作业放入定时作业队列中,其中,该定时作业队列中保存需要在固定时间执行的作业,且任务中心101还将对该定时作业队列进行监测,若监测到定时作业队列中有作业到执行时间时,将该作业移入批次作业队列,以启动对该作业的执行程序。
在本发明实施例中,任务中心101在确定待执行的作业之后,将向申请到的控制器103发送作业包含的任务ID。
步骤502、控制器103从数据服务器201获取与任务ID对应的任务信息,及从文件服务器202获取与任务ID对应的测试用例;
在本发明实施例中,数据服务器201用于保存任务ID与任务信息之间的对应关系,文件服务器202用于保存任务ID与测试用例之间的对应关系及测试用例的资源池。
其中,控制器103接收到任务ID之后,从数据服务器201获取与任务ID对应的任务信息,及从文件服务器202获取与任务ID对应的测试用例。即控制器103能够从数据服务器201及文件服务器202分别获取任务信息及测试用例。
需要说明的是,在应用中还可以将数据服务器201及文件服务器202设 置为同一个服务器,即在同一个服务器上保存任务ID与任务信息之间的对应关系,及保存任务ID与测试用例之间的对应关系及测试用例的资源池。
步骤503、控制器103将测试用例分解为两个或两个以上执行步骤;
步骤504、控制器向申请到的执行代理104发送执行步骤及任务信息;
步骤505、执行代理104按照任务信息执行接收到的执行步骤;
在本发明实施例中,对于每一个接收到任务ID的控制器103,在接收到任务ID之后,控制器103将根据接收到的任务ID获取测试用例和任务信息,分解该测试用例得到两个或两个以上执行步骤,并向资源管理中心102申请执行代理资源,分别向申请到的执行代理104发送其所需要执行的执行步骤及任务信息。例如,若有四个执行步骤,则需要为每一个执行步骤申请一个执行代理,使得能够将测试用例的执行步骤部署在不同的执行代理上进行处理,能够有效的缩短测试时间,且通过并行处理的方式,能够充分利用测试资源,避免资源闲置。
其中,测试用例可以是自动化测试用例,可以是由自动化测试用例工具设计出来的,且测试用例是由执行步骤构成的,因此,控制器103可以将获取到的测试用例分解成两个或两个以上执行步骤。
其中,任务信息中包含对测试用例进行测试时的测试参数,例如环境参数、配置参数等参数。
其中,执行代理104在接收到执行步骤和任务信息之后,将按照该任务信息执行接收到的执行步骤,对于一个测试用例,在其每一个执行步骤都分别由执行代理104执行完之后,则完成该测试用例的测试。
在本发明实施例中,控制器103在申请执行代理时,将确定每一个执行步骤所对应的模块类型,并向资源管理中心102申请具有相同模块类型的执行代理,向申请到的执行代理104发送对应的执行步骤及执行步骤的任务信息。例如,若执行步骤1-3分别对应的模块类型为A-C,则对于执行步骤1,需要申请模块类型为A的执行代理104,对于执行步骤2,需要申请模块类型为B的执行代理104,对于执行步骤3,需要申请模块类型为C的执行代理104。且资源管理中心102在接收到申请请求后,将根据需要申请的模块 类型为执行步骤分配执行代理104,使得能够为每一个执行步骤申请到具有其所需要的模块类型的执行代理104。且执行代理104在执行接收到的执行步骤之前,将确定执行该执行步骤的模块是否可用。
其中,执行代理中的模块即组件,例如QTP,SilkTest等,且执行代理104在执行接收到的执行步骤时,是通过调用组件进行执行的。需要说明的是,执行代理104在调用组件运行执行步骤时,需要确定该组件是否已经启动,若已经启动则说明该组件当前不可用,需要等待该组件资源被释放,若该组件未启动,则可调用该组件按照任务信息执行接收到的执行步骤。
步骤506、执行代理104向控制器103反馈生成的日志文件和测试结果信息;
步骤507、控制器103将整合得到的测试结果文件和接收到的日志文件发送给数据服务器201;
步骤508、控制器103将整合得到的测试结果文件和接收到的日志文件发送给文件服务器202。
在本发明实施例中,执行代理104还设置为在执行完接收到的执行步骤之后,将生成的日志文件及执行步骤的测试结果信息反馈给控制器103;且控制器103还设置为将接收到的测试结果信息整合成测试用例的测试结果文件,将接收到的日志文件及测试结果文件发送给数据服务器201及文件服务器202进行保存。例如,若控制器103将执行步骤A-C分别发送给执行代理A-C,则执行代理A将执行完接收到的执行步骤A后生成的日志文件A及测试结果信息A发送给控制器103,执行代理B将执行完接收到的执行步骤B后生成的日志文件B及测试结果信息B发送给控制器103,执行代理C将执行完接收到的执行步骤B后生成的日志文件C及测试结果信息C发送给控制器103,控制器103将测试结果信息A-C整合成一个测试结果文件,并将日志文件A-C及测试结果文件发送给数据服务器201及文件服务器202,由数据服务器201及文件服务器202保存该日志文件A-C及该测试结果文件。需要说明的是,图3所示实施例中虚线部分为响应。
在本发明实施例中,在确定待执行的作业之后,任务中心101向资源管理中心102申请控制器资源,并向申请到的控制器103发送该作业中包含 的任务ID,由控制器103根据该任务ID获取测试用例和任务信息,分解该测试用例得到多个执行步骤,并向资源管理中心102申请执行代理资源,分别向申请到的执行代理104发送该执行代理104所需要执行的执行步骤及任务信息,并由执行代理104按照接收到的任务信息执行接收到的执行步骤。通过将测试用例分解为多个执行步骤,并分别发送给不同的执行代理104进行执行,使得能够缩短对测试用例进行测试的时间,且通过并行测试的方式,能够充分利用控制器资源及执行代理资源,避免资源闲置。
在图1至图5所示的实施例中,控制器103及执行代理104可以通过向资源管理中心102发送注册消息的方式完成注册,其中,注册消息中包含注册信息。且在注册之后,还需要发送检测消息来检测已注册的控制器103及执行代理104是否在线,以保持心跳。
本领域普通技术人员可以理解上述方法中的全部或部分步骤可通过程序来指令相关硬件(例如处理器)完成,所述程序可以存储于计算机可读存储介质中,如只读存储器、磁盘或光盘等。可选地,上述实施例的全部或部分步骤也可以使用一个或多个集成电路来实现。相应地,上述实施例中的每个模块/单元可以采用硬件的形式实现,例如通过集成电路来实现其相应功能,也可以采用软件功能模块的形式实现,例如通过处理器执行存储于存储器中的程序/指令来实现其相应功能。本发明不限制于任何特定形式的硬件和软件的结合。
虽然本申请所揭露的实施方式如上,但所述的内容仅为便于理解本申请而采用的实施方式,并非用以限定本申请,如本发明实施方式中的具体的实现方法。任何本申请所属领域内的技术人员,在不脱离本申请所揭露的精神和范围的前提下,可以在实施的形式及细节上进行任何的修改与变化,但本申请的专利保护范围,仍须以所附的权利要求书所界定的范围为准。
工业实用性
上述技术方案缩短了对测试用例进行测试的时间,充分利用了控制器资源及执行代理资源,避免了资源闲置。

Claims (10)

  1. 一种软件测试方法,包括:
    控制器根据接收到任务唯一编码ID获取测试用例和任务信息;
    所述控制器分解所述测试用例得到两个或两个以上执行步骤,并向资源管理中心申请代理资源;其中,所述代理资源包括执行所述执行步骤及任务信息的执行代理;
    所述控制器向申请到的执行代理发送所述执行步骤及所述任务信息,由所述执行代理按照所述任务信息执行接收到的执行步骤。
  2. 根据权利要求1所述的软件测试方法,所述软件测试方法还包括:
    在所述测试用例的所有执行步骤执行完后,将所述测试用例返还资源池。
  3. 根据权利要求1所述的软件测试方法,所述软件测试方法还包括:
    在所述测试用例的任意一个执行步骤执行完后,将执行所述执行步骤的执行代理返还所述资源管理中心,以更新所述资源管理中心内执行代理。
  4. 根据权利要求1至3任意一项所述的软件测试方法,所述软件测试方法还包括:
    接收所述执行代理反馈的所述执行代理执行所述执行步骤后获得的测试结果信息;
    在接收到所述两个或两个以上执行步骤的测试结果信息后,将接收到的所述测试结果信息整合成所述测试用例的测试结果文件。
  5. 一种软件测试系统,包括:任务中心、资源管理中心、控制器和执行代理;
    所述任务中心,设置为在确定待执行的作业之后,向所述资源管理中心申请控制器资源,并向申请到的控制器发送所述作业包含的任务身份标识ID;
    所述控制器,设置为在接收到任务ID之后,根据所述任务ID获取测试用例和任务信息,分解所述测试用例得到两个或两个以上执行步骤,并向所 述资源管理中心申请执行代理资源,分别向申请到的执行代理发送所述执行代理所需要执行的执行步骤及所述任务信息;其中,所述代理资源包括执行所述执行步骤及任务信息的执行代理;
    所述执行代理,设置为在接收到执行步骤和任务信息之后,按照所述任务信息执行所述执行步骤;
    所述资源管理中心,设置为负责控制器资源和执行代理资源的申请。
  6. 根据权利要求5所述的系统,所述系统还包括数据服务器和文件服务器;其中,
    所述数据服务器设置为:保存任务ID与任务信息之间的对应关系;
    所述文件服务器设置为:保存任务ID与测试用例之间的对应关系及测试用例的资源池;
    所述控制器还设置为:在接收到所述任务ID之后,从所述数据服务器获取与所述任务ID对应的任务信息,及从所述文件服务器获取与所述任务ID对应的测试用例。
  7. 根据权利要求6所述的系统,
    所述执行代理还设置为:在执行完接收到的执行步骤之后,将生成的日志文件及所述执行步骤的测试结果信息反馈给所述控制器;
    所述控制器还设置为:将接收到的测试结果信息整合成所述测试用例的测试结果文件,将接收到的日志文件及所述测试结果文件发送给所述数据服务器及所述文件服务器进行保存。
  8. 根据权利要求5所述的系统,所述控制器还设置为:在启动之后向所述资源管理中心注册,并保持心跳;所述执行代理还设置为:在启动之后向所述资源管理中心注册模块类型,并保持心跳;
    则所述资源管理中心还设置为:负责所述控制器的注册及所述执行代理的模块类型的注册。
  9. 根据权利要求8所述的系统,所述控制器还设置为:
    在将所述测试用例分解为两个或两个执行步骤之后,确定执行步骤对应 的模块类型,并向所述资源管理中心申请具有相同模块类型的执行代理,分别向申请到的执行代理发送所述执行代理所需要执行的执行步骤及所述任务信息。
  10. 根据权利要求8所述的系统,所述执行代理是设置为:
    在接收到执行步骤及执行步骤的任务信息之后,根据所述执行步骤的模块类型确定相应的模块是否可用,若根据所述执行步骤的模块类型确定相应的模块可用,则按照所述任务信息通过所述模块执行所述执行步骤。
PCT/CN2017/079617 2016-05-09 2017-04-06 一种软件测试方法及系统 WO2017193737A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610303846.1A CN107357715A (zh) 2016-05-09 2016-05-09 软件测试方法及系统
CN201610303846.1 2016-05-09

Publications (1)

Publication Number Publication Date
WO2017193737A1 true WO2017193737A1 (zh) 2017-11-16

Family

ID=60266932

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/079617 WO2017193737A1 (zh) 2016-05-09 2017-04-06 一种软件测试方法及系统

Country Status (2)

Country Link
CN (1) CN107357715A (zh)
WO (1) WO2017193737A1 (zh)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110059008A (zh) * 2019-04-12 2019-07-26 广东电网有限责任公司信息中心 一种面向电力业务的测试云平台系统及测试方法
CN111651349A (zh) * 2020-05-26 2020-09-11 泰康保险集团股份有限公司 一种测试方法和装置
CN112398707A (zh) * 2020-11-03 2021-02-23 平安普惠企业管理有限公司 分布式自动化测试管理方法、装置、设备及存储介质
CN113721562A (zh) * 2021-07-22 2021-11-30 南京轶诺科技有限公司 一种产线测试资源自动化配置方法
WO2022060583A1 (en) 2020-09-03 2022-03-24 Revolution Medicines, Inc. Use of sos1 inhibitors to treat malignancies with shp2 mutations

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110413502A (zh) * 2018-04-28 2019-11-05 北京京东尚科信息技术有限公司 程序测试方法及系统、计算机系统和计算机可读存储介质
CN108804311B (zh) * 2018-05-07 2022-06-03 微梦创科网络科技(中国)有限公司 一种执行测试文件的方法及装置
CN109460359A (zh) * 2018-10-26 2019-03-12 深圳市鼎阳科技有限公司 一种用于嵌入式设备的软件版本测试方法及系统
CN110262967A (zh) * 2019-06-05 2019-09-20 微梦创科网络科技(中国)有限公司 一种应用于自动化测试的日志输出方法与装置

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101246448A (zh) * 2008-03-17 2008-08-20 中兴通讯股份有限公司 一种自动化脚本实现方法
CN101847123A (zh) * 2010-05-26 2010-09-29 北京航空航天大学 一种机载计算机软件测试通用体系的构建方法
CN104536888A (zh) * 2014-12-24 2015-04-22 网易(杭州)网络有限公司 移动设备的游戏测试方法与系统

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101246448A (zh) * 2008-03-17 2008-08-20 中兴通讯股份有限公司 一种自动化脚本实现方法
CN101847123A (zh) * 2010-05-26 2010-09-29 北京航空航天大学 一种机载计算机软件测试通用体系的构建方法
CN104536888A (zh) * 2014-12-24 2015-04-22 网易(杭州)网络有限公司 移动设备的游戏测试方法与系统

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110059008A (zh) * 2019-04-12 2019-07-26 广东电网有限责任公司信息中心 一种面向电力业务的测试云平台系统及测试方法
CN111651349A (zh) * 2020-05-26 2020-09-11 泰康保险集团股份有限公司 一种测试方法和装置
CN111651349B (zh) * 2020-05-26 2023-07-14 泰康保险集团股份有限公司 一种测试方法和装置
WO2022060583A1 (en) 2020-09-03 2022-03-24 Revolution Medicines, Inc. Use of sos1 inhibitors to treat malignancies with shp2 mutations
CN112398707A (zh) * 2020-11-03 2021-02-23 平安普惠企业管理有限公司 分布式自动化测试管理方法、装置、设备及存储介质
CN113721562A (zh) * 2021-07-22 2021-11-30 南京轶诺科技有限公司 一种产线测试资源自动化配置方法

Also Published As

Publication number Publication date
CN107357715A (zh) 2017-11-17

Similar Documents

Publication Publication Date Title
WO2017193737A1 (zh) 一种软件测试方法及系统
US9851996B2 (en) Applying firmware updates in a system with zero downtime by selectively offlining and onlining hardware using a scale-up hypervisor layer
CN108228256B (zh) 代码同步方法、装置、计算机可读介质及终端
US9386079B2 (en) Method and system of virtual desktop infrastructure deployment studio
US10832224B2 (en) Calendar based management of information technology (IT) tasks
US8954579B2 (en) Transaction-level health monitoring of online services
CN107807815B (zh) 分布式处理任务的方法和装置
US20090077090A1 (en) Method and apparatus for specifying an order for changing an operational state of software application components
US20190158626A1 (en) Method, apparatus and computer readable storage medium for processing service
CN109117252B (zh) 基于容器的任务处理的方法、系统及容器集群管理系统
JP2001147901A (ja) ローカル・ジョブ制御システムを有する分散処理システム内での外部ジョブ・スケジューリング方法及びシステム
CN113220431B (zh) 跨云的分布式数据任务调度方法、设备及存储介质
US10146674B2 (en) Plugin-based software verification system
CN108874549B (zh) 资源复用方法、装置、终端和计算机可读存储介质
US8938490B2 (en) System and method for accessing mainframe system automation from a process automation application
WO2018201778A1 (zh) 部署云应用系统的方法及装置
CN103077034B (zh) 混合虚拟化平台java应用迁移方法与系统
CN108762905A (zh) 一种多任务事件的处理方法和装置
CN110659131A (zh) 任务处理方法、电子装置、计算机设备及存储介质
CN110659104B (zh) 一种业务监控方法及相关设备
CN111666141A (zh) 任务调度方法、装置、设备及计算机存储介质
EP3724776A1 (en) Method, function manager and arrangement for handling function calls
CN106648871B (zh) 一种资源管理方法及系统
CN117076096A (zh) 任务流程的执行方法、装置、计算机可读介质及电子设备
CN112286633A (zh) 基于CloudStack平台的虚拟机创建方法、装置、设备及存储介质

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17795355

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 17795355

Country of ref document: EP

Kind code of ref document: A1