CN115878460A - Regression testing method, device, computer equipment and storage medium - Google Patents

Regression testing method, device, computer equipment and storage medium Download PDF

Info

Publication number
CN115878460A
CN115878460A CN202211505802.9A CN202211505802A CN115878460A CN 115878460 A CN115878460 A CN 115878460A CN 202211505802 A CN202211505802 A CN 202211505802A CN 115878460 A CN115878460 A CN 115878460A
Authority
CN
China
Prior art keywords
test
report
case
configuration file
regression
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
CN202211505802.9A
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.)
Shenzhen Grandstream Networks Technologies Co ltd
Original Assignee
Shenzhen Grandstream Networks Technologies 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 Shenzhen Grandstream Networks Technologies Co ltd filed Critical Shenzhen Grandstream Networks Technologies Co ltd
Priority to CN202211505802.9A priority Critical patent/CN115878460A/en
Publication of CN115878460A publication Critical patent/CN115878460A/en
Pending legal-status Critical Current

Links

Images

Abstract

The embodiment of the application belongs to the technical field of testing, and relates to a regression testing method, which comprises the following steps: when a regression test instruction is received, obtaining a test configuration file and each test case; grouping the test cases according to case grouping information in the test configuration file to obtain a plurality of test case groups; respectively establishing a test thread example corresponding to each test case group; performing regression testing on each test case group in parallel through each test thread case, and recording case testing results of each test thread case through case attributes of each test thread case; counting the test results of each example according to report generation information in the test configuration file to generate a test report; and sending the test report according to the report sending information in the test configuration file. The application also provides a regression testing device, computer equipment and a storage medium. The application improves the regression testing efficiency.

Description

