CN114564409A - Automatic testing method, device, equipment and storage medium - Google Patents

Automatic testing method, device, equipment and storage medium Download PDF

Info

Publication number
CN114564409A
CN114564409A CN202210275031.2A CN202210275031A CN114564409A CN 114564409 A CN114564409 A CN 114564409A CN 202210275031 A CN202210275031 A CN 202210275031A CN 114564409 A CN114564409 A CN 114564409A
Authority
CN
China
Prior art keywords
task
test
information
case
executed
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN202210275031.2A
Other languages
Chinese (zh)
Inventor
刘雪芳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
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 Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202210275031.2A priority Critical patent/CN114564409A/en
Publication of CN114564409A publication Critical patent/CN114564409A/en
Pending legal-status Critical Current

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
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3692Test management for test results analysis

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)
  • Debugging And Monitoring (AREA)

Abstract

The disclosure provides a method, a device, equipment and a storage medium for automatic testing, and relates to the technical field of computer data processing, in particular to the technical field of software testing. The specific implementation scheme is as follows: acquiring task information of an executed first test task, wherein the task information comprises a task identifier, a task execution parameter and/or a task execution result; acquiring case information of a test case executed by a first test task, wherein the case information comprises a program code and an execution result of the test case; and displaying the task information and the use case information. According to the method, by acquiring the task information and the case information of the executed test task, including the program code of the test case, and displaying the task information and the case information, more bases are provided for analyzing the failure reason of the test case, and the failure reason of the test case is easier to quickly locate.

Description

