[go: up one dir, main page]

CN112799940B - Regression testing method, regression testing device, computer system and computer readable storage medium - Google Patents

Regression testing method, regression testing device, computer system and computer readable storage medium Download PDF

Info

Publication number
CN112799940B
CN112799940B CN202110107378.1A CN202110107378A CN112799940B CN 112799940 B CN112799940 B CN 112799940B CN 202110107378 A CN202110107378 A CN 202110107378A CN 112799940 B CN112799940 B CN 112799940B
Authority
CN
China
Prior art keywords
program
tested
response value
request parameter
test
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.)
Active
Application number
CN202110107378.1A
Other languages
Chinese (zh)
Other versions
CN112799940A (en
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.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
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 Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202110107378.1A priority Critical patent/CN112799940B/en
Publication of CN112799940A publication Critical patent/CN112799940A/en
Application granted granted Critical
Publication of CN112799940B publication Critical patent/CN112799940B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Prevention of errors by analysis, debugging or testing of software
    • G06F11/362Debugging of software
    • G06F11/3644Debugging of software by instrumenting at runtime
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

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 present disclosure provides a regression testing method, regression testing apparatus, computer system, computer readable storage medium, and computer program product, which may be used in the fields of artificial intelligence, information security, internet of things, or other fields. Wherein the method comprises the following steps: recording data obtained by recording when the tested program is executed is obtained, wherein the recording data comprises an entry calling request parameter corresponding to an entry calling method of the tested program, a first request parameter and a first response value corresponding to a target execution method of the tested program, and a second request parameter and a second response value corresponding to middleware related to the tested program; acquiring a program to be tested, wherein the program to be tested is obtained by carrying out program modification on the program to be tested; and carrying out regression testing on the program to be tested according to the recorded data.

Description

Regression testing method, regression testing device, computer system and computer readable storage medium
Technical Field
The present disclosure relates to the field of computer technology, and more particularly, to a regression testing method, a regression testing apparatus, a computer system, a computer-readable storage medium, and a computer program product.
Background
Regression testing, which is one type of software testing, is intended to verify that the original functionality of the software remains intact after modification, including after an old code has been modified, re-testing to confirm that the modification did not introduce new errors or caused other code to produce errors. Regression testing is used as a component of the software lifecycle, and takes up a great amount of work in the whole software testing process, and multiple regression tests are performed at each stage of software development.
In the process of realizing the disclosed concept, the inventor finds that at least the following problems exist in the related art, the test data for regression testing is difficult to maintain, and the regression test result is not accurate enough.
Disclosure of Invention
In view of this, the present disclosure provides a regression testing method, a regression testing apparatus, a computer system, a computer-readable storage medium, and a computer program product.
One aspect of the present disclosure provides a regression testing method comprising: acquiring recorded data recorded when a tested program is executed, wherein the recorded data comprises an entry call request parameter corresponding to an entry call method of the tested program, a first request parameter and a first response value corresponding to a target execution method of the tested program, and a second request parameter and a second response value corresponding to middleware related to the tested program; acquiring a program to be tested, wherein the program to be tested is obtained by carrying out program modification on the program to be tested; and carrying out regression testing on the program to be tested according to the recorded data.
According to an embodiment of the present disclosure, performing a regression test on the program under test according to the recorded data includes: triggering a first regression test of the program to be tested according to the entry call request parameters; acquiring a first target response value corresponding to the target execution method in the process of the first regression test; and performing a second regression test on the program to be tested according to the entry call request parameter, the second request parameter and a second response value under the condition that the first target response value and the first response value are inconsistent.
According to an embodiment of the present disclosure, performing a second regression test on the program under test according to the entry call request parameter, the second request parameter, and a second response value includes: triggering a second regression test of the program to be tested according to the entry call request parameters; taking the second request parameter and a second response value as simulation data for middleware in the process of the second regression test; and performing the second regression test on the program to be tested according to the simulation data.
According to an embodiment of the present disclosure, performing a regression test on the program under test according to the recorded data further includes: acquiring a second target response value corresponding to the target execution method in the process of the second regression test; and under the condition that the second target response value is consistent or inconsistent with the first response value, performing a third regression test on the program to be tested according to the entry call request parameter, the first response value, the second request parameter and the second response value.
According to an embodiment of the present disclosure, performing a third regression test on the program under test according to the entry call request parameter, the first request parameter and first response value, and the second request parameter and second response value includes: triggering a third regression test of the program to be tested according to the entry call request parameters; taking the first request parameter and the first response value as first simulation data of a target execution method in the process of the third regression test; taking the second request parameter and a second response value as second simulation data for middleware in the process of the third regression test; and performing the third regression test on the program to be tested according to the first simulation data and the second simulation data.
Another aspect of the present disclosure provides a regression testing apparatus, comprising: the first acquisition module is used for acquiring recorded data obtained by recording when the tested program is executed, wherein the recorded data comprises an entry call request parameter corresponding to an entry call method of the tested program, a first request parameter and a first response value corresponding to a target execution method of the tested program, and a second request parameter and a second response value corresponding to middleware related to the tested program; the second acquisition module is used for acquiring a program to be tested, wherein the program to be tested is obtained by carrying out program modification on the program to be tested; and the test module is used for carrying out regression test on the program to be tested according to the recorded data.
According to an embodiment of the present disclosure, the test module includes: the triggering unit is used for triggering a first regression test of the program to be tested according to the entry call request parameter; the first acquisition unit is used for acquiring a first target response value corresponding to the target execution method in the process of the first regression test; and the first test unit is used for carrying out a second regression test on the program to be tested according to the entry call request parameter, the second request parameter and the second response value under the condition that the first target response value and the first response value are inconsistent.
Another aspect of the present disclosure provides a computer system comprising: one or more processors; and a memory for storing one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the regression testing method as described above.
Another aspect of the present disclosure provides a computer-readable storage medium having stored thereon computer-executable instructions that, when executed, are used to implement the regression testing method as described above.
Another aspect of the present disclosure provides a computer program product comprising computer executable instructions which, when executed, are for implementing a regression testing method as described above.
According to the embodiment of the disclosure, recording data recorded when the program to be tested is executed is acquired, wherein the recording data comprises an entry call request parameter corresponding to an entry call method of the program to be tested, a first request parameter and a first response value corresponding to a target execution method of the program to be tested, and a second request parameter and a second response value corresponding to middleware related to the program to be tested; acquiring a program to be tested, wherein the program to be tested is obtained by carrying out program modification on the program to be tested; and according to the technical means of carrying out regression testing on the program to be tested according to the recorded data, the recorded data is directly used as the test data for regression testing, so that the technical problem of difficult maintenance of the test data is at least partially solved.
Drawings
The above and other objects, features and advantages of the present disclosure will become more apparent from the following description of embodiments thereof with reference to the accompanying drawings in which:
FIG. 1 schematically illustrates an exemplary system architecture to which regression testing methods may be applied, according to embodiments of the present disclosure;
FIG. 2 schematically illustrates a flow chart of a regression testing method according to an embodiment of the present disclosure;
FIG. 3 schematically illustrates an example diagram of a regression testing process according to a first embodiment of the present disclosure;
FIG. 4 schematically illustrates an example diagram of a regression testing process according to a second embodiment of the present disclosure;
FIG. 5 schematically illustrates a block diagram of a regression testing apparatus according to an embodiment of the present disclosure; and
FIG. 6 schematically illustrates a block diagram of a computer system suitable for implementing a regression testing method, according to an embodiment of the disclosure.
Detailed Description
Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. It should be understood that the description is only exemplary and is not intended to limit the scope of the present disclosure. In the following detailed description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the embodiments of the present disclosure. It may be evident, however, that one or more embodiments may be practiced without these specific details. In addition, in the following description, descriptions of well-known structures and techniques are omitted so as not to unnecessarily obscure the concepts of the present disclosure.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The terms "comprises," "comprising," and/or the like, as used herein, specify the presence of stated features, steps, operations, and/or components, but do not preclude the presence or addition of one or more other features, steps, operations, or components.
All terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art unless otherwise defined. It should be noted that the terms used herein should be construed to have meanings consistent with the context of the present specification and should not be construed in an idealized or overly formal manner.
Where expressions like at least one of "A, B and C, etc. are used, the expressions should generally be interpreted in accordance with the meaning as commonly understood by those skilled in the art (e.g.," a system having at least one of A, B and C "shall include, but not be limited to, a system having a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.). Where a formulation similar to at least one of "A, B or C, etc." is used, in general such a formulation should be interpreted in accordance with the ordinary understanding of one skilled in the art (e.g. "a system with at least one of A, B or C" would include but not be limited to systems with a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.).
The inventor finds that in the process of realizing the conception of the present disclosure, for the existing regression test, for the full-scale regression test, test data are basically generated by simulation of a tester, and are sent to an environment to be tested for testing through manual and automatic measures, and then the regression test is performed through a manual or semi-automatic mode (i.e. whether the program is influenced or not is verified). For the method, firstly, the acquisition of the test case (namely the generation of regression test data) is troublesome, on one hand, the regression test needs to be repeatedly executed and repeatedly verified, the execution amount is large, so that the test data (especially real data on a line) is not well obtained, on the other hand, when the program is bigger, the regression test spends longer and longer in the time of generating the test case, and when the program is changed, the update time of the test case is longer and longer; secondly, test data maintenance is difficult, some tools such as a fiddler (an http protocol debugging agent tool can record and check http communication between a computer and the Internet, set breakpoints and check all data of 'in and out' fiddler) intercept data or manually maintain the test data by manually inputting the data, so that on one hand, the workload is large, the maintenance is difficult, and on the other hand, the obtained test data and production data have differences, so that regression test results are not completely accurate, and the problem on a test line is not necessarily caused.
The inventor also found that, in implementing the concepts of the present disclosure, the test environment cannot guarantee to provide a stable test environment due to the micro-service architecture, so that many problems of the regression test are caused by the environment, such as when database, middleware or RPC (remote procedure call protocol) call is involved in the regression test process, there is often a problem that the products are unstable or the data is changed frequently, so that the execution result of the regression test is affected. In this case, when the regression test is performed on the online service, the environment is unstable and the real call cannot be completely restored, so that the problem on the online is difficult to restore, and the real and accurate regression test result cannot be obtained.
The inventor also found that in the process of implementing the disclosed concept, in the case that the result after and before the regression test is unchanged, whether the regression test is coincidence or is sufficiently accurate cannot be judged, for example, in the case that the point of verification is an http interface, only whether the request entry and return values of the interface are consistent with the result before, but still there is a problem that verification is passed but regression is problematic, because there is a possibility that part of the data has the same internal change as the value after the return value, there is a problem that the regression test is not sufficiently fine in granularity, and whether a smaller granularity verification regression test is actually passed is lacked.
The inventor also found that in the process of implementing the disclosed concept, the prior art has a certain invasiveness to the program when performing regression testing, and the jar package relied on by the starting scheme needs to be bound when the program is started, so that the performance of the program is slightly affected.
Embodiments of the present disclosure provide a regression testing method, a regression testing apparatus, a computer system, a computer-readable storage medium, and a computer program product. The method comprises the steps of obtaining recorded data recorded when a tested program is executed, wherein the recorded data comprises an entry call request parameter corresponding to an entry call method of the tested program, a first request parameter and a first response value corresponding to a target execution method of the tested program, and a second request parameter and a second response value corresponding to middleware related to the tested program; acquiring a program to be tested, wherein the program to be tested is obtained by carrying out program modification on the program to be tested; and carrying out regression testing on the program to be tested according to the recorded data.
Fig. 1 schematically illustrates an exemplary system architecture 100 in which regression testing methods may be applied according to embodiments of the present disclosure. It should be noted that fig. 1 is only an example of a system architecture to which embodiments of the present disclosure may be applied to assist those skilled in the art in understanding the technical content of the present disclosure, but does not mean that embodiments of the present disclosure may not be used in other devices, systems, environments, or scenarios.
As shown in fig. 1, a system architecture 100 according to this embodiment may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 is used as a medium to provide communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired and/or wireless communication links, and the like.
The user may interact with the server 105 via the network 104 using the terminal devices 101, 102, 103 to receive or send messages or the like. Various communication client applications, such as shopping applications, web browser applications, search applications, instant messaging tools, mailbox clients, and/or social platform software, etc., may be installed on the terminal devices 101, 102, 103, and these applications may be used as the programs to be tested.
The terminal devices 101, 102, 103 may be a variety of electronic devices having a display screen and supporting web browsing, including but not limited to smartphones, tablets, laptop and desktop computers, and the like.
The server 105 may be a server providing various services, such as a background management server providing support for websites browsed by the user using the terminal devices 101, 102, 103, a server providing booklet data for a regression testing process, or the like. The server may analyze and process the received data such as the user request or the computer instruction, and feed back the processing result (e.g., the web page, information, or data acquired or generated according to the user request or the computer instruction) to the terminal device.
It should be noted that the regression testing method provided by the embodiments of the present disclosure may be generally performed by the server 105. Accordingly, the regression testing apparatus provided by the embodiments of the present disclosure may be generally provided in the server 105. The regression testing method provided by the embodiments of the present disclosure may also be performed by a server or a server cluster that is different from the server 105 and is capable of communicating with the terminal devices 101, 102, 103 and/or the server 105. Accordingly, the regression testing apparatus provided by the embodiments of the present disclosure may also be provided in a server or a server cluster that is different from the server 105 and is capable of communicating with the terminal devices 101, 102, 103 and/or the server 105. Alternatively, the regression testing method provided by the embodiment of the present disclosure may be performed by the terminal device 101, 102, or 103, or may be performed by another terminal device other than the terminal device 101, 102, or 103. Accordingly, the regression testing apparatus provided by the embodiments of the present disclosure may also be provided in the terminal device 101, 102, or 103, or in another terminal device different from the terminal device 101, 102, or 103.
For example, the recorded data or the program to be tested may be originally stored in any one of the terminal apparatuses 101, 102, or 103 (for example, but not limited to, the terminal apparatus 101), or stored on an external storage apparatus and may be imported into the terminal apparatus 101. Then, the terminal device 101 may locally perform the regression testing method provided by the embodiment of the present disclosure, or send the recorded data or the program to be tested to other terminal devices, servers, or server clusters, and perform the regression testing method provided by the embodiment of the present disclosure by other terminal devices, servers, or server clusters that receive the recorded data or the program to be tested.
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.
It should be noted that the regression testing method, the regression testing device, the computer system, the computer readable storage medium and the computer program product of the present disclosure may be used in the fields of artificial intelligence, information security and internet of things, and may also be used in any field other than the fields of artificial intelligence, information security and internet of things, and the application fields of the regression testing method, the regression testing device, the computer system, the computer readable storage medium and the computer program product of the present disclosure are not limited.
Fig. 2 schematically illustrates a flow chart of a regression testing method according to an embodiment of the present disclosure.
As shown in fig. 2, the method includes operations S201 to S203.
In operation S201, recording data recorded when the tested program is executed is obtained, where the recording data includes an entry call request parameter corresponding to an entry call method of the tested program, a first request parameter and a first response value corresponding to a target execution method of the tested program, and a second request parameter and a second response value corresponding to middleware related to the tested program.
According to the embodiments of the present disclosure, the program under test may be, for example, a program corresponding to a production environment of various APPs, application programs, software systems, and the like. The recorded data may be, for example, data of all scenes during the program test collected in the production environments. The portal calling method can be, for example, an application program or an APP or the like, which responds to a user request, and the portal calling method which is triggered first, for example, can include a method which is triggered when the user requests a background server, or a method which is triggered by an http program and is on url request, wherein after the portal calling method is triggered, a tested program enters a testing process. The entry call request parameter is, for example, a parameter related to when the entry call method is requested. The target execution method may be, for example, a key method that the tested program needs to pay special attention to during the test, for example, a method that invokes an external service, a method corresponding to a part of important logic codes, a method that accesses a database, and the like. The first request parameter and the first response value may be, for example, recorded execution results related to the key method. The middleware may be, for example, a third party tool, software or system that does not belong to the program code but needs to rely on in the program test process, and may include mq (message queue), redis (an open source Key-Value database), and the like. The recorded data may be saved to a database or directly generated into a local file, for example, to provide test data for a subsequent regression testing process.
In operation S202, a program to be tested is obtained, wherein the program to be tested is obtained by performing a procedural modification on the program to be tested.
In operation S203, regression testing is performed on the program to be tested according to the recorded data.
According to an embodiment of the present disclosure, the regression test is performed, for example, on the basis of all test scenarios in which the recorded data is overlaid on the tested program.
According to the embodiment of the invention, the test data required by the regression test can be directly provided by the recorded data, so that manual generation is not needed, the technical problems of difficult maintenance of the test data and difficult generation of the test data by a tester are effectively solved, meanwhile, the recorded data is directly obtained based on a method corresponding to the tested program, the data form of the tested program is met, and the technical effect of improving the accuracy of the regression test result is also achieved.
The method shown in fig. 2 is further described below with reference to fig. 3-4 in conjunction with specific embodiments.
According to an embodiment of the present disclosure, the above operation S203 may also be expressed as: triggering a first regression test of the program to be tested according to the entry call request parameters; acquiring a first target response value corresponding to the target execution method in the process of a first regression test; and under the condition that the first target response value is inconsistent with the first response value, carrying out a second regression test on the program to be tested according to the entry call request parameter, the second request parameter and the second response value.
According to an embodiment of the present disclosure, in response to the entry call request parameter, the tested program has a corresponding return value, and the return value may also be stored as recording data in a database or in the local file. In the process of performing the first regression test, for example, the entry call method of the entry call request parameter triggering program may be first obtained from the recorded data, and in the case that the obtained return value of the first regression test is inconsistent with the recorded return value in the recorded data, it may be estimated that the cause of the inconsistency is, for example, caused by a test environment (such as a data change of a middleware), so as to solve the possible problem that the regression test result caused by the test environment is inaccurate, for example, the second regression test may be performed on the program to be tested according to the entry call request parameter, the second request parameter and the second response value.
According to an embodiment of the present disclosure, performing the second regression test on the program to be tested according to the entry call request parameter, the second request parameter, and the second response value may include: triggering a second regression test of the program to be tested according to the entry call request parameters; taking the second request parameter and the second response value as simulation data of the middleware in the process of the second regression test; and performing a second regression test on the program to be tested according to the simulation data.
According to the embodiment of the disclosure, for some middleware such as redis, which has a particularly large data change, since the purpose of the regression test is mainly to test the logic problem of the program itself, when the data acquired from the middleware is unstable, the data of the middleware can be directly mock as the data recorded when the middleware is initially recorded (for example, the data is the above-mentioned analog data, including the corresponding second request parameter and the second response value in the recorded data) and returned to the program, and the above-mentioned second regression test is directly performed according to the mock data, and compared, so that the influence of other factors such as non-service codes on the regression test is effectively reduced.
It should be noted that, in addition to the middleware, for example, in the case that some services of the RPC are not stable and affect the test, the data (including the request parameter and the response value) related to the services may also be directly obtained by directly mock from the data (for example, the recorded data) obtained by recording at the beginning.
Fig. 3 schematically shows an example diagram of a regression testing process according to the first embodiment of the present disclosure, according to the above-described embodiments of the present disclosure.
As shown in fig. 3, the production environment corresponding to app, web, h5 and the like is, for example, the tested program or the program to be tested, the HTTP service, the RPC service and the like may be, for example, services related to the portal calling method, the mq, the redis and the like may be, for example, the middleware, the MySQL, the Oracle and the like may be, for example, requests related to calling the execution method (such as accessing a database) and the like during the program execution, and the recording database may be used for storing the recording data. The interceptor in fig. 3 may be deployed to an online environment, for example, to collect recording data, and may perform, for example, both recording and playback functions by being associated with the program under test or the program under test, where the recording function may be used, for example, to record relevant data (including the above-described entry call method, first request parameters and first response values, and second request parameters and second response values, etc.) when the program under test is executed, and the playback function may be used, for example, to provide mock data for the regression test process of the program under test.
According to the embodiment of the invention, the recorded data recorded once can be played back for multiple times for regression testing, and under the condition that the database or RPC call is inconsistent with the real call in the recorded data in the regression testing process, the recorded data can be directly returned without going through the real database or RPC call by setting the mock point, and the frequently-changed data such as the time stamp can be consistent with the recorded data, so that the recorded scene can be closed as much as possible, and further the service assertion is more accurate.
According to an embodiment of the present disclosure, the above operation S203 may further include, for example: acquiring a second target response value corresponding to the target execution method in the process of a second regression test; in the case that the second target response value is consistent or inconsistent with the first response value, performing a third regression test on the program to be tested according to the entry call request parameter, the first response value, the second request parameter and the second response value
According to the embodiment of the disclosure, in the case that the return value of the second regression test is inconsistent with the return value in the recorded data, it may be determined that, for example, the modification of the program to be tested with respect to the program to be tested has an effect on the program to be tested, or that the cause of the inconsistency is that there is a difference between the response value corresponding to some method (for example, the above-mentioned target execution method) in the middle of the second regression test and the corresponding response value recorded in the recorded data. In the case where the return value of the second regression test coincides with the return value in the recorded data, there may be a possibility that, for example, the response value corresponding to the intermediate process does not coincide with the corresponding response value recorded in the recorded data but only the result (i.e., the above-described return value) happens to coincide. In order to eliminate the influence of inaccurate regression test results caused by possible differences in the intermediate process, whether the process is consistent or inconsistent, the purpose of more accurately judging the rationality of program modification is achieved, for example, a third regression test can be performed on the program to be tested according to the entry call request parameter, the first request parameter and the first response value, and the second request parameter and the second response value.
According to an embodiment of the present disclosure, the performing the third regression test on the program to be tested according to the entry call request parameter, the first response value, and the second request parameter, and the second response value may be expressed as: triggering a third regression test of the program to be tested according to the entry call request parameter; taking the first request parameter and the first response value as first simulation data of a target execution method in the process of a third regression test; taking the second request parameter and the second response value as second simulation data of the middleware in the process of the third regression test; and performing a third regression test on the program to be tested according to the first simulation data and the second simulation data.
It should be noted that, the above operation S203 may also be expressed as, for example, performing regression testing on the program to be tested directly according to the entry call request parameter, the first response value, and the second request parameter, and the second response valueThe above-mentioned process of judging inconsistency may include, for example: taking the entry call request parameter as a request parameter for triggering an entry call method of a program to be tested in regression testing, and taking the first entry call request parameter as a request parameter The request parameter is used as a request parameter for calling the target execution method in the regression testing process, and the second request parameter is used as a request parameter for calling the middleware in the regression testing process. That is, the request parameters of each time the method is called in the regression testing process can be simulated by using the related request parameters obtained by recording the recorded data, and finally, whether the program modification affects the source program (i.e. the tested program) can be judged by comparing the consistency of the corresponding response values of each method in the regression testing process and the corresponding response values in the recorded data.
According to the above embodiment of the disclosure, during regression testing, a request is mainly triggered by using a request parameter of a recorded portal calling method, then when a program is executed, an execution result of a key method and a result obtained by other third party non-program execution such as middleware are recorded, and then compared with recorded data, when the results are the same, the regression of the program is proved to be consistent, that is, the modification of the program has no influence on a source program, when some values are inconsistent, the program is proved to be changed, whether the modification of the program is reasonably correct or not needs to be reassessed, and the reassessing process can include reassessing after the program is completed or reassessing according to the recorded data, for example, and is not limited herein.
Fig. 4 schematically shows an example diagram of a regression testing process according to a second embodiment of the present disclosure, according to the above-described embodiment of the present disclosure.
As shown in FIG. 4, a finer granularity of the assertion process in the regression testing process is illustrated, for example, in the process of accessing the database in FIG. 1, in the process of accessing the database, for example, a scheduler (call com.icbc.XXX.A#func), an extract root transaction (invoke com.icbc.XXX.A#func), a call external service (call com.icbc.XXX.B-stub#func), a logic code (call java.XXX, etc.), and a plurality of target execution methods of accessing the database (call com.icbc.dao.C#save), may be included, and corresponding mock data may be provided for each target execution method.
Through the embodiment of the disclosure, the data difference executed by a certain method of java can be positioned deeper, the granularity is finer when the data is asserted according to the recorded data and the regression testing data, and the accuracy of the regression testing is further improved.
Fig. 5 schematically illustrates a block diagram of a regression testing apparatus according to an embodiment of the present disclosure.
As shown in fig. 5, the regression testing apparatus 500 includes a first acquisition module 510, a second acquisition module 520, and a testing module 530.
The first obtaining module 510 is configured to obtain recording data recorded when the tested program is executed, where the recording data includes an entry call request parameter corresponding to an entry call method of the tested program, a first request parameter and a first response value corresponding to a target execution method of the tested program, and a second request parameter and a second response value corresponding to middleware related to the tested program.
The second obtaining module 520 is configured to obtain a program to be tested, where the program to be tested is obtained by performing a procedural modification on the program to be tested.
And the test module 530 is used for carrying out regression testing on the program to be tested according to the recorded data.
According to the embodiment of the disclosure, recording data recorded when the tested program is executed is acquired, wherein the recording data comprises an entry call request parameter corresponding to an entry call method of the tested program, a first request parameter and a first response value corresponding to a target execution method of the tested program, and a second request parameter and a second response value corresponding to middleware related to the tested program; acquiring a program to be tested, wherein the program to be tested is obtained by carrying out program modification on the program to be tested; and according to the technical means of carrying out regression testing on the program to be tested according to the recorded data, the recorded data is directly used as the test data for regression testing, so that the technical problem of difficult maintenance of the test data is at least partially solved.
According to an embodiment of the present disclosure, the test module includes a trigger unit, a first acquisition unit, and a first test unit.
And the triggering unit is used for triggering a first regression test of the program to be tested according to the entry call request parameter.
The first acquisition unit is used for acquiring a first target response value corresponding to the target execution method in the process of the first regression test.
And the first test unit is used for carrying out a second regression test on the program to be tested according to the entry call request parameter, the second request parameter and the second response value under the condition that the first target response value and the first response value are inconsistent.
According to an embodiment of the present disclosure, the first test unit includes a first trigger subunit, a first analog subunit, and a first test subunit.
And the first triggering subunit is used for triggering a second regression test of the program to be tested according to the entry call request parameter.
The first simulation subunit is configured to take the second request parameter and the second response value as simulation data for the middleware in the process of the second regression test.
And the first test subunit is used for carrying out a second regression test on the program to be tested according to the simulation data.
According to an embodiment of the present disclosure, the above-mentioned test module further includes a second acquisition unit and a second test unit.
The second acquisition unit is used for acquiring a second target response value corresponding to the target execution method in the process of a second regression test.
And the second test unit is used for carrying out a third regression test on the program to be tested according to the entry call request parameter, the first response value, the second request parameter and the second response value under the condition that the second target response value is consistent or inconsistent with the first response value.
According to an embodiment of the present disclosure, the second test unit includes a second trigger subunit, a second analog subunit, a third analog subunit, and a second test subunit.
And the second triggering subunit is used for triggering a third regression test of the program to be tested according to the entry call request parameter.
And the second simulation subunit is used for taking the first request parameter and the first response value as first simulation data of a target execution method in the process of the third regression test.
And the third simulation subunit is used for taking the second request parameter and the second response value as second simulation data of the middleware in the process of the third regression test.
And the second testing subunit is used for carrying out a third regression test on the program to be tested according to the first simulation data and the second simulation data.
Any number of the modules, units, sub-units, or at least some of the functionality of any number of the modules, units, sub-units, or sub-units according to embodiments of the present disclosure may be implemented in one module. Any one or more of the modules, units, sub-units according to embodiments of the present disclosure may be implemented as split into multiple modules. Any one or more of the modules, units, sub-units according to embodiments of the present disclosure may be implemented at least in part as a hardware circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or in hardware or firmware in any other reasonable manner of integrating or packaging the circuits, or in any one of or in any suitable combination of three of software, hardware, and firmware. Alternatively, one or more of the modules, units, sub-units according to embodiments of the disclosure may be at least partially implemented as computer program modules, which when executed, may perform the corresponding functions.
For example, any of the first acquisition module 510, the second acquisition module 520, and the test module 530 may be combined in one module/unit/sub-unit, or any of the modules/units/sub-units may be split into a plurality of modules/units/sub-units. Alternatively, at least some of the functionality of one or more of these modules/units/sub-units may be combined with at least some of the functionality of other modules/units/sub-units and implemented in one module/unit/sub-unit. According to embodiments of the present disclosure, at least one of the first acquisition module 510, the second acquisition module 520, and the test module 530 may be implemented at least in part as hardware circuitry, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or may be implemented in hardware or firmware in any other reasonable manner of integrating or packaging the circuitry, or in any one of or a suitable combination of any of the three. Alternatively, at least one of the first acquisition module 510, the second acquisition module 520, and the test module 530 may be at least partially implemented as a computer program module, which when executed, may perform the corresponding functions.
It should be noted that, in the embodiment of the present disclosure, the regression testing device portion corresponds to the regression testing method portion in the embodiment of the present disclosure, and the description of the regression testing device portion specifically refers to the regression testing method portion and is not described herein.
FIG. 6 schematically illustrates a block diagram of a computer system suitable for implementing a regression testing method, according to an embodiment of the disclosure. The computer system illustrated in fig. 6 is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments of the present disclosure.
As shown in fig. 6, a computer system 600 according to an embodiment of the present disclosure includes a processor 601 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 602 or a program loaded from a storage section 608 into a Random Access Memory (RAM) 603. The processor 601 may include, for example, a general purpose microprocessor (e.g., a CPU), an instruction set processor and/or an associated chipset and/or a special purpose microprocessor (e.g., an Application Specific Integrated Circuit (ASIC)), or the like. Processor 601 may also include on-board memory for caching purposes. The processor 601 may comprise a single processing unit or a plurality of processing units for performing different actions of the method flows according to embodiments of the disclosure.
In the RAM 603, various programs and data required for the operation of the system 600 are stored. The processor 601, the ROM602, and the RAM 603 are connected to each other through a bus 604. The processor 601 performs various operations of the method flow according to the embodiments of the present disclosure by executing programs in the ROM602 and/or the RAM 603. Note that the program may be stored in one or more memories other than the ROM602 and the RAM 603. The processor 601 may also perform various operations of the method flow according to embodiments of the present disclosure by executing programs stored in the one or more memories.
According to an embodiment of the present disclosure, the system 600 may further include an input/output (I/O) interface 605, the input/output (I/O) interface 605 also being connected to the bus 604. The system 600 may also include one or more of the following components connected to the I/O interface 605: an input portion 606 including a keyboard, mouse, etc.; an output portion 607 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, a speaker, and the like; a storage section 608 including a hard disk and the like; and a communication section 609 including a network interface card such as a LAN card, a modem, or the like. The communication section 609 performs communication processing via a network such as the internet. The drive 610 is also connected to the I/O interface 605 as needed. Removable media 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is installed as needed on drive 610 so that a computer program read therefrom is installed as needed into storage section 608.
According to embodiments of the present disclosure, the method flow according to embodiments of the present disclosure may be implemented as a computer software program. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable storage medium, the computer program comprising program code for performing the method shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from a network through the communication portion 609, and/or installed from the removable medium 611. The above-described functions defined in the system of the embodiments of the present disclosure are performed when the computer program is executed by the processor 601. The systems, devices, apparatus, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the disclosure.
The present disclosure also provides a computer-readable storage medium that may be embodied in the apparatus/device/system described in the above embodiments; or may exist alone without being assembled into the apparatus/device/system. The computer-readable storage medium carries one or more programs which, when executed, implement methods in accordance with embodiments of the present disclosure.
According to embodiments of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium. Examples may include, but are not limited to: 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), a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this disclosure, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
For example, according to embodiments of the present disclosure, the computer-readable storage medium may include ROM 602 and/or RAM 603 and/or one or more memories other than ROM 602 and RAM 603 described above.
Embodiments of the present disclosure also include a computer program product comprising a computer program comprising program code for performing the methods provided by the embodiments of the present disclosure, the program code for causing an electronic device to implement the regression testing methods provided by the embodiments of the present disclosure when the computer program product is run on the electronic device.
The above-described functions defined in the system/apparatus of the embodiments of the present disclosure are performed when the computer program is executed by the processor 601. The systems, apparatus, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the disclosure.
In one embodiment, the computer program may be based on a tangible storage medium such as an optical storage device, a magnetic storage device, or the like. In another embodiment, the computer program may also be transmitted, distributed in the form of signals over a network medium, and downloaded and installed via the communication section 609, and/or installed from the removable medium 611. The computer program may include program code that may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the foregoing.
According to embodiments of the present disclosure, program code for performing computer programs provided by embodiments of the present disclosure may be written in any combination of one or more programming languages, and in particular, such computer programs may be implemented in high-level procedural and/or object-oriented programming languages, and/or assembly/machine languages. Programming languages include, but are not limited to, such as Java, c++, python, "C" or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, partly on a remote computing device, or entirely on the remote computing device or server. In the case of remote computing devices, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., connected via the Internet using an Internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions. Those skilled in the art will appreciate that the features recited in the various embodiments of the disclosure and/or in the claims may be combined in various combinations and/or combinations, even if such combinations or combinations are not explicitly recited in the disclosure. In particular, the features recited in the various embodiments of the present disclosure and/or the claims may be variously combined and/or combined without departing from the spirit and teachings of the present disclosure. All such combinations and/or combinations fall within the scope of the present disclosure.
The embodiments of the present disclosure are described above. However, these examples are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Although the embodiments are described above separately, this does not mean that the measures in the embodiments cannot be used advantageously in combination. The scope of the disclosure is defined by the appended claims and equivalents thereof. Various alternatives and modifications can be made by those skilled in the art without departing from the scope of the disclosure, and such alternatives and modifications are intended to fall within the scope of the disclosure.

Claims (7)

1. A regression testing method comprising:
acquiring recorded data recorded when a tested program is executed, wherein the recorded data comprises an entry call request parameter corresponding to an entry call method of the tested program, a first request parameter and a first response value corresponding to a target execution method of the tested program, and a second request parameter and a second response value corresponding to middleware related to the tested program;
acquiring a program to be tested, wherein the program to be tested is obtained by carrying out program modification on the program to be tested; and
and carrying out regression testing on the program to be tested according to the recorded data, wherein the regression testing comprises the following steps:
Triggering a first regression test of the program to be tested according to the entry call request parameters;
acquiring a first target response value corresponding to the target execution method in the process of the first regression test; and
and under the condition that the first target response value is inconsistent with the first response value, performing a second regression test on the program to be tested according to the entry call request parameter, the second request parameter and the second response value.
2. The method of claim 1, wherein performing a second regression test on the program under test based on the entry call request parameter, the second request parameter, and a second response value comprises:
triggering a second regression test of the program to be tested according to the entry call request parameters;
taking the second request parameter and a second response value as simulation data for middleware in the process of the second regression test; and
and carrying out the second regression test on the program to be tested according to the simulation data.
3. The method of claim 1, wherein performing a regression test on the program under test based on the recorded data further comprises:
Acquiring a second target response value corresponding to the target execution method in the process of the second regression test;
and under the condition that the second target response value is consistent or inconsistent with the first response value, performing a third regression test on the program to be tested according to the entry call request parameter, the first response value, the second request parameter and the second response value.
4. A method according to claim 3, wherein performing a third regression test on the program under test from the entry call request parameter, the first request parameter and first response value, and the second request parameter and second response value comprises:
triggering a third regression test of the program to be tested according to the entry call request parameters;
taking the first request parameter and the first response value as first simulation data of a target execution method in the process of the third regression test;
taking the second request parameter and a second response value as second simulation data for middleware in the process of the third regression test; and
and carrying out the third regression test on the program to be tested according to the first simulation data and the second simulation data.
5. A regression testing apparatus comprising:
the first acquisition module is used for acquiring recorded data obtained by recording when the tested program is executed, wherein the recorded data comprises an entry call request parameter corresponding to an entry call method of the tested program, a first request parameter and a first response value corresponding to a target execution method of the tested program, and a second request parameter and a second response value corresponding to middleware related to the tested program;
the second acquisition module is used for acquiring a program to be tested, wherein the program to be tested is obtained by carrying out program modification on the program to be tested; and
the test module is used for carrying out regression testing on the program to be tested according to the recorded data, wherein the test module comprises:
the triggering unit is used for triggering a first regression test of the program to be tested according to the entry call request parameter;
the first acquisition unit is used for acquiring a first target response value corresponding to the target execution method in the process of the first regression test; and
and the first test unit is used for carrying out a second regression test on the program to be tested according to the entry call request parameter, the second request parameter and the second response value under the condition that the first target response value and the first response value are inconsistent.
6. A computer system, comprising:
one or more processors;
a memory for storing one or more programs,
wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method of any of claims 1-4.
7. A computer readable storage medium having stored thereon executable instructions which when executed by a processor cause the processor to implement the method of any of claims 1 to 4.
CN202110107378.1A 2021-01-26 2021-01-26 Regression testing method, regression testing device, computer system and computer readable storage medium Active CN112799940B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110107378.1A CN112799940B (en) 2021-01-26 2021-01-26 Regression testing method, regression testing device, computer system and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110107378.1A CN112799940B (en) 2021-01-26 2021-01-26 Regression testing method, regression testing device, computer system and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN112799940A CN112799940A (en) 2021-05-14
CN112799940B true CN112799940B (en) 2024-02-06

Family

ID=75811971

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110107378.1A Active CN112799940B (en) 2021-01-26 2021-01-26 Regression testing method, regression testing device, computer system and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN112799940B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113495498B (en) * 2021-07-06 2024-05-28 中国工商银行股份有限公司 Simulation method, simulator, device and medium for hardware device
CN113468061A (en) * 2021-07-15 2021-10-01 浙江百应科技有限公司 Automatic testing method and device based on recording and playback and electronic equipment
CN113553260B (en) * 2021-07-22 2022-07-19 工银科技有限公司 Test method, test apparatus, device, and medium
CN113742228B (en) * 2021-09-02 2023-12-15 杭州网易云音乐科技有限公司 Test, data playback and recording methods, systems, devices, equipment and media
CN114398288A (en) * 2022-01-19 2022-04-26 深圳依时货拉拉科技有限公司 Test method, test device, computer device and readable storage medium
CN114817007B (en) * 2022-04-08 2025-06-17 中国工商银行股份有限公司 Information processing method and device, electronic device and computer readable storage medium
CN114968829B (en) * 2022-08-02 2022-10-28 平安银行股份有限公司 Full link pressure test method, electronic device and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2508643A (en) * 2012-12-07 2014-06-11 Ibm Method for Performing a Regression Test after Modifying Source Code File
CN109597749A (en) * 2018-08-31 2019-04-09 阿里巴巴集团控股有限公司 Regression testing method, device, electronic equipment and computer readable storage medium
CN110287096A (en) * 2019-05-20 2019-09-27 深圳壹账通智能科技有限公司 H5 front end page test method, electronic device and computer readable storage medium
CN111611154A (en) * 2019-02-26 2020-09-01 北京新能源汽车股份有限公司 Regression testing method, device and equipment
CN111651342A (en) * 2019-03-04 2020-09-11 复旦大学 Automatic testing framework for HTTP interface based on Charles recording session

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6966013B2 (en) * 2001-07-21 2005-11-15 International Business Machines Corporation Method and system for performing automated regression tests in a state-dependent data processing system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2508643A (en) * 2012-12-07 2014-06-11 Ibm Method for Performing a Regression Test after Modifying Source Code File
CN109597749A (en) * 2018-08-31 2019-04-09 阿里巴巴集团控股有限公司 Regression testing method, device, electronic equipment and computer readable storage medium
CN111611154A (en) * 2019-02-26 2020-09-01 北京新能源汽车股份有限公司 Regression testing method, device and equipment
CN111651342A (en) * 2019-03-04 2020-09-11 复旦大学 Automatic testing framework for HTTP interface based on Charles recording session
CN110287096A (en) * 2019-05-20 2019-09-27 深圳壹账通智能科技有限公司 H5 front end page test method, electronic device and computer readable storage medium

Also Published As

Publication number Publication date
CN112799940A (en) 2021-05-14

Similar Documents

Publication Publication Date Title
CN112799940B (en) Regression testing method, regression testing device, computer system and computer readable storage medium
US20230161694A1 (en) Orchestration for automated performance testing
CN109302522B (en) Test method, test device, computer system, and computer medium
US8205120B2 (en) Intelligent test framework
US8239839B2 (en) Asynchrony debugging using web services interface
US10803166B1 (en) Automated determination of application privileges
CN107145440A (en) Applied program testing method, device and computer equipment
US20230089336A1 (en) Automated generation of load tests for api testing
CN109344066B (en) Method, system and terminal for testing browser page
CN113360377B (en) Test method and device
CN113535577B (en) Application testing method and device based on knowledge graph, electronic equipment and medium
CN112817831A (en) Application performance monitoring method, device, computer system and readable storage medium
CN113032256B (en) Automated testing method, apparatus, computer system, and readable storage medium
CN113986679A (en) Performance analysis method and device based on configuration information hot loading
CN113806229A (en) Interface change test script multiplexing method, device, equipment, medium and product
CN113688025A (en) Interface test method, device, equipment and storage medium
CN113495498A (en) Simulation method, simulator, device, and medium for hardware device
CN111930629A (en) Page testing method and device, electronic equipment and storage medium
CN114116509A (en) Program analysis method, program analysis device, electronic device, and storage medium
CN107368425A (en) A kind of openstack method of testings
US20240152356A1 (en) Automated developer configuration tool
CN112579428A (en) Interface testing method and device, electronic equipment and storage medium
CN112506781B (en) Test monitoring method, device, electronic equipment, storage medium and program product
CN113961468A (en) Digital certificate filling method, apparatus, equipment, medium and program product for USB shield test
CN115981525A (en) Test data construction method, device, equipment and 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
GR01 Patent grant
GR01 Patent grant