Regression testing method, device, computer equipment and storage medium
Technical Field
The present application relates to the field of testing technologies, and in particular, to a regression testing method, apparatus, computer device, and storage medium.
Background
With the appearance of various software iterative development models, the iteration speed of various application or project versions is faster and faster, the functions are richer, and the time spent by regression testing of the applications or projects is longer and longer.
Although some automated regression testing tools improve regression testing efficiency to some extent, they still have some disadvantages. For example, before testing, a tester needs to select test cases of a system to be tested or a module to be tested in the system to be tested one by one; in the test, the test tool records the test result into the disk, and the disk needs to be read and written for many times when a test report is generated; when the regression test content is more and the generated test report content is more, it is difficult for the tester to quickly evaluate the quality of the regression test, which affects the efficiency of the regression test.
Disclosure of Invention
An embodiment of the present application provides a regression testing method, apparatus, computer device, and storage medium, so as to solve the problem of low regression testing efficiency.
In order to solve the above technical problem, an embodiment of the present application provides a regression testing method, which adopts the following technical solutions:
when a regression test instruction is received, obtaining a test configuration file and each test case;
grouping the test cases according to case grouping information in the test configuration file to obtain a plurality of test case groups;
respectively establishing a test thread example corresponding to each test case group;
performing regression testing on the test case groups in parallel through the test thread examples, and recording example testing results of the test thread examples through example attributes of the test thread examples;
counting the test results of each example according to the report generation information in the test configuration file to generate a test report;
and sending the test report according to report sending information in the test configuration file.
In order to solve the above technical problem, an embodiment of the present application further provides a regression testing apparatus, which adopts the following technical solutions:
the obtaining module is used for obtaining a test configuration file and each test case when a regression test instruction is received;
the test configuration file is used for storing test configuration information of the test cases;
the thread establishing module is used for respectively establishing a test thread example corresponding to each test case group;
the regression testing module is used for carrying out regression testing on the test case groups in parallel through the test thread examples and recording the example testing results of the test thread examples through the example attributes of the test thread examples;
the report generation module is used for counting the test results of each example according to the report generation information in the test configuration file to generate a test report;
and the report sending module is used for sending the test report according to the report sending information in the test configuration file.
In order to solve the above technical problem, an embodiment of the present application further provides a computer device, which adopts the following technical solutions:
when a regression testing instruction is received, a testing configuration file and each testing case are obtained;
grouping the test cases according to the case grouping information in the test configuration file to obtain a plurality of test case groups;
respectively establishing a test thread example corresponding to each test case group;
performing regression testing on the test case groups in parallel through the test thread examples, and recording example testing results of the test thread examples through example attributes of the test thread examples;
counting the test results of each example according to the report generation information in the test configuration file to generate a test report;
and sending the test report according to report sending information in the test configuration file.
In order to solve the above technical problem, an embodiment of the present application further provides a computer-readable storage medium, which adopts the following technical solutions:
when a regression test instruction is received, obtaining a test configuration file and each test case;
grouping the test cases according to case grouping information in the test configuration file to obtain a plurality of test case groups;
respectively establishing a test thread example corresponding to each test case group;
performing regression testing on the test case groups in parallel through the test thread examples, and recording example testing results of the test thread examples through example attributes of the test thread examples;
counting the test results of each example according to the report generation information in the test configuration file to generate a test report;
and sending the test report according to report sending information in the test configuration file.
Compared with the prior art, the embodiment of the application mainly has the following beneficial effects: when a regression testing instruction is received, a testing configuration file and each testing case are obtained, wherein the testing configuration file is configured in advance and used for controlling the regression testing process; through the use case grouping information in the test configuration file, each test use case can be grouped according to requirements to obtain a plurality of test use case groups; the method comprises the steps of establishing test thread examples corresponding to the test case groups respectively, performing regression testing on the test case groups in parallel through the test thread examples to improve testing efficiency, recording example testing results of the test thread examples through example attributes of the test thread examples, and storing the example attributes in a memory, so that the obtaining speed of the example testing results is improved; according to the report generation information in the test configuration file, the test results of all the examples are counted, the test report can be generated quickly, and the information is sent according to the report in the test configuration file to send the test report, so that the automatic processing of the whole regression test process is realized, and the regression test efficiency is improved.
Drawings
In order to more clearly illustrate the solution of the present application, the drawings used in the description of the embodiments of the present application will be briefly described below, and it is obvious that the drawings in the description below are some embodiments of the present application, and that other drawings may be obtained by those skilled in the art without inventive effort.
FIG. 1 is an exemplary system architecture diagram in which the present application may be applied;
FIG. 2 is a flow diagram of one embodiment of a regression testing method according to the present application;
FIG. 3 is a schematic block diagram of one embodiment of a regression test setup according to the present application;
FIG. 4 is a schematic block diagram of one embodiment of a computer device according to the present application.
Detailed Description
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs; the terminology used in the description of the application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application; the terms "including" and "having," and any variations thereof in the description and claims of this application and the description of the figures above, are intended to cover non-exclusive inclusions. The terms "first," "second," and the like in the description and claims of this application or in the above-described drawings are used for distinguishing between different objects and not for describing a particular order.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein may be combined with other embodiments.
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.
As shown in fig. 1, the system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
A user may use terminal devices 101, 102, 103 to interact with a server 105 over a network 104 to receive or send messages or the like. Various communication client applications, such as a web browser application, a shopping application, a search application, an instant messaging tool, a mailbox client, social platform software, etc., may be installed on the terminal devices 101, 102, 103.
The terminal devices 101, 102, 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III, motion Picture Experts compression standard Audio Layer 3), MP4 players (Moving Picture Experts Group Audio Layer IV, motion Picture Experts compression standard Audio Layer 4), laptop portable computers, desktop computers, and the like.
The server 105 may be a server providing various services, such as a background server providing support for pages displayed on the terminal devices 101, 102, 103.
It should be noted that, the regression testing method provided in the embodiments of the present application is generally executed by a server, and accordingly, the regression testing apparatus is generally disposed in the server.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
With continued reference to FIG. 2, a flow diagram of one embodiment of a regression testing method according to the present application is shown. The regression testing method comprises the following steps:
step S201, when a regression test instruction is received, a test configuration file and each test case are obtained.
In this embodiment, the electronic device (for example, the server shown in fig. 1) on which the regression testing method operates may communicate with the terminal through a wired connection or a wireless connection. It should be noted that the above-mentioned wireless connection means may include, but is not limited to, 3G/4G/5G connection, wiFi connection, bluetooth connection, wiMAX connection, zigbee connection, UWB (ultra wideband) connection, and other now known or later developed wireless connection means.
The regression testing instruction can be an instruction for instructing the server to perform regression testing; the test configuration file can be a file for configuring and controlling the regression test process, the test configuration file is written by a tester in advance, the tester inputs test configuration information in a WYSIWYG mode in a test page, and the test page generates the test configuration file according to the test configuration information and sends the test configuration file to the server for storage.
Specifically, the server performs regression testing according to the regression testing instruction, and when receiving the regression testing instruction, the server obtains a test configuration file and test cases which are configured in advance, and the number of the test cases can be multiple.
Further, before step S201, the method may further include: triggering a regression test instruction according to the timing task; or triggering a regression test instruction according to the received user operation.
Specifically, the regression test may be performed at a fixed time, so that a fixed time task may be set, and the fixed time task triggers a regression test instruction to instruct the server to perform the regression test. Alternatively, the regression test may be triggered based on a user operation, for example, the user clicks a virtual button representing the start of the regression test in a test page of the terminal, triggering a regression test instruction.
In this embodiment, the regression test may be triggered according to a timing task or a user operation, and has high flexibility.
And step S202, grouping the test cases according to the case grouping information in the test configuration file to obtain a plurality of test case groups.
Specifically, the test configuration file has case grouping information, and a plurality of test cases can be automatically grouped according to the case grouping information to obtain a plurality of test case groups. For example, in the existing multiple systems to be tested, according to the case grouping information, the test cases of each system to be tested can be divided into one group, and each system to be tested corresponds to one test case group.
Step S203, respectively establishing a test thread instance corresponding to each test case group.
Specifically, for each test case group, a test thread instance corresponding to the test case group is respectively established, that is, each test case group is tested by a single thread. In one embodiment, the number N of test thread instances required by the regression test is obtained through a python conditional control statement, and the N test thread instances are sequentially created and started through a python loop statement; in a multi-threaded operating system, threads have atomicity and orderliness, so that N test thread instances are established independently of each other.
And step S204, performing regression testing on each test case group in parallel through each test thread instance, and recording the instance testing result of each test thread instance through the instance attribute of each test thread instance.
Specifically, each test thread instance corresponds to one test case group, the test thread instance performs regression testing on the test case group, and multiple test thread instances can run in parallel, that is, the multiple test case groups are subjected to parallel regression testing simultaneously.
A test thread instance is an instance, with instance attributes. During the running of the test thread instance, the instance attribute is stored in the memory and has a temporary property. The embodiment attribute of the test thread instance is generated when the test thread instance is created, and the embodiment attribute of the test thread instance disappears when the test thread instance is destroyed.
The test thread instance generates instance test results by performing regression testing according to the test cases, the instance test results of each test case in the test case group form instance test results, and the instance test results are assigned to instance attributes. Based on the characteristic that the instance attributes are independent of each other, the instance test results of the test thread instances have isolation, so that the test results of different instances can be prevented from being confused, and the accuracy of obtaining and counting the instance test results is improved.
In the present application, in addition to N test thread instances, there are also main threads, and the server controls the main threads according to the number N of test thread instances. If the number of the test thread instances required by the regression test is more than 1, the main thread can be finished after the execution of all the N test thread instances is finished; if the number of the test thread instances required by the regression test is 1, a new thread instance does not need to be created, and the main thread is used as the test thread instance to execute the regression test.
Step S205, counting the test results of each example according to the report generation information in the test configuration file, and generating a test report.
Specifically, the test configuration file has report generation information, the report generation information may define a plurality of statistical indexes, perform statistics and calculation on the test results of each instance according to the statistical indexes, and generate a test report based on the statistics and calculation results. It is understood that the test report may also include the results of the example test.
And step S206, sending the test report according to the report sending information in the test configuration file.
Specifically, the test configuration file may include report sending information, where the report sending information records the test report to be sent, for example, the report sending information may be a database address, or a mailbox address, or may be an interface, and the server calls the interface to send the test report through the interface.
In the embodiment, when a regression test instruction is received, a test configuration file and each test case are obtained, wherein the test configuration file is configured in advance and is used for controlling the regression test process; through the case grouping information in the test configuration file, each test case can be grouped according to requirements to obtain a plurality of test case groups; the method comprises the steps of establishing test thread examples corresponding to test case groups respectively, conducting regression testing on the test case groups in parallel through the test thread examples to improve testing efficiency, recording example testing results of the test thread examples through example attributes of the test thread examples, and storing the example attributes in a memory, so that obtaining speed of the example testing results is improved; according to the report generation information in the test configuration file, the test results of all the examples are counted, the test report can be generated quickly, and the test report is sent according to the report sending information in the test configuration file, so that the automatic processing of the whole regression test process is realized, and the regression test efficiency is improved.
Further, the step S201 may include: when a regression test instruction is received, obtaining a test configuration file; determining candidate objects to be tested according to the test configuration file; acquiring an object evaluation index of the candidate object to be tested to determine the test state of the candidate object to be tested according to the object evaluation index; and when the test state is a testable state, obtaining a test case of the candidate object to be tested.
Specifically, when a regression test instruction is received, a test configuration file is obtained, and the test configuration file records candidate objects to be tested, where the candidate objects to be tested may be functional systems that may need to be tested or functional modules under the functional systems. Some functional systems/functional modules need to be subjected to periodic regression tests, and these functional systems/functional modules can be used as candidate objects to be tested. When a user writes a test configuration file, the user can input which functional systems/functional modules need to be subjected to regression testing, and the functional systems/functional modules can be used as candidate objects to be tested.
The candidate object to be tested has object evaluation indexes such as available disk space, network state, service running state and the like. The object evaluation index can reflect whether the candidate object to be tested is normal, if so, the current test state of the candidate object to be tested is a testable state, a corresponding test case is obtained, and the candidate object to be tested is determined as the object to be tested; if the candidate object to be tested is abnormal, the test state of the candidate object to be tested is a non-testable state, and the candidate object to be tested is skipped.
In this embodiment, the candidate object to be tested is obtained according to the test configuration file, whether the candidate object to be tested is normal at present is judged according to the object evaluation index of the candidate object to be tested, and if the candidate object to be tested is normal, the candidate object to be tested is in a testable state, and a corresponding test case is obtained, so that regression testing is performed only on the normal candidate object to be tested, the influence of abnormal self of the candidate object to be tested on the regression testing is avoided, and the accuracy of the regression testing is ensured.
Further, the step S202 may include: extracting grouping dimensions from use case grouping information of the test configuration file, wherein the grouping dimensions comprise a software architecture and a use case label; and grouping the test cases according to the grouping dimension to obtain a plurality of test case groups.
Specifically, the use case grouping information of the test configuration file includes grouping dimensions, and the grouping dimensions can indicate which dimensions the test case grouping is performed from, and how the test case grouping is performed specifically under the corresponding dimensions.
The grouping dimension comprises a software architecture and a case label, wherein the functional system and the functional modules under the functional system belong to the software architecture dimension, and are grouped from the software architecture, so that the test cases of the specified functional system and/or the specified functional module can be divided into a test case group, for example, the test cases of the functional system A, the functional system B and the functional system C are divided into a test case group; or, the test cases of the functional modules C in the functional system a and the functional system B are divided into one test case group.
The test cases also have case labels, and the case labels may include unique identifiers of the cases, identifiers of testers (i.e., some test cases may be responsible for the designated testers, and the identifiers of the testers in the test cases) and identifiers of user roles (i.e., some test cases are specific to a specific user role or a specific type of user role, and the identifiers of the user roles in the test cases). According to the case labels, a plurality of test cases can be quickly grouped, for example, the test cases with the same tester identifiers are divided into the same test case group.
In the embodiment, grouping dimensions are extracted from the case grouping information of the test configuration file, and test cases can be grouped from dimensions such as a software architecture and case labels according to the grouping dimensions, so that the diversity and the degree of freedom of test case grouping are realized, and various requirements are met.
Further, the step S205 may include: acquiring a statistical dimension and a report level parameter in a test configuration file, wherein the statistical dimension comprises a software architecture and a case label; counting the test results of each example according to the statistical dimension to obtain a statistical result; and generating a test report according to the report level parameters and the statistical result.
Specifically, before a report is generated, a statistical dimension and report level parameters are obtained from a test configuration file, wherein the statistical dimension refers to dimensions from which test results of each instance are counted and calculated, and the statistical dimension includes a software architecture and a use case label. The software architecture and use case tags herein are the same concepts as those mentioned in the test case group above.
For example, when the statistical dimension is a software architecture, the pass rate and/or the failure rate of the regression test of each functional system and the pass rate and/or the failure rate of the regression test of the functional module under the functional system may be calculated; the test cases which fail the regression test can be filtered and summarized according to the unique identification of the test cases.
When the statistical dimension is a case label, the passing rate and/or the failure rate of the regression test of each case label can be calculated, for example, when the case label is an identifier of a tester, the passing rate and/or the failure rate of a test case for which the tester is responsible can be calculated.
It is understood that the software architecture and the use case label may be combined together, for example, statistics may be performed on a passing rate and/or a failing rate of a certain tester under each functional system and/or functional module, a percentage of functional systems and/or functional modules in a test case with a successful test, and a percentage of functional systems and/or functional modules in a test case with a failed test.
The report level parameter may be a value indicating the level of the generated test report, and the software architecture may be item level, functional system level, and functional module level from large to small. According to the report level parameter, a test report can be generated according to the statistic data of the project level, or a test report of the functional system level, or a test report of the functional module level.
The statistics of the instance test results and the generation of the test report may be performed by the main thread, and in one embodiment, may also be performed by each test thread instance.
In the embodiment, according to the statistical dimensions in the test configuration file, example test results can be counted from dimensions such as a software architecture and a case label to obtain statistical results, and test reports of different levels are generated according to the report level parameters, so that the forms of the statistical results and the test reports are enriched.
Further, the step S206 may include: determining a target object and a sending channel corresponding to the test report according to report sending information in the test configuration file; and sending the test report to the target object based on the sending channel.
Specifically, the test configuration file may have report sending information, and the target object and the sending channel corresponding to the test report may be determined according to the report sending information. For example, the test thread instance tests a test case of the functional system 1, and the developer 1 of the functional system 1 is responsible for the test thread instance, so that the developer 1 is used as a target object, and when the target object is specifically sent, an account or a mailbox of the developer 1 needs to be acquired.
The target object may receive the test report through a variety of applications, namely, a delivery channel, including a mailbox or various applications, such as nailing office software. Based on the sending channel, the test report is sent to the target object, and the target object can receive and check the test report in time, so that the obtaining efficiency of the test report is improved.
In this embodiment, the target object and the sending channel are determined according to the report sending information in the test configuration file, and the test report is sent to the target object based on the sending channel, so that the target object can conveniently and quickly obtain the test report.
Further, the regression testing method may further include: performing resource check on the memory of the current equipment to obtain a resource check result; and performing memory recovery according to the resource checking result, wherein the memory recovery comprises thread destruction and variable destruction.
Specifically, the server may periodically perform a resource check on the memory, where the resource check may be to check whether there is an idle or failed thread in the memory, or an idle or failed variable. These threads or variables occupy memory resources, affecting the operating efficiency of the server and the efficiency of the regression testing. The detected idle, failed threads and variables are used as the resource check result.
The server can recycle the memory according to the resource checking result and destroy the idle and invalid threads and variables, thereby recycling the memory resource.
In this embodiment, the memory of the current device is subjected to resource check to detect whether idle and invalid threads or variables exist, and the threads or variables are destroyed to recover the memory resources, so that the operating efficiency of the server is ensured.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware associated with computer readable instructions, which can be stored in a computer readable storage medium, and when executed, the processes of the embodiments of the methods described above can be included. The storage medium may be a non-volatile storage medium such as a magnetic disk, an optical disk, a Read-Only Memory (ROM), or a Random Access Memory (RAM).
It should be understood that, although the steps in the flowcharts of the figures are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and may be performed in other orders unless otherwise indicated herein. Moreover, at least a portion of the steps in the flow chart of the figure may include multiple sub-steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed alternately or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
With further reference to fig. 3, as an implementation of the method shown in fig. 2, the present application provides an embodiment of a regression testing apparatus, where the embodiment of the apparatus corresponds to the embodiment of the method shown in fig. 2, and the apparatus may be specifically applied to various electronic devices.
As shown in fig. 3, the regression test apparatus 300 according to this embodiment includes: an obtaining module 301, a use case grouping module 302, a thread establishing module 303, a regression testing module 304, a report generating module 305, and a report sending module 306, wherein:
the obtaining module 301 is configured to obtain a test configuration file and test cases when a regression test instruction is received.
The use case grouping module 302 is configured to group the test use cases according to the use case grouping information in the test configuration file to obtain a plurality of test use case groups.
The thread establishing module 303 is configured to respectively establish a test thread instance corresponding to each test case group.
The regression testing module 304 is configured to perform regression testing on each test case group in parallel through each test thread instance, and record an instance testing result of each test thread instance through an instance attribute of each test thread instance.
The report generating module 305 is configured to count the test results of each instance according to the report generating information in the test configuration file, and generate a test report.
And a report sending module 306, configured to send a test report according to the report sending information in the test configuration file.
In the embodiment, when a regression test instruction is received, a test configuration file and each test case are obtained, wherein the test configuration file is configured in advance and is used for controlling the regression test process; through the case grouping information in the test configuration file, each test case can be grouped according to requirements to obtain a plurality of test case groups; the method comprises the steps of establishing test thread examples corresponding to test case groups respectively, conducting regression testing on the test case groups in parallel through the test thread examples to improve testing efficiency, recording example testing results of the test thread examples through example attributes of the test thread examples, and storing the example attributes in a memory, so that obtaining speed of the example testing results is improved; according to the report generation information in the test configuration file, the test results of all the examples are counted, the test report can be generated quickly, and the information is sent according to the report in the test configuration file to send the test report, so that the automatic processing of the whole regression test process is realized, and the regression test efficiency is improved.
In some optional implementations of the present embodiment, the regression testing apparatus 300 may further include: a timing trigger module or an operational trigger module, wherein:
and the timing trigger module is used for triggering a regression test instruction according to the timing task.
And the operation triggering module is used for triggering a regression testing instruction according to the received user operation.
In this embodiment, the regression test may be triggered according to a timing task or a user operation, and has high flexibility.
In some optional implementations of this embodiment, the obtaining module 301 may include: the system comprises a configuration acquisition submodule, an object determination submodule, a state determination submodule and a use case acquisition submodule, wherein:
and the configuration acquisition submodule is used for acquiring the test configuration file when receiving the regression test instruction.
And the object determining submodule is used for determining a candidate object to be tested according to the test configuration file.
And the state determining submodule is used for acquiring the object evaluation indexes of the candidate objects to be tested so as to determine the test states of the candidate objects to be tested according to the object evaluation indexes.
And the case acquisition sub-module is used for acquiring the test cases of the candidate objects to be tested when the test state is the testable state.
In the embodiment, the candidate object to be tested is obtained according to the test configuration file, whether the candidate object to be tested is normal at present is judged according to the object evaluation index of the candidate object to be tested, if the candidate object to be tested is normal, the candidate object to be tested is in a testable state, and the corresponding test case is obtained, so that regression testing is only performed on the normal candidate object to be tested, the influence of the abnormality of the candidate object to be tested on the regression testing is avoided, and the accuracy of the regression testing is ensured.
In some optional implementations of this embodiment, the use case grouping module 302 may include: dimension extraction submodule and use case grouping submodule, wherein:
and the dimension extraction submodule is used for extracting grouping dimensions from the use case grouping information of the test configuration file, wherein the grouping dimensions comprise a software architecture and a use case label.
And the case grouping submodule is used for grouping the test cases according to the grouping dimension to obtain a plurality of test case groups.
In the embodiment, the grouping dimensionality is extracted from the use case grouping information of the test configuration file, and the test use cases can be grouped from the dimensionality of a software architecture, a use case label and the like according to the grouping dimensionality, so that the diversification and the freedom degree of the test use case grouping are realized, and various requirements are met.
In some optional implementations of this embodiment, the report generating module 305 may include: the system comprises an acquisition submodule, a result statistics submodule and a report generation submodule, wherein:
and the acquisition submodule is used for acquiring the statistical dimension and the report level parameter in the test configuration file, wherein the statistical dimension comprises a software architecture and a use case label.
And the result counting submodule is used for counting the test results of all the examples according to the counting dimension to obtain a counting result.
And the report generation submodule is used for generating a test report according to the report level parameter and the statistical result.
In the embodiment, according to the statistical dimensions in the test configuration file, the example test results can be counted from dimensions such as a software architecture and case labels to obtain the statistical results, and test reports of different levels are generated according to the report level parameters, so that the forms of the statistical results and the test reports are enriched.
In some optional implementations of this embodiment, the report sending module 306 may include: a determination submodule and a report sending submodule, wherein:
and the determining submodule is used for determining a target object and a sending channel corresponding to the test report according to the report sending information in the test configuration file.
And the report sending submodule is used for sending the test report to the target object based on the sending channel.
In this embodiment, the target object and the sending channel are determined according to the report sending information in the test configuration file, and the test report is sent to the target object based on the sending channel, so that the target object can conveniently and quickly obtain the test report.
In some optional implementations of the present embodiment, the regression testing apparatus 300 may further include: memory inspection module and memory recovery module, wherein:
and the memory checking module is used for performing resource checking on the memory of the current equipment to obtain a resource checking result.
And the memory recovery module is used for recovering the memory according to the resource check result, and the memory recovery comprises thread destruction and variable destruction.
In this embodiment, the memory of the current device is subjected to resource check to detect whether idle failed threads or variables exist, and the threads or variables are destroyed to recover memory resources, so that the operating efficiency of the server is ensured.
In order to solve the technical problem, an embodiment of the present application further provides a computer device. Referring to fig. 4 in particular, fig. 4 is a block diagram of a basic structure of a computer device according to the embodiment.
The computer device 4 comprises a memory 41, a processor 42, and a network interface 43, which are communicatively connected to each other via a system bus. It is noted that only computer device 4 having components 41-43 is shown, but it is understood that not all of the shown components are required to be implemented, and that more or fewer components may be implemented instead. As will be understood by those skilled in the art, the computer device is a device capable of automatically performing numerical calculation and/or information processing according to a preset or stored instruction, and the hardware includes, but is not limited to, a microprocessor, an Application Specific Integrated Circuit (ASIC), a Programmable Gate Array (FPGA), a Digital Signal Processor (DSP), an embedded device, and the like.
The computer device can be a desktop computer, a notebook, a palm computer, a cloud server and other computing devices. The computer equipment can carry out man-machine interaction with a user through a keyboard, a mouse, a remote controller, a touch panel or voice control equipment and the like.
The memory 41 includes at least one type of readable storage medium including a flash memory, a hard disk, a multimedia card, a card type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a Read Only Memory (ROM), an Electrically Erasable Programmable Read Only Memory (EEPROM), a Programmable Read Only Memory (PROM), a magnetic memory, a magnetic disk, an optical disk, etc. In some embodiments, the memory 41 may be an internal storage unit of the computer device 4, such as a hard disk or a memory of the computer device 4. In other embodiments, the memory 41 may also be an external storage device of the computer device 4, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the computer device 4. Of course, the memory 41 may also include both an internal storage unit of the computer device 4 and an external storage device thereof. In this embodiment, the memory 41 is generally used for storing an operating system and various types of application software installed on the computer device 4, such as computer readable instructions of a regression testing method. Further, the memory 41 may also be used to temporarily store various types of data that have been output or are to be output.
The processor 42 may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor, or other data Processing chip in some embodiments. The processor 42 is typically used to control the overall operation of the computer device 4. In this embodiment, the processor 42 is configured to execute computer readable instructions stored in the memory 41 or process data, such as computer readable instructions for executing the regression testing method.
The network interface 43 may comprise a wireless network interface or a wired network interface, and the network interface 43 is generally used for establishing communication connection between the computer device 4 and other electronic devices.
The computer device provided in this embodiment may execute the regression testing method described above. The regression testing method herein may be the regression testing method of each of the above embodiments.
In the embodiment, when a regression test instruction is received, a test configuration file and each test case are obtained, wherein the test configuration file is configured in advance and is used for controlling the regression test process; through the use case grouping information in the test configuration file, each test use case can be grouped according to requirements to obtain a plurality of test use case groups; the method comprises the steps of establishing test thread examples corresponding to the test case groups respectively, performing regression testing on the test case groups in parallel through the test thread examples to improve testing efficiency, recording example testing results of the test thread examples through example attributes of the test thread examples, and storing the example attributes in a memory, so that the obtaining speed of the example testing results is improved; according to the report generation information in the test configuration file, the test results of all the examples are counted, the test report can be generated quickly, and the information is sent according to the report in the test configuration file to send the test report, so that the automatic processing of the whole regression test process is realized, and the regression test efficiency is improved.
The present application further provides another embodiment, which is to provide a computer-readable storage medium storing computer-readable instructions executable by at least one processor to cause the at least one processor to perform the steps of the regression testing method as described above.
In the embodiment, when a regression test instruction is received, a test configuration file and each test case are obtained, wherein the test configuration file is configured in advance and is used for controlling the regression test process; through the use case grouping information in the test configuration file, each test use case can be grouped according to requirements to obtain a plurality of test use case groups; the method comprises the steps of establishing test thread examples corresponding to test case groups respectively, conducting regression testing on the test case groups in parallel through the test thread examples to improve testing efficiency, recording example testing results of the test thread examples through example attributes of the test thread examples, and storing the example attributes in a memory, so that obtaining speed of the example testing results is improved; according to the report generation information in the test configuration file, the test results of all the examples are counted, the test report can be generated quickly, and the test report is sent according to the report sending information in the test configuration file, so that the automatic processing of the whole regression test process is realized, and the regression test efficiency is improved.
Through the description of the foregoing embodiments, it is clear to those skilled in the art that the method of the foregoing embodiments may be implemented by software plus a necessary general hardware platform, and certainly may also be implemented by hardware, but in many cases, the former is a better implementation. Based on such understanding, the technical solutions of the present application or portions thereof that contribute to the prior art may be embodied in the form of a software product, where the computer software product is stored in a storage medium (such as a ROM/RAM, a magnetic disk, and an optical disk), and includes several instructions for enabling a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present application.
It is to be understood that the above-described embodiments are merely illustrative of some, but not restrictive, of the broad invention, and that the appended drawings illustrate preferred embodiments of the invention and do not limit the scope of the invention. This application is capable of embodiments in many different forms and the embodiments are provided so that this disclosure will be thorough and complete. Although the present application has been described in detail with reference to the foregoing embodiments, it will be apparent to one skilled in the art that the present application may be practiced without modification or with equivalents of some of the features described in the foregoing embodiments. All equivalent structures made by using the contents of the specification and the drawings of the present application are directly or indirectly applied to other related technical fields and are within the protection scope of the present application.