Automatic testing method, device, equipment and storage medium
Technical Field
The present disclosure relates to the field of computer data processing technologies, and in particular, to the field of software testing technologies.
Background
In current test reports, each test case (case) typically shows only success (pass) or failure (fail) and limited log information. Most of the failure cases need to synchronize the test code to the local, and the root cause of the problem can be found through multiple runs and analyses.
Disclosure of Invention
The disclosure provides a method, an apparatus, a device and a storage medium for automated testing.
According to an aspect of the present disclosure, there is provided a method of automated testing, comprising: acquiring task information of an executed first test task, wherein the task information comprises a task identifier, a task execution parameter and/or a task execution result; acquiring case information of a test case executed by a first test task, wherein the case information comprises a program code and an execution result of the test case; and displaying the task information and the use case information.
According to another aspect of the present disclosure, there is provided an apparatus for automated testing, including: the task information acquisition module is used for acquiring task information of the executed first test task, and the task information comprises a task identifier, a task execution parameter and/or a task execution result; the test system comprises a case information acquisition module, a test task execution module and a test task execution module, wherein the case information acquisition module is used for acquiring case information of a test case executed by a first test task, and the case information comprises a program code and an execution result of the test case; and the test information display module is used for displaying the task information and the case information.
According to another aspect of the present disclosure, there is provided an automated test integration system, including: the test task execution subsystem is used for executing a first test task or a second test task in the automatic test method; the test task report display subsystem is used for displaying task information and case information in the automatic test method; and the source code management subsystem of the test case is used for acquiring the program codes in the case information of the automatic test method.
According to another aspect of the present disclosure, there is provided an electronic device including: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform any of the methods of automated testing described above.
According to another aspect of the present disclosure, there is provided a non-transitory computer readable storage medium having stored thereon computer instructions for causing a computer to perform any of the above automated testing methods.
According to another aspect of the present disclosure, a computer program product is provided, comprising a computer program which, when executed by a processor, implements any of the above methods of automated testing.
The embodiment of the disclosure provides a method, a device, equipment and a storage medium for automatic testing, wherein the method provides more bases for analyzing the failure reason of a test case and is easier to quickly locate the failure reason of the test case by acquiring task information and case information of an executed test task, including program codes of the test case, and displaying the task information and the case information.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present disclosure, nor do they limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
The drawings are included to provide a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
FIG. 1 is a schematic flow chart diagram of a method for implementing automated testing according to a first embodiment of the present disclosure;
FIG. 2 is a schematic diagram of a flow of executing a test task according to a second embodiment of the disclosure;
FIG. 3 is a graphical interface diagram of a third embodiment of the present disclosure showing a report and analysis of failed test cases;
FIG. 4 is a schematic diagram of a page hierarchy displaying classification statistics according to a fourth embodiment of the present disclosure;
FIG. 5 is a schematic diagram of a test frame for use with a fifth embodiment of the present disclosure;
FIG. 6 is a schematic structural diagram of an apparatus for automated testing according to an embodiment of the present disclosure;
FIG. 7 is a schematic structural diagram of an automated test integration system according to an embodiment of the disclosure;
FIG. 8 is a block diagram of an electronic device for implementing a method of automated testing of an embodiment of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, in which various details of the embodiments of the disclosure are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Fig. 1 shows a main flow of a method for implementing automated testing according to an embodiment of the present disclosure, including: a method of automated testing is provided, comprising:
operation S110, acquiring task information of the executed first test task, where the task information includes a task identifier, a task execution parameter, and/or a task execution result;
the test task refers to a computer task for executing a group of test cases, and comprises a series of operations of obtaining a test case to be executed, building a test environment for executing a test, executing the test case, collecting a test execution result and log information and environment information in the execution process.
Typically, each test task is assigned a character or number, i.e., task identifier, that uniquely identifies the current execution. By the task identifier, the state information of the task and the execution parameters used when the task is submitted can be acquired in real time. If the test task is executed, the execution result of the task execution can be obtained through the task identifier.
The task execution parameters mainly refer to parameters specified when a task is executed, such as a range of test cases to be executed, a test platform used for executing the test cases, a mode (parallel, serial) used for executing the test cases, and the like.
The test platform used herein refers to a specific set of frames for driving test operation, such as ant, gradle, postman, etc.
The task execution result mainly comprises: the completion state of the test task comprises completion of execution, interruption or exit due to reasons and the like; the execution time of the test task comprises start time, end time and the like; relevant information collected during the process of executing the test case, for example, screen output information, Response information (Response) received by the test terminal, log file information, and test environment information (including a machine name, an operating system, a running engine, etc. for executing the test); the execution result of the test case (test case), and the like.
Operation S120, acquiring case information of a test case executed by the first test task, where the case information includes a program code and an execution result of the test case;
the execution result of the test case refers to whether the test case passes or fails. The execution result of the test case can be obtained from the execution result of the test task.
The test cases are also usually written by a programming language or a scripting language, and before the test cases are executed, a source program containing the programming language or the scripting language is compiled into an executable binary object program, and then the binary object program is executed to obtain an execution result of the test cases.
The program code of the test case refers to the program code in the source program, and particularly refers to the program code for controlling the test steps and determining the test result.
The program code for obtaining the test case can be obtained generally by:
1) obtaining from a code library storing a source program;
2) if the source program of the test case is packaged in the task execution result of the test task, the source program may also be obtained from the task execution result.
In operation S130, the task information and the use case information are displayed.
Because the execution results of the same group of test cases on different test platforms, different operating systems or different machines may be different, the task information of the executed test cases is acquired and displayed, the task execution result and the task execution parameter are favorably compared, and the incidence relation between the task execution result and the task execution parameter is acquired according to the comparison result, so that the root cause of the test failure is favorably positioned.
For example, if a certain set of tests always fails under the Windows operating system and always succeeds under the linux operating system, it indicates that the test failure is related to the operating system, and it may be determined that the test result of the test is related to the operating system. Developers may focus on analyzing code segments associated with an operating system.
For example, if all the execution parameters of the test task are the same but fail from a certain time, possibly due to a change made at a certain time before the certain time, the sender may focus on analyzing the modified code segment at a certain time before the certain time.
Therefore, even if the test task is not repeatedly executed, the reason of the failure of the test case can be simply analyzed, and the times of repeatedly executing the test task can be greatly saved.
Acquiring and displaying the program code of the test case, which is helpful for understanding the test logic and the test intention, and the context information of the test execution; if the test case failure is caused by the test program code error, the test error can be directly observed by acquiring the program code of the test case.
Therefore, when the user sees the execution result of the test case, the user can see the program code of the test case without downloading the corresponding code to the local, so that the failure reason of the test case can be analyzed more conveniently.
It should be noted that the embodiment shown in fig. 1 is only one basic embodiment of the method for automated testing of the present disclosure. The implementer may further refine and expand the method used in the embodiment shown in fig. 1 according to implementation requirements and implementation conditions.
FIG. 2 illustrates another embodiment of the present disclosure, which receives the specified task execution parameters and executes the main flow of the first test task. As shown in fig. 2, includes:
operation S2010, receiving test task execution parameters;
wherein, the task execution parameters include:
module name of automated test case (case);
and (3) task sources: for example, ticker, sandbox, tower (checker), agile, online, monitor;
task target address (target): a task target address;
an agile pipeline id;
a task trigger person;
task submission time, etc.
Operation S2020, judging whether the necessary transmission parameters are missing, if so, continuing to operate S2030, otherwise, continuing to operate S2040;
the implementer may specify some task execution parameters as required as must-pass parameters, must specify a value: and other unnecessary parameters can be specified or not, and if not, default values are used.
Operation S2030, prompting that the necessary transmission parameter is missing;
operation S2040, detecting whether a basic task is needed for the test, if not, continuing to step S2050, if yes, continuing to step S2060;
when detecting whether a basic task is needed or not, the method can be specified by a special task execution parameter, for example, an execution parameter representing whether the basic task needs to be executed or not; it can also be determined by the test source, for example, in general, the test task with the test source sandbox is not required for the basic task, and the test task with the test source ticker is required for the basic task for comparison.
Operation S2050, storing a piece of test task data in the task table;
in operation S2060, a piece of basic task data and a piece of test task data to be compared are put in the task table.
The test task may be executed immediately thereafter, or may be initiated by another thread according to a specified time. The process of executing the test task mainly comprises the following steps:
operation S2070, obtain task execution parameters;
operation S2080, executing a specified test case on the test platform corresponding to the task source according to the task execution parameter;
in the embodiment of the disclosure, a mapping table between the task source and the test platform is also established for different task sources. When the user only knows the testing source but does not know the testing platform corresponding to each task source, the testing platform to be run for testing can be determined through the mapping table.
In other embodiments, the test platform may also be specified directly in the execution parameters if the user clearly determines the test platform to be used. Therefore, a user does not need to know a specific execution instruction or script of each test platform, only needs to specify a test source or the test platform, and operation of executing a test task is greatly simplified.
Operation S2090, collecting a log generated by executing the test case;
operating S2100, judging whether the test case in the log is in the test case table, if not, continuing to step S2120, and if so, continuing to step S2130;
here, the test case table is used to collect the test cases executed by the test task. According to the test cases executed by the test task, the detailed information related to the test cases can be conveniently collected, the test cases are counted, and the test cases are associated with the test case source programs in the code base.
Operation S2110, storing the test cases into a test case table;
operation S2120, collecting detailed information of the test cases, and storing the detailed information in a case information table;
in the embodiment of the present disclosure, the detailed information of the test case includes:
a test case path;
a test case name;
testing a check point: testing the expected value and the actual value of the code output;
and (3) testing execution conditions: log information related to the test;
in operation S2130, the task information is updated.
And recording the task execution result of the test task according to the execution result of the test task.
If the test task is a test task to be compared associated with a basic task, the test task and the test cases of the basic task need to be compared, and a part of the execution result of the test task to be compared, which is different from the case information of the same test case in the execution result of the basic task, that is, the difference information of the test cases is found and marked.
In this way, when the use case information is displayed, the difference information can be highlighted using a more conspicuous format such as "bold" or "red".
In the disclosed embodiment, the execution of the test tasks may be performed in parallel. For example, a process is created for each user performing a test task, so that test tasks performed by multiple users can be performed in parallel without affecting each other.
In the embodiment of the present disclosure, the test cases in the test task may also be run in a parallel manner through parameter specification, for example, when it is determined that the parameters of the run mode indicate parallel execution, a thread is newly started to run the specified test cases.
According to the embodiment of the disclosure, different test task execution parameters can be received, and a platform used for executing a test, an executed test case, a test executing mode and the like can be determined through the task execution parameters. Therefore, various different requirements of users can be met, and differences of test cases executed by various test platforms are packaged, so that the operation of executing the test cases on different test platforms is greatly simplified. Regardless of the test source and the test platform, the test platform can be executed from one entrance, and the use is more convenient.
FIG. 3 illustrates another embodiment of the present disclosure in which task information and use case information are displayed in a control or page using a graphical interface (GUI) in the embodiment illustrated in FIG. 3. The content shown in the block in fig. 3 is a control (e.g., a button, a text box, a list or a frame, etc.) or a page on the graphical interface, and the implementer can flexibly select the content according to implementation requirements and implementation conditions.
The report display 301 is configured to display task information 3011 and a test report in the task table and detailed case information 3012 for each test, where the detailed case information further includes case information 30121, log information, and server response information 30122 in the test case table.
If the response information returned by the server is serialized information, the embodiment of the disclosure also deserializes the serialized information and displays the deserialized information. Thereby ensuring that the server response information 30122 is always readable and meaningful.
Specifically, for a common test task, failed test cases and the number of failed test cases are displayed in a test report and detailed case information 3012 for each test; if no failed test case exists, the task execution result is displayed as 'success (pass)'.
For the test tasks to be compared associated with the base task, the test report and the detailed case information 3012 for each test show: the number of test cases with failed basic tasks; the number of failed test cases of the test task; comparing the test tasks with the basic tasks, and obtaining the number of different test cases (diffcase) with different results; if the number of the test cases with different results is larger than 1, a button is displayed, and the detailed information of the test cases with different results can be displayed by clicking the button.
In the embodiment of the present disclosure, the program code of the test case is displayed by viewing the case code 302 in the graphical interface. Later, if the user needs to modify the program code, the user code 309 can be edited to display a page integrated development environment (WebIDE) to facilitate the user to modify and submit the code of the test case quickly without additionally building the integrated development environment and downloading and submitting the test code.
Specifically, in the embodiment of the present disclosure, after "edit case code 309" is clicked, the code of the test case is automatically pulled from the code library, a dependency library (lib) is installed, and the test case is added, deleted, checked, changed, run, and submitted through the page integration development environment.
In addition, a test case retry function is provided on the graphical interface, and a user can confirm task execution parameters of a retry test task according to task information 3011 and test report and detailed case information 3012 in the task table and specify the task execution parameters to execute the test task 308 so as to re-execute a failed test case.
Further, in embodiments of the present disclosure, a plurality of retry approaches are also provided, including: original instance retry 304, custom retry 305, and online retry 306.
The original instance retry 304 is used for executing the parameters on the original instance by the original tasks, re-executing the test case, and displaying the result, the checkpoint information, the log button (used for checking the log information) and the response information button (used for checking the server response information) through an execution result popup after the test case is finished;
a user-defined retry 305, which is used for user-defined input of any network address and port (ip: port), network Domain Name (DNS), configuration keyword and other task execution parameters to execute the test case, and after the test case is finished, the result, check point information, log button (used for checking log information) and response information button (used for checking server response information) are displayed through an execution result popup;
and the online retry 306 is used for executing the parameters on the online instance by the original tasks, re-executing the test case, and displaying the result, the checkpoint information, the log button (used for checking the log information) and the response information button (used for checking the server response information) through an execution result popup after the test case is finished. In which an online instance is typically an instance that has been or is dedicated to testing before being placed into operation.
In the embodiment of the disclosure, after receiving the execution command of the retry test case, the retry test case task is executed in response to the execution command of the retry test case (the second test task), wherein the execution parameter of the retry test case task is determined according to the task information and the case information of the executed test task.
Here, the task execution parameters that the retry task can specify are the same as the task execution parameters used for executing the test task, and thus are not described again.
Therefore, the test case can be retried conveniently on the test report display page, and the latest test case execution result is obtained, so that the reason of case failure is further determined, and the test case which fails is retried without additionally constructing a test environment.
If the failure reason of the test case can be determined through the checkpoint information, the server response information and the log information in the case information, the failed test case can be labeled through the label 307 to record the failure reason.
In the embodiment of the present disclosure, after clicking the label 307, the failure reason classification can be further selected through a drop-down list: such as "function offline", "data change", "function change", "environmental issue", "case code bug", "other", etc., and then specific failure reasons and more detailed information may be manually filled in. Therefore, once a certain tester analyzes the failure reason of a certain test case, the failure reason can be recorded and shared with other testing or research and development personnel, and history records are provided for providing a basis for tracing the failure of the test case.
In the embodiment of the present disclosure, in addition to the program code and the execution result of the test case, more detailed case information is also given, for example, log information, checkpoint information, server response information, and the like. Therefore, more bases can be provided for analyzing the failure reason of the test case.
The information can be generated by acquiring a log file for executing the test case; extracting test check point information from the log file; and performing deserialization on the serialized response information to obtain deserialized response information and the like.
If the reason of failure cannot be determined sufficiently by the above information recorded during the execution of the test case, the failed test case can be retried in real time, even by modifying the test code immediately, so as to further verify the analysis result of the reason of failure.
Once the failure reason is confirmed, the test case can be immediately marked. Therefore, the basic functions and all links of failure test case analysis such as report lookup, case retry, failure reason marking and the like can be integrated by using the same interface, the operation is simple, and great convenience is brought to the analysis of the failure reasons of the test cases by testers or research and development personnel.
Therefore, even if the test case is not tested, analysis and retry of the test case can be tried, so that the quality of the product can reach the standard quickly, and the online period is shortened.
Fig. 4 illustrates another embodiment of the present disclosure.
In an embodiment of the disclosure, the following method is also performed: acquiring task information of at least one executed test task and case information of a test case executed by each test task; and carrying out classification statistics according to the task information of at least one executed test task and the case information of the test case executed by each test task to obtain classification statistical information.
In the embodiment of the present disclosure, a statistics page 40 shown in fig. 4 is further provided, which includes: a test source 1 statistical page 401, a test source 2 statistical page 402 and the like which are divided according to the test sources.
And carrying out layering and grouping statistics according to the service dimension, the task dimension and the test case dimension under the statistical page of each test source.
Taking the test source 1 statistics page 401 as an example, a business dimension statistics page 4011, a task dimension statistics page 40111, and a test case dimension statistics page 40112 are displayed on the test source 1 statistics page.
In the first row of the statistical page 401 of the test source 1, it is first shown that the test source runs the tasks such as PASS, FAIL, and is matched with the visual display such as the pie chart. Besides the pie chart, a list of 3 service modules with the maximum number of failed test cases can be displayed and sorted according to failure ratios. For example as shown in table 1:
Figure BDA0003553923790000101
TABLE 1
And displaying all failed task links for jumping to a failed task page, and turning over pages to check all failed tasks.
In addition, under each business module, statistics can be further carried out according to task dimensions, 3 test tasks with the largest number of failed test cases are displayed, and detail page links of the test tasks are given so as to check detailed information of each failed test task.
Similarly, under each service module, statistics can be further performed according to the dimensions of the test cases, 5 test cases with the largest failure times are displayed, and a detail page link of the test cases is given to check detailed information of each failed test case, wherein a 'history mark record' button can be clicked in the detailed information of the test cases, and history failure reasons of marks of the test cases are displayed.
When the classification statistical information is displayed, an implementer can write front-end codes by himself and carry out diversified display of pie charts, trend charts and the like through a visualization tool.
In the embodiment of the disclosure, by performing classified statistics on the test tasks and the test case information, the product quality can be observed more intuitively, weak links of the product, problems which need to be repaired or solved most urgently and the like can be known, and a decision basis is provided for further efficiently and quickly improving the product quality.
In order to better implement the method for automatically testing the present disclosure, in another embodiment of the present disclosure, the organization structure and the calling framework of the test case are also optimized by using the testing framework shown in fig. 5.
As shown in fig. 5, the test frame includes:
a common protocol encapsulation 501 for encapsulating code calls of a protocol;
for example, class libraries related to common protocols such as http, nshead, mcpack, pb, rpc and the like are placed under a public lib library, and a unified calling interface is provided for a test case to use;
a common tool wrapper 502 for wrapping code calls for tools;
for example, the package bns analyzes common tools such as a case analysis tool, a case execution tool, an assertion tool, a log writing tool, a report generation tool, and places the related implementation class library under the public lib library, and provides a uniform call interface for the test case to use;
a log generation package 503 for packaging the code call generated by the log;
the task execution package 504 is used for packaging code call of test task execution, using task execution parameters to replace configuration files to specify test environment variables and supporting independent execution and parallel execution of test cases;
the testing environment variables include a host address of a testing host (host), a testing source, a testing platform and the like.
In addition, in another embodiment of the present disclosure, encapsulation may also be performed through tasks, supporting: executing a test case independently; port, replacing ip by the configuration of the input keywords; batch casting support is realized by transmitting task _ id; recording the log according to the time stamp by default without transmitting the task _ id; adding check point display to the test report (for platform call service); and the test cases are executed concurrently, the QPS can be defined by user, and service degradation caused by excessive concurrency is avoided.
Thus, by performing task encapsulation, the implementation of test codes of the service modules, for example, the service module 1 and the service module 2, can be greatly simplified. Each service module only needs to be concerned with the service logic and the test logic of the respective service, without considering the code portions related to the execution of the test tasks.
In the technical scheme of the disclosure, the acquisition, storage, application and the like of the personal information of the related user all accord with the regulations of related laws and regulations, and do not violate the good customs of the public order.
According to an embodiment of the present disclosure, the present disclosure further provides an apparatus for automated testing, as shown in fig. 6, the apparatus 60 including: the task information acquiring module 601 is configured to acquire task information of an executed first test task, where the task information includes a task identifier, a task execution parameter, and/or a task execution result; a case information obtaining module 602, configured to obtain case information of a test case executed by a first test task, where the case information includes a program code and an execution result of the test case; and a test information display module 603 configured to display the task information and the case information.
According to an embodiment of the present disclosure, the first test task includes a base task and a test task to be compared, and the apparatus 60 further includes: the case information comparison module is used for comparing the case information of the basic task and the test task to be compared to obtain the difference information of the test case; and the difference information comparison module is used for displaying the difference information.
According to an embodiment of the present disclosure, the apparatus 60 further includes: and the test task execution module is used for executing the first test task according to the specified task execution parameters, wherein the task execution parameters comprise the test platform and the execution parameters of the test platform.
According to an embodiment of the present disclosure, the apparatus 60 further includes: the system comprises a plurality of task information acquisition modules, a task processing module and a test case processing module, wherein the task information acquisition modules are used for acquiring task information of at least one executed test task and case information of a test case executed by each test task; and the classification statistical module is used for performing classification statistics to obtain classification statistical information according to the task information of at least one executed test task and the case information of the test case executed by each test task.
According to an embodiment of the present disclosure, the apparatus 60 further includes: and the second test task execution module is used for responding to an execution command of the second test task and executing the second test task, wherein the execution parameters of the second test task are determined according to the task information and the case information.
According to an embodiment of the present disclosure, the apparatus 60 further includes: receiving a modification to the program code; and submitting the modification.
According to an embodiment of the present disclosure, the apparatus 60 further includes: and receiving a failure type input by a user aiming at the test case, and adding the failure type to the case information obtained by executing the test case in the first test task.
According to an embodiment of the present disclosure, the case information further includes test checkpoint information, and the apparatus 60 further includes: acquiring a log file generated by executing a test case; and extracting the test checkpoint information from the log file.
According to an embodiment of the present disclosure, the use case information further includes serialized response information returned by the service, and the apparatus 60 further includes: and performing deserialization on the serialized response information to obtain deserialized response information.
According to an embodiment of the present disclosure, there is also provided an automated test integration system, as shown in fig. 7, including: a test task execution subsystem 701 configured to execute the test task (a first test task or a second test task); the test task report display subsystem 702 is configured to display task information and case information obtained after the test task is executed; and the source code management subsystem 703 of the test case is used for reading and writing the program codes in the case information.
As shown in fig. 7, in an embodiment of the present disclosure, the test task execution subsystem 701 stores task information into a task library, for example, mysql, when executing a test task. And stores the logs generated during the execution of the test task in a log library, e.g., redis.
After the test task report display subsystem 702 finishes executing the test task, task information and case information are obtained from the task library and the log library, and program codes of the test cases are obtained from the source code management subsystem 703 of the test cases according to the names of the test cases and the paths of the test cases, and the program codes of the test cases are edited and submitted.
In another embodiment of the present disclosure, the automated integration system further comprises: the test task statistics display subsystem 704 is used for acquiring task information of at least one executed test task and case information of a test case executed by each test task; and carrying out classification statistics according to the task information of at least one executed test task and the case information of the test case executed by each test task to obtain classification statistical information, and displaying the classification statistical information.
Therefore, the code management of the test case, the execution and the analysis of the test task can be integrated, the test case can be executed and analyzed more quickly and conveniently, and the quality of the test product can be known more intuitively.
The present disclosure also provides an electronic device, a readable storage medium, and a computer program product according to embodiments of the present disclosure.
FIG. 8 illustrates a schematic block diagram of an example electronic device 800 that can be used to implement embodiments of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 8, the apparatus 800 includes a computing unit 801 which can perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM)802 or a computer program loaded from a storage unit 808 into a Random Access Memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the device 800 can also be stored. The calculation unit 801, the ROM 802, and the RAM 803 are connected to each other by a bus 804. An input/output (I/O) interface 805 is also connected to bus 804.
A number of components in the device 800 are connected to the I/O interface 805, including: an input unit 806, such as a keyboard, a mouse, or the like; an output unit 807 such as various types of displays, speakers, and the like; a storage unit 808, such as a magnetic disk, optical disk, or the like; and a communication unit 809 such as a network card, modem, wireless communication transceiver, etc. The communication unit 809 allows the device 800 to exchange information/data with other devices via a computer network such as the internet and/or various telecommunication networks.
Computing unit 801 may be a variety of general and/or special purpose processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various dedicated Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and the like. The computing unit 801 performs the various methods and processes described above, such as the methods of automated testing of the present disclosure. For example, in some embodiments, the disclosed methods of automated testing may be implemented as a computer software program tangibly embodied in a machine-readable medium, such as storage unit 808. In some embodiments, part or all of the computer program can be loaded and/or installed onto device 800 via ROM 802 and/or communications unit 809. When loaded into RAM 803 and executed by computing unit 801, may perform one or more of the steps of the method of automated testing of the present disclosure described above. Alternatively, in other embodiments, the computing unit 801 may be configured by any other suitable means (e.g., by way of firmware) to perform the methods of automated testing of the present disclosure.
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions/operations specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server may be a cloud server, a server of a distributed system, or a server with a combined blockchain.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present disclosure may be executed in parallel, sequentially, or in different orders, and are not limited herein as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved.
The above detailed description should not be construed as limiting the scope of the disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present disclosure should be included in the scope of protection of the present disclosure.