Claims (10)

1. A regression testing method, comprising the steps of:
when a regression test instruction is received, obtaining a test configuration file and each test case;
grouping the test cases according to the case grouping information in the test configuration file to obtain a plurality of test case groups;
respectively establishing a test thread example corresponding to each test case group;
performing regression testing on the test case groups in parallel through the test thread examples, and recording example testing results of the test thread examples through example attributes of the test thread examples;
counting the test results of each example according to the report generation information in the test configuration file to generate a test report;
and sending the test report according to report sending information in the test configuration file.
2. The regression testing method according to claim 1, wherein before the step of obtaining the test configuration file and the test cases when the regression testing command is received, the method further comprises:
triggering a regression test instruction according to the timing task;
alternatively, the first and second electrodes may be,
and triggering a regression test instruction according to the received user operation.
3. The regression testing method according to claim 1, wherein the step of obtaining the test configuration file and each test case when the regression testing command is received comprises:
when a regression test instruction is received, obtaining a test configuration file;
determining candidate objects to be tested according to the test configuration file;
obtaining an object evaluation index of the candidate object to be tested so as to determine the test state of the candidate object to be tested according to the object evaluation index;
and when the test state is a testable state, obtaining the test case of the candidate object to be tested.
4. The regression testing method according to claim 1, wherein the step of grouping the test cases according to the case grouping information in the test configuration file to obtain a plurality of test case groups comprises:
extracting grouping dimensions from use case grouping information of the test configuration file, wherein the grouping dimensions comprise a software architecture and a use case label;
and grouping the test cases according to the grouping dimension to obtain a plurality of test case groups.
5. The regression testing method according to claim 1, wherein the step of generating a test report by counting the test results of each instance according to the report generation information in the test configuration file comprises:
acquiring a statistical dimension and a report level parameter in the test configuration file, wherein the statistical dimension comprises a software architecture and a use case label;
counting the test results of each example according to the statistical dimensions to obtain statistical results;
and generating a test report according to the report level parameter and the statistical result.
6. The regression testing method according to claim 1, wherein said step of sending the test report according to the report sending information in the test profile comprises:
determining a target object and a sending channel corresponding to the test report according to report sending information in the test configuration file;
and sending the test report to the target object based on the sending channel.
7. The regression testing method of claim 1, further comprising:
performing resource check on the memory of the current equipment to obtain a resource check result;
and memory recovery is carried out according to the resource checking result, wherein the memory recovery comprises thread destruction and variable destruction.
8. A regression test apparatus, comprising:
the obtaining module is used for obtaining a test configuration file and each test case when a regression test instruction is received;
the test configuration file is used for storing test configuration information of the test cases;
the thread establishing module is used for respectively establishing a test thread example corresponding to each test case group;
the regression testing module is used for carrying out regression testing on each testing case group in parallel through each testing thread case and recording the case testing result of each testing thread case through the case attribute of each testing thread case;
the report generation module is used for counting the test results of each example according to the report generation information in the test configuration file to generate a test report;
and the report sending module is used for sending the test report according to the report sending information in the test configuration file.
9. A computer device comprising a memory having computer readable instructions stored therein and a processor which when executed implements the steps of the regression test method of any one of claims 1 to 7.
10. A computer readable storage medium having computer readable instructions stored thereon which, when executed by a processor, implement the steps of the regression testing method of any one of claims 1 to 7.
CN202211505802.9A 2022-11-28 2022-11-28 Regression testing method, device, computer equipment and storage medium Pending CN115878460A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211505802.9A CN115878460A (en) 2022-11-28 2022-11-28 Regression testing method, device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211505802.9A CN115878460A (en) 2022-11-28 2022-11-28 Regression testing method, device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115878460A true CN115878460A (en) 2023-03-31

Family

ID=85764409

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211505802.9A Pending CN115878460A (en) 2022-11-28 2022-11-28 Regression testing method, device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115878460A (en)

Similar Documents

Publication Publication Date Title
CN107193750B (en) Script recording method and device
WO2018120721A1 (en) Method and system for testing user interface, electronic device, and computer readable storage medium
CN111427803B (en) Automated random test method, apparatus, computer device and medium
CN112491602B (en) Behavior data monitoring method and device, computer equipment and medium
CN111552633A (en) Interface abnormal call testing method and device, computer equipment and storage medium
CN111400125A (en) Memory overflow monitoring method, device, equipment and storage medium of JAVA process
CN108959067A (en) Test method, device and the computer readable storage medium of search engine
CN110647471A (en) Interface test case generation method, electronic device and storage medium
CN112631911A (en) Automatic testing method and device, computer equipment and storage medium
CN112835808A (en) Interface testing method and device, computer equipment and storage medium
CN110807050B (en) Performance analysis method, device, computer equipment and storage medium
CN112506757A (en) Automatic test method, system, computer device and medium thereof
CN112631924A (en) Automatic testing method and device, computer equipment and storage medium
CN109408361A (en) Monkey tests restored method, device, electronic equipment and computer readable storage medium
CN113869789A (en) Risk monitoring method and device, computer equipment and storage medium
CN117033249A (en) Test case generation method and device, computer equipment and storage medium
CN111475388A (en) Data push test method and device, computer equipment and storage medium
CN116431731A (en) Data asynchronous export method, device, equipment and storage medium thereof
CN115328764A (en) Test code optimization method based on automatic test and related equipment thereof
CN114637672A (en) Automatic data testing method and device, computer equipment and storage medium
CN115878460A (en) Regression testing method, device, computer equipment and storage medium
CN113468050A (en) Canvas-based testing method and device, computer equipment and storage medium
CN116028108B (en) Method, device, equipment and storage medium for analyzing dependent package installation time
CN115314404B (en) Service optimization method, device, computer equipment and storage medium
CN113656044B (en) Android installation package compression method and device, computer equipment and storage medium

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