Claims (20)

1. A method of automated testing, comprising:
task information of an executed first test task is obtained, wherein the task information comprises a task identifier, a task execution parameter and/or a task execution result;
acquiring case information of a test case executed by the first test task, wherein the case information comprises a program code and an execution result of the test case;
and displaying the task information and the use case information.
2. The method of claim 1, the first test task comprising a base task and a test task to be compared, the method further comprising:
comparing the case information of the basic task and the test task to be compared to obtain the difference information of the test case;
and displaying the difference information.
3. The method of claim 1, further comprising:
and executing the first test task according to the specified task execution parameters, wherein the task execution parameters comprise a test platform and execution parameters of the test platform.
4. The method of claim 3, further comprising:
acquiring task information of at least one executed test task and case information of a test case executed by each test task;
and carrying out classification statistics according to the task information of the at least one executed test task and the case information of the test case executed by each test task to obtain classification statistical information.
5. The method of claim 1, further comprising:
and responding to an execution command of a second test task, and executing the second test task, wherein the execution parameters of the second test task are determined according to the task information and the use case information.
6. The method of claim 1, further comprising:
receiving a modification to the program code;
the modification is submitted.
7. The method of claim 1, further comprising:
receiving a failure type input by a user for the test case,
and adding the failure type to case information obtained by executing the test case in the first test task.
8. The method of claim 1, the use case information further comprising test checkpoint information, the method further comprising:
acquiring a log file generated by executing the test case;
and extracting the test checkpoint information from the log file.
9. The method of claim 1, the use case information further comprising serialized response information returned by a service, the method further comprising:
and performing deserialization on the serialized response information to obtain deserialized response information.
10. The method of claim 1, wherein the test case run by the first test task is based on a test framework comprising:
a common protocol encapsulation for encapsulating code calls of a protocol;
a common tool encapsulation for encapsulating code calls for tools;
the log generation package is used for packaging the code call generated by the log;
and the task execution package is used for packaging the code call executed by the test task.
11. An apparatus for automated testing, comprising:
the task information acquisition module is used for acquiring task information of the executed first test task, wherein the task information comprises a task identifier, a task execution parameter and/or a task execution result;
the case information acquisition module is used for acquiring case information of a test case executed by the first test task, wherein the case information comprises a program code and an execution result of the test case;
and the test information display module is used for displaying the task information and the case information.
12. The apparatus of claim 11, the first test task comprising a base task and a test task to be compared, the apparatus further comprising:
the case information comparison module is used for comparing the case information of the basic task and the test task to be compared to obtain the difference information of the test case;
and the difference information comparison module is used for displaying the difference information.
13. The apparatus of claim 11, further comprising:
and the test task execution module is used for executing the first test task according to the specified task execution parameters, wherein the task execution parameters comprise a test platform and the execution parameters of the test platform.
14. The apparatus of claim 13, further comprising:
the system comprises a plurality of task information acquisition modules, a task processing module and a test case processing module, wherein the task information acquisition modules are used for acquiring task information of at least one executed test task and case information of a test case executed by each test task;
and the classification statistical module is used for performing classification statistics according to the task information of the at least one executed test task and the case information of the test case executed by each test task to obtain classification statistical information.
15. The apparatus of claim 1, further comprising:
and the second test task execution module is used for responding to an execution command of a second test task and executing the second test task, wherein the execution parameters of the second test task are determined according to the task information and the case information.
16. An automated test integration system comprising:
a test task execution subsystem for executing a first test task or a second test task as claimed in any one of claims 1-10;
a test task report display subsystem for displaying task information and use case information as claimed in any one of claims 1-10;
a source code management subsystem of the test case, configured to obtain the program code in the case information recited in any one of claims 1 to 10.
17. The test integration system of claim 16, further comprising:
a test task statistics display subsystem for displaying the classification statistics of claim 4.
18. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-9.
19. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-9.
20. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1-9.
CN202210275031.2A 2022-03-18 2022-03-18 Automatic testing method, device, equipment and storage medium Pending CN114564409A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210275031.2A CN114564409A (en) 2022-03-18 2022-03-18 Automatic testing method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210275031.2A CN114564409A (en) 2022-03-18 2022-03-18 Automatic testing method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114564409A true CN114564409A (en) 2022-05-31

Family

ID=81719356

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210275031.2A Pending CN114564409A (en) 2022-03-18 2022-03-18 Automatic testing method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114564409A (en)

Similar Documents

Publication Publication Date Title
CN105094783B (en) method and device for testing stability of android application
CN111124919A (en) User interface testing method, device, equipment and storage medium
CN110825619A (en) Automatic generation method and device of interface test case and storage medium
US11074162B2 (en) System and a method for automated script generation for application testing
CN114546738B (en) Universal test method, system, terminal and storage medium for server
CN110851324B (en) Log-based routing inspection processing method and device, electronic equipment and storage medium
CN111309343B (en) Development deployment method and device
CN112506799A (en) Business abnormity positioning method and device, electronic equipment, medium and product
CN111309609B (en) software processing system
CN111462811A (en) Automatic testing method and device, storage medium and electronic equipment
CN115658529A (en) Automatic testing method for user page and related equipment
CN111654495B (en) Method, apparatus, device and storage medium for determining traffic generation source
CN112817853A (en) Automatic test method, system and electronic equipment
CN110865941A (en) Interface test case generation method, device and system
CN117632710A (en) Method, device, equipment and storage medium for generating test code
CN111538542B (en) System configuration method and related device
CN112084108A (en) Test script generation method and device and related components
CN112988578A (en) Automatic testing method and device
CN112650673A (en) Method and device for creating test case in transaction tracking system and electronic equipment
CN116719736A (en) Test case generation method and device for testing software interface
CN114564409A (en) Automatic testing method, device, equipment and storage medium
CN111159028A (en) Webpage testing method and device
CN113312485B (en) Log automatic classification method and device and computer readable storage medium
CN115658478A (en) Test case screening method and device, electronic equipment and storage medium
CN110866492B (en) Baseline branch identification method and device and computer system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination