CN114218091A - Regression testing method, device, equipment and readable storage medium - Google Patents

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

Info

Publication number
CN114218091A
CN114218091A CN202111484166.1A CN202111484166A CN114218091A CN 114218091 A CN114218091 A CN 114218091A CN 202111484166 A CN202111484166 A CN 202111484166A CN 114218091 A CN114218091 A CN 114218091A
Authority
CN
China
Prior art keywords
test case
transaction
test
function
modified
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
CN202111484166.1A
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.)
China Citic Bank Corp Ltd
Original Assignee
China Citic Bank Corp 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 China Citic Bank Corp Ltd filed Critical China Citic Bank Corp Ltd
Priority to CN202111484166.1A priority Critical patent/CN114218091A/en
Publication of CN114218091A publication Critical patent/CN114218091A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/368Test management for test version control, e.g. updating test cases to a new software version
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3692Test management for test results analysis

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention provides a regression testing method, a regression testing device, regression testing equipment and a readable storage medium, wherein the method comprises the following steps: acquiring a modified code, wherein the modified code comprises a modified function, determining the modified function to be analyzed according to the modification type of the modified function, and defining the modified function to be analyzed as an analysis function; searching a corresponding test case before the modification of the analysis function and a transaction corresponding to each test case according to the analysis function to obtain a first transaction set; searching the associated transaction of each transaction in the first transaction set and the test case corresponding to each associated transaction to obtain a second test case set; and performing regression testing on the test cases in the first test case set and the second test case set to obtain a regression testing result. The invention can accurately select the regression testing range and solves the problem of low regression testing efficiency caused by blindly regressing all testing cases.

Description

Regression testing method, device, equipment and readable storage medium
Technical Field
The invention relates to the technical field of testing, in particular to a regression testing method, device, equipment and readable storage medium.
Background
In the testing process, after the tester completes each testing process for the changed function, the tester needs to perform a regression test in order to ensure that the changed function does not affect the normal operation of other functions. However, since the influence range of the changed functions cannot be accurately determined, the tester needs to perform a complete regression test on all the functions. With the increasingly large test case sets, the regression testing time is longer and longer, and the product iteration is more frequent, the regression testing efficiency is urgently needed to be improved.
Disclosure of Invention
The present invention is directed to a regression testing method, apparatus, device and readable storage medium to improve the above problems.
In order to achieve the above object, the embodiments of the present application provide the following technical solutions:
in one aspect, an embodiment of the present application provides a regression testing method, where the method includes:
acquiring a modified code, wherein the modified code comprises a modified function, determining the modified function to be analyzed according to the modification type of the modified function, and defining the modified function to be analyzed as an analysis function;
searching a corresponding test case before the modification of the analysis function according to the analysis function, collecting the corresponding test case before the modification of the analysis function to form a first test case set, and searching a transaction corresponding to each test case in the first test case set to obtain a first transaction set;
searching the associated transactions of each transaction in the first transaction set, collecting the associated transactions of each transaction to obtain a second transaction set, and searching the test case corresponding to each associated transaction in the second transaction set to obtain a second test case set;
and performing regression testing on the test cases in the first test case set and the second test case set to obtain a regression testing result.
Optionally, the obtaining the modified code, where the modified code includes a modified function, determining the modified function to be analyzed according to a modification type of the modified function, and defining the modified function to be analyzed as an analysis function, includes:
determining modified content of the modified function based on the modified function;
determining a modification type of the modified function based on the modification content of the modified function;
analyzing whether the modification type of the modified function is code modification, data modification or alias modification, and if so, defining the modified function as an analysis function.
Optionally, the searching for the corresponding test case before the modification of the analysis function according to the analysis function, collecting the corresponding test case before the modification of the analysis function to form a first test case set, and searching for the transaction corresponding to each test case in the first test case set to obtain a first transaction set includes:
acquiring codes before modification, test cases in a case base and transaction codes corresponding to the test cases;
based on the code before modification and the test case in the case base, establishing a mapping relation between a function in the code before modification and the test case, wherein the mapping relation between the function in the code before modification and the test case comprises a forward index of the test case to the function in the code before modification and a reverse index of the test case to the function in the code before modification, and establishing a relation chain between the test case and the transaction according to the transaction code corresponding to the test case;
and searching the corresponding test case before the modification of the analysis function by using the inverted index of the function from the test case to the code before the modification, and searching the transaction corresponding to each test case in the first test case set according to the relationship chain.
Optionally, the searching for the associated transaction of each transaction in the first transaction set, collecting the associated transactions of each transaction to obtain a second transaction set, and searching for the test case corresponding to each associated transaction in the second transaction set to obtain a second test case set includes:
acquiring transaction messages and transaction serial numbers of the transactions in different systems, combing transaction flowing systems and transaction codes in different systems through the transaction messages and the transaction serial numbers of the transactions in different systems, and constructing a transaction link according to the transaction flowing systems and the transaction codes in different systems;
and searching the associated transaction of each transaction in the first transaction set based on the transaction link, and searching the test case corresponding to the associated transaction according to the relationship chain of the test case and the transaction.
Optionally, the performing a regression test on the test cases in the first test case set and the second test case set to obtain a regression test result includes:
performing regression testing on the test cases in the first test case set and the second test case set to find out test cases with defects;
and searching a function corresponding to the test case with the defect to obtain the function with the defect, and collecting modification information of the function with the defect to form a regression test report.
Optionally, the performing a regression test on the test cases in the first test case set and the second test case set to obtain a regression test result includes:
collecting the test cases in the first test case set and the second test case set to obtain a third test case set;
analyzing whether the third test case set has the test cases which are correlated with each other, and if so, collecting the test cases which are correlated with each other to form a fourth test case set;
analyzing whether the third test case set has the test case which is not associated with any test case, and if so, defining the test case which is not associated with any test case as an isolated test case;
searching the transaction corresponding to each test case in the fourth test case set, sorting the test cases in the fourth test case set according to the business logic relationship among the transactions, sequentially performing regression testing on the test cases in the fourth test case set according to the order after sorting, performing regression testing on the orphan test cases simultaneously to obtain test cases with defects, and obtaining the regression testing result based on the test cases with defects.
In a second aspect, an embodiment of the present application provides a regression test apparatus, where the apparatus includes an obtaining module, a first searching module, a second searching module, and a testing module.
The acquisition module is used for acquiring a modified code, the modified code comprises a modified function, the modified function needing to be analyzed is determined according to the modification type of the modified function, and the modified function needing to be analyzed is defined as an analysis function;
the first searching module is used for searching the corresponding test cases before the analysis function is modified according to the analysis function, collecting the corresponding test cases before the analysis function is modified to form a first test case set, and searching the transaction corresponding to each test case in the first test case set to obtain a first transaction set;
the second searching module is configured to search for associated transactions of each transaction in the first transaction set, aggregate the associated transactions of each transaction to obtain a second transaction set, and search for a test case corresponding to each associated transaction in the second transaction set to obtain a second test case set;
the test module is used for performing regression test on the test cases in the first test case set and the second test case set to obtain a regression test result.
Optionally, the obtaining module includes:
a first determining unit, configured to determine, based on the modified function, a modified content of the modified function;
a second determining unit, configured to determine a modification type of the modified function based on a modification content of the modified function;
and the first analysis unit is used for analyzing whether the modification type of the modified function is code modification, data modification or alias modification, and if so, defining the modified function as an analysis function.
Optionally, the first lookup module includes:
the first acquisition unit is used for acquiring codes before modification, test cases in the case base and transaction codes corresponding to the test cases;
the establishing unit is used for establishing a mapping relation between a function in the code before modification and the test case based on the code before modification and the test case in the case library, the mapping relation between the function in the code before modification and the test case comprises a forward index of the function from the test case to the code before modification and a reverse index of the function from the test case to the code before modification, and the relation chain between the test case and the transaction is established according to the transaction code corresponding to the test case;
the first searching unit is used for searching the corresponding test case before the analysis function is modified by using the inverted index of the function from the test case to the code before modification, and searching the transaction corresponding to each test case in the first test case set according to the relationship chain.
Optionally, the second lookup module includes:
the second acquisition unit is used for acquiring the transaction messages and the transaction serial numbers of the transactions in different systems, combing the transaction flowing systems and the transaction codes in different systems through the transaction messages and the transaction serial numbers of the transactions in different systems, and constructing a transaction link according to the transaction flowing systems and the transaction codes in different systems;
and the second searching unit is used for searching the associated transaction of each transaction in the first transaction set based on the transaction link and searching the test case corresponding to the associated transaction according to the relationship chain of the test case and the transaction.
Optionally, the test module includes:
the first testing unit is used for performing regression testing on the testing cases in the first testing case set and the second testing case set to find out testing cases with defects;
and the third searching unit is used for searching the function corresponding to the test case with the defects to obtain the function with the defects, and collecting the modification information of the function with the defects to form a regression test report.
Optionally, the test module includes:
the collecting unit is used for collecting the test cases in the first test case set and the second test case set to obtain a third test case set;
the second analysis unit is used for analyzing whether the third test case set has the test cases which are mutually related or not, and if so, the test cases which are mutually related are gathered together to form a fourth test case set;
a third analyzing unit, configured to analyze whether the third test case set has the test case that is not associated with any of the test cases, and if yes, define the test case that is not associated with any of the test cases as an orphan test case;
the second testing unit is used for searching for the transaction corresponding to each testing case in the fourth testing case set, sequencing the testing cases in the fourth testing case set according to the business logic relationship among the transactions, sequentially performing regression testing on the testing cases in the fourth testing case set according to the sequence after sequencing, performing regression testing on the isolated testing cases to obtain testing cases with defects, and obtaining the regression testing result based on the testing cases with the defects.
In a third aspect, an embodiment of the present application provides a regression test device, which includes a memory and a processor. The memory is used for storing a computer program; the processor is used for implementing the steps of the regression testing method when the computer program is executed.
In a fourth aspect, the present application provides a readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps of the above method for regression testing.
The invention has the beneficial effects that:
the invention can accurately select the regression testing range and solves the problem of low regression testing efficiency caused by blindly regressing all testing cases. In addition, in order to ensure whether the function of the correlation system is influenced or not, the invention also provides an automatic selection scheme of the regression testing range of the correlation system, and the regression testing range is perfected.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by the practice of the embodiments of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained according to the drawings without inventive efforts.
FIG. 1 is a schematic flow chart of a regression testing method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of an apparatus for regression testing according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a regression test apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. The components of embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present invention, presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that: like reference numbers or letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined or explained in subsequent figures. Meanwhile, in the description of the present invention, the terms "first", "second", and the like are used only for distinguishing the description, and are not to be construed as indicating or implying relative importance.
Example 1
As shown in fig. 1, the present embodiment provides a regression testing method, which includes step S1, step S2, step S3, and step S4.
Step S1, obtaining a modified code, wherein the modified code comprises a modified function, determining the modified function to be analyzed according to the modification type of the modified function, and defining the modified function to be analyzed as an analysis function;
step S2, searching a corresponding test case before the modification of the analysis function according to the analysis function, collecting the corresponding test case before the modification of the analysis function to form a first test case set, and searching a transaction corresponding to each test case in the first test case set to obtain a first transaction set;
step S3, searching the associated transaction of each transaction in the first transaction set, collecting the associated transactions of each transaction to obtain a second transaction set, and searching the test case corresponding to each associated transaction in the second transaction set to obtain a second test case set;
and step S4, performing regression testing on the test cases in the first test case set and the second test case set to obtain regression testing results.
The implementation can accurately select the regression testing range, and solves the problem of low regression testing efficiency caused by blind regression of all testing cases. In addition, in order to ensure whether the function of the correlation system is affected, the embodiment provides an automatic selection scheme of the regression testing range of the correlation system, and the regression testing range is perfected. Specifically, a regression test range is accurately selected from two dimensions: firstly, after the modified codes are obtained, by establishing the mapping of functions and test cases, the test cases influenced by code change are accurately selected, and the test cases can cover the modified codes; secondly, in order to ensure that a transaction interface of the association system is not affected, a case selected according to code change is positioned to a change transaction in a transaction link tracing mode, then the association system and the association transaction are determined according to the transaction link, and a test case related to the association transaction is accurately selected.
In a specific embodiment of the present disclosure, the step S1 may further include a step S11, a step S12 and a step S13.
Step S11, determining the modified content of the modified function based on the modified function;
step S12, determining the modification type of the modified function based on the modification content of the modified function;
step S13, analyzing whether the modification type of the modified function is code modification, data modification or alias modification, and if so, defining the modified function as an analysis function.
In this embodiment, the code is modified to: the method mainly comprises the steps of adding, modifying and deleting a code, for example, deleting a judgment statement, modifying a cycle condition of a cycle statement and the like;
the data is modified into: mainly, modification of static data used in the code, such as change of assigned data in an initial assignment statement, and the like;
the alias is modified into: primarily the modification of aliases in the code, the changes made only modify the storage location that is shared with tracking another data that has been modified.
In this embodiment, if the modification type of the modified function is code modification, data modification or alias modification, it is determined that the modification affects the execution of the modified code, and therefore, the modified function corresponding to the modification type is defined as an analysis function.
In a specific embodiment of the present disclosure, the step S2 may further include a step S21, a step S22 and a step S23.
Step S21, acquiring codes before modification, test cases in the case base and transaction codes corresponding to the test cases;
step S22, establishing a mapping relation between a function in the code before modification and the test case based on the code before modification and the test case in the case library, wherein the mapping relation between the function in the code before modification and the test case comprises a forward index of the function from the test case to the code before modification and a reverse index of the function from the test case to the code before modification, and establishing a relation chain between the test case and the transaction according to the transaction code corresponding to the test case;
step S23, using the inverted index of the function from the test case to the code before modification to find the test case corresponding to the analysis function before modification, and finding the transaction corresponding to each test case in the first test case set according to the relationship chain.
In this embodiment, a mapping relationship between the function in the code before modification and the test case is established by a code coverage tool.
In a specific embodiment of the present disclosure, the step S3 may further include a step S31 and a step S32.
Step S31, acquiring the transaction messages and the transaction serial numbers of the transactions in different systems, combing the transaction flowing systems and the transaction codes in different systems through the transaction messages and the transaction serial numbers of the transactions in different systems, and constructing a transaction link according to the transaction flowing systems and the transaction codes in different systems;
step S32, searching for the associated transaction of each transaction in the first transaction set based on the transaction link, and searching for the test case corresponding to the associated transaction according to the relationship chain between the test case and the transaction.
In this embodiment, for example, the transaction corresponding to the test case 1 is transaction 1, the related transaction of the transaction 1 is transaction 2 and transaction 3, the test case corresponding to the transaction 2 is test case 2, and the test case corresponding to the transaction 3 is test case 3, then the test cases 2 and 3 are also placed in the range of the regression test, and the regression test is performed on the test cases, so that the purpose of accurately selecting the regression test range can be achieved.
In a specific embodiment of the present disclosure, the step S4 may further include a step S41 and a step S42.
Step S41, performing regression testing on the test cases in the first test case set and the second test case set to find out test cases with defects;
and S42, searching a function corresponding to the test case with the defect to obtain the function with the defect, and collecting modification information of the function with the defect to form a regression test report.
In a specific embodiment of the present disclosure, the step S4 may further include a step S43, a step S44, a step S45, and a step S46.
Step S43, collecting the test cases in the first test case set and the second test case set to obtain a third test case set;
step S44, analyzing whether the third test case set has the test cases which are correlated with each other, and if so, collecting the test cases which are correlated with each other to form a fourth test case set;
step S45, analyzing whether the third test case set has the test case which is not related to any test case, and if yes, defining the test case which is not related to any test case as an isolated test case;
s46, searching the transaction corresponding to each test case in the fourth test case set, sorting the test cases in the fourth test case set according to the business logic relationship among the transactions, sequentially performing regression test on the test cases in the fourth test case set according to the sequence after sorting, performing regression test on the orphan test cases to obtain test cases with defects, and obtaining the regression test result based on the test cases with defects.
In this embodiment, for example, the first test case set includes a test case 1 and a test case 2, the second test case set includes a test case 3, if the test case 1 and the test case 2 are correlated with each other and the test case 3 is not correlated with the test case 1 and the test case 2, the test case 1 and the test case 2 are collected to form a test set, the test case 3 is defined as an orphan test case, then the transactions corresponding to the test case 1 and the test case 2 are searched, for example, the transaction corresponding to the test case 1 is a created account, the transaction corresponding to the test case 2 is a transfer, since the created account is before and after the transfer, the test case 1 and the test case 2 are ranked to be the test case 1-the test case 2, and when performing the regression test, the regression test is performed according to the sequence from the test case 1 to the test case 2, the test case 3 performs the regression test alone, and thus the execution efficiency of the regression test can be improved.
Example 2
As shown in fig. 2, the present embodiment provides an apparatus for regression testing, where the apparatus includes an obtaining module 701, a first searching module 702, a second searching module 703, and a testing module 704.
The obtaining module 701 is configured to obtain a modified code, where the modified code includes a modified function, determine, according to a modification type of the modified function, the modified function that needs to be analyzed, and define the modified function that needs to be analyzed as an analysis function;
the first searching module 702 is configured to search, according to the analysis function, a corresponding test case before the analysis function is modified, collect the corresponding test case before the analysis function is modified to form a first test case set, and search for a transaction corresponding to each test case in the first test case set to obtain a first transaction set;
the second searching module 703 is configured to search for a relevant transaction of each transaction in the first transaction set, aggregate the relevant transactions of each transaction to obtain a second transaction set, and search for a test case corresponding to each relevant transaction in the second transaction set to obtain a second test case set;
the testing module 704 is configured to perform regression testing on the testing cases in the first testing case set and the second testing case set to obtain a regression testing result.
The implementation can accurately select the regression testing range, and solves the problem of low regression testing efficiency caused by blind regression of all testing cases. In addition, in order to ensure whether the function of the correlation system is affected, the embodiment provides an automatic selection scheme of the regression testing range of the correlation system, and the regression testing range is perfected.
In a specific embodiment of the present disclosure, the obtaining module 701 includes a first determining unit 7011, a second determining unit 7012, and a first analyzing unit 7013.
The first determining unit 7011 is configured to determine, based on the modified function, modified content of the modified function;
the second determining unit 7012 is configured to determine, based on the modified content of the modified function, a modification type of the modified function;
the first analyzing unit 7013 is configured to analyze whether a modification type of the modified function is code modification, data modification, or alias modification, and if so, define the modified function as an analysis function.
In a specific embodiment of the present disclosure, the first searching module 702 includes a first obtaining unit 7021, a establishing unit 7022, and a first searching unit 7023.
The first obtaining unit 7021 is configured to obtain a code before modification, a test case in the case base, and a transaction code corresponding to the test case;
the establishing unit 7022 is configured to establish a mapping relationship between a function in the code before modification and the test case based on the code before modification and the test case in the case library, where the mapping relationship between the function in the code before modification and the test case includes a forward index of the function from the test case to the code before modification and a reverse index of the function from the test case to the code before modification, and establish a relationship chain between the test case and the transaction according to the transaction code corresponding to the test case;
the first searching unit 7023 is configured to search, by using the inverted index of the function from the test case to the code before modification, the test case corresponding to the analysis function before modification, and search, according to the relationship chain, a transaction corresponding to each test case in the first test case set.
In a specific embodiment of the present disclosure, the second searching module 703 includes a second obtaining unit 7031 and a second searching unit 7032.
The second obtaining unit 7031 is configured to obtain transaction messages and transaction serial numbers of the transactions in different systems, sort out a system through which the transactions flow and transaction codes in the different systems through the transaction messages and the transaction serial numbers of the transactions in the different systems, and construct a transaction link according to the system through which the transactions flow and the transaction codes in the different systems;
the second searching unit 7032 is configured to search, based on the transaction link, a related transaction of each transaction in the first transaction set, and search, according to the relationship chain between the test case and the transaction, a test case corresponding to the related transaction.
In one embodiment of the present disclosure, the testing module 704 includes a first testing unit 7041 and a third searching unit 7042.
The first testing unit 7041 is configured to perform regression testing on the test cases in the first test case set and the second test case set to find out a test case with a defect;
the third searching unit 7042 is configured to search for a function corresponding to the test case with the defect, obtain a function with the defect, and collect modification information of the function with the defect to form a regression test report.
In a specific embodiment of the present disclosure, the testing module 704 includes a collecting unit 7043, a second analyzing unit 7044, a third analyzing unit 7045, and a second testing unit 7046.
The collecting unit 7043 is configured to collect the test cases in the first test case set and the second test case set to obtain a third test case set;
the second analyzing unit 7044 is configured to analyze whether the third set of test cases has the test cases related to each other, and if yes, combine the test cases related to each other to form a fourth set of test cases;
the third analyzing unit 7045 is configured to analyze whether the test case that is not associated with any of the test cases exists in the third set of test cases, and if so, define the test case that is not associated with any of the test cases as an orphan test case;
the second testing unit 7046 is configured to search for a transaction corresponding to each test case in the fourth test case set, sort the test cases in the fourth test case set according to a business logic relationship between the transactions, sequentially perform regression testing on the test cases in the fourth test case set according to the order after the sorting, perform regression testing on the isolated test cases at the same time, obtain a test case with a defect, and obtain the regression testing result based on the test case with the defect.
It should be noted that, regarding the apparatus in the above embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated herein.
Example 3
Corresponding to the above method embodiment, the present disclosure further provides a regression testing device, and the regression testing device and the regression testing method described below may be referred to in correspondence with each other.
FIG. 3 is a block diagram illustrating an apparatus 800 for regression testing in accordance with an exemplary embodiment. As shown in fig. 3, the regression testing apparatus 800 may include: a processor 801, a memory 802. The regression tested device 800 may also include one or more of a multimedia component 803, an input/output (I/O) interface 804, and a communication component 805.
The processor 801 is configured to control the overall operation of the regression testing apparatus 800, so as to complete all or part of the steps in the regression testing method. The memory 802 is used to store various types of data to support the operation of the regression tested device 800, such data may include, for example, instructions for any application or method operating on the regression tested device 800, as well as application-related data such as contact data, transceived messages, pictures, audio, video, and so forth. The Memory 802 may be implemented by any type of volatile or non-volatile Memory device or combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic Memory, flash Memory, magnetic disk or optical disk. The multimedia components 803 may include screen and audio components. Wherein the screen may be, for example, a touch screen and the audio component is used for outputting and/or inputting audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signal may further be stored in the memory 802 or transmitted through the communication component 805. The audio assembly also includes at least one speaker for outputting audio signals. The I/O interface 804 provides an interface between the processor 801 and other interface modules, such as a keyboard, mouse, buttons, etc. These buttons may be virtual buttons or physical buttons. The communication component 805 is used for wired or wireless communication between the regression tested device 800 and other devices. Wireless communication, such as Wi-Fi, bluetooth, Near Field Communication (NFC), 2G, 3G, or 4G, or a combination of one or more of them, so that the corresponding communication component 805 may include: Wi-Fi module, bluetooth module, NFC module.
In an exemplary embodiment, the regression test apparatus 800 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components for performing the above regression test method.
In another exemplary embodiment, a computer readable storage medium comprising program instructions which, when executed by a processor, implement the steps of the method of regression testing described above is also provided. For example, the computer readable storage medium may be the memory 802 described above that includes program instructions that are executable by the processor 801 of the regression testing device 800 to perform the method of regression testing described above.
Example 4
Corresponding to the above method embodiment, the embodiment of the present disclosure further provides a readable storage medium, and a readable storage medium described below and a method of regression testing described above may be referred to correspondingly.
A readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method of regression testing of the above-mentioned method embodiments.
The readable storage medium may be a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and various other readable storage media capable of storing program codes.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (14)

1. A method of regression testing, comprising:
acquiring a modified code, wherein the modified code comprises a modified function, determining the modified function to be analyzed according to the modification type of the modified function, and defining the modified function to be analyzed as an analysis function;
searching a corresponding test case before the modification of the analysis function according to the analysis function, collecting the corresponding test case before the modification of the analysis function to form a first test case set, and searching a transaction corresponding to each test case in the first test case set to obtain a first transaction set;
searching the associated transactions of each transaction in the first transaction set, collecting the associated transactions of each transaction to obtain a second transaction set, and searching the test case corresponding to each associated transaction in the second transaction set to obtain a second test case set;
and performing regression testing on the test cases in the first test case set and the second test case set to obtain a regression testing result.
2. The method of claim 1, wherein the obtaining modified code, the modified code including a modified function, determining the modified function to be analyzed according to a modification type of the modified function, and defining the modified function to be analyzed as an analysis function includes:
determining modified content of the modified function based on the modified function;
determining a modification type of the modified function based on the modification content of the modified function;
analyzing whether the modification type of the modified function is code modification, data modification or alias modification, and if so, defining the modified function as an analysis function.
3. The method of claim 1, wherein the searching for the corresponding test case before the modification of the analysis function according to the analysis function, collecting the corresponding test case before the modification of the analysis function to form a first test case set, and searching for the transaction corresponding to each test case in the first test case set to obtain a first transaction set comprises:
acquiring codes before modification, test cases in a case base and transaction codes corresponding to the test cases;
based on the code before modification and the test case in the case base, establishing a mapping relation between a function in the code before modification and the test case, wherein the mapping relation between the function in the code before modification and the test case comprises a forward index of the test case to the function in the code before modification and a reverse index of the test case to the function in the code before modification, and establishing a relation chain between the test case and the transaction according to the transaction code corresponding to the test case;
and searching the corresponding test case before the modification of the analysis function by using the inverted index of the function from the test case to the code before the modification, and searching the transaction corresponding to each test case in the first test case set according to the relationship chain.
4. The method of claim 3, wherein the searching for the associated transaction of each transaction in the first transaction set, gathering the associated transactions of each transaction to obtain a second transaction set, and searching for the test case corresponding to each associated transaction in the second transaction set to obtain a second test case set comprises:
acquiring transaction messages and transaction serial numbers of the transactions in different systems, combing transaction flowing systems and transaction codes in different systems through the transaction messages and the transaction serial numbers of the transactions in different systems, and constructing a transaction link according to the transaction flowing systems and the transaction codes in different systems;
and searching the associated transaction of each transaction in the first transaction set based on the transaction link, and searching the test case corresponding to the associated transaction according to the relationship chain of the test case and the transaction.
5. The method of claim 1, wherein performing regression testing on the test cases in the first set of test cases and the second set of test cases to obtain a regression test result comprises:
performing regression testing on the test cases in the first test case set and the second test case set to find out test cases with defects;
and searching a function corresponding to the test case with the defect to obtain the function with the defect, and collecting modification information of the function with the defect to form a regression test report.
6. The method of claim 1, wherein performing regression testing on the test cases in the first set of test cases and the second set of test cases to obtain a regression test result comprises:
collecting the test cases in the first test case set and the second test case set to obtain a third test case set;
analyzing whether the third test case set has the test cases which are correlated with each other, and if so, collecting the test cases which are correlated with each other to form a fourth test case set;
analyzing whether the third test case set has the test case which is not associated with any test case, and if so, defining the test case which is not associated with any test case as an isolated test case;
searching the transaction corresponding to each test case in the fourth test case set, sorting the test cases in the fourth test case set according to the business logic relationship among the transactions, sequentially performing regression testing on the test cases in the fourth test case set according to the order after sorting, performing regression testing on the orphan test cases simultaneously to obtain test cases with defects, and obtaining the regression testing result based on the test cases with defects.
7. An apparatus for regression testing, comprising:
an obtaining module, configured to obtain a modified code, where the modified code includes a modified function, determine, according to a modification type of the modified function, the modified function that needs to be analyzed, and define the modified function that needs to be analyzed as an analysis function;
the first searching module is used for searching the corresponding test cases before the analysis function is modified according to the analysis function, collecting the corresponding test cases before the analysis function is modified to form a first test case set, and searching the corresponding transaction of each test case in the first test case set to obtain a first transaction set;
the second searching module is used for searching the associated transactions of each transaction in the first transaction set, collecting the associated transactions of each transaction to obtain a second transaction set, and searching the test case corresponding to each associated transaction in the second transaction set to obtain a second test case set;
and the test module is used for performing regression test on the test cases in the first test case set and the second test case set to obtain a regression test result.
8. The apparatus of claim 7, wherein the obtaining module comprises:
a first determining unit, configured to determine, based on the modified function, a modified content of the modified function;
a second determining unit, configured to determine a modification type of the modified function based on a modification content of the modified function;
and the first analysis unit is used for analyzing whether the modification type of the modified function is code modification, data modification or alias modification, and if so, defining the modified function as an analysis function.
9. The apparatus of claim 7, wherein the first lookup module comprises:
the first acquisition unit is used for acquiring codes before modification, test cases in the case base and transaction codes corresponding to the test cases;
the establishing unit is used for establishing a mapping relation between a function in the code before modification and the test case based on the code before modification and the test case in the case library, the mapping relation between the function in the code before modification and the test case comprises a forward index of the function from the test case to the code before modification and a reverse index of the function from the test case to the code before modification, and the relation chain between the test case and the transaction is established according to the transaction code corresponding to the test case;
the first searching unit is used for searching the corresponding test case before the analysis function is modified by using the inverted index of the function from the test case to the code before modification, and searching the transaction corresponding to each test case in the first test case set according to the relationship chain.
10. The apparatus of regression testing of claim 9, wherein said second lookup module comprises:
the second acquisition unit is used for acquiring the transaction messages and the transaction serial numbers of the transactions in different systems, combing the transaction flowing systems and the transaction codes in different systems through the transaction messages and the transaction serial numbers of the transactions in different systems, and constructing a transaction link according to the transaction flowing systems and the transaction codes in different systems;
and the second searching unit is used for searching the associated transaction of each transaction in the first transaction set based on the transaction link and searching the test case corresponding to the associated transaction according to the relationship chain of the test case and the transaction.
11. The apparatus of claim 7, wherein the testing module comprises:
the first testing unit is used for performing regression testing on the testing cases in the first testing case set and the second testing case set to find out testing cases with defects;
and the third searching unit is used for searching the function corresponding to the test case with the defects to obtain the function with the defects, and collecting the modification information of the function with the defects to form a regression test report.
12. The apparatus of claim 7, wherein the testing module comprises:
the collecting unit is used for collecting the test cases in the first test case set and the second test case set to obtain a third test case set;
the second analysis unit is used for analyzing whether the third test case set has the test cases which are mutually related or not, and if so, the test cases which are mutually related are gathered together to form a fourth test case set;
a third analyzing unit, configured to analyze whether the third test case set has the test case that is not associated with any of the test cases, and if yes, define the test case that is not associated with any of the test cases as an orphan test case;
the second testing unit is used for searching for the transaction corresponding to each testing case in the fourth testing case set, sequencing the testing cases in the fourth testing case set according to the business logic relationship among the transactions, sequentially performing regression testing on the testing cases in the fourth testing case set according to the sequence after sequencing, performing regression testing on the isolated testing cases to obtain testing cases with defects, and obtaining the regression testing result based on the testing cases with the defects.
13. A method of regression testing, comprising:
a memory for storing a computer program;
a processor for implementing the steps of the method of regression testing according to any one of claims 1 to 6 when executing said computer program.
14. A readable storage medium, characterized by: the readable storage medium has stored thereon a computer program which, when being executed by a processor, carries out the steps of the method of regression testing as claimed in any one of claims 1 to 6.
CN202111484166.1A 2021-12-07 2021-12-07 Regression testing method, device, equipment and readable storage medium Pending CN114218091A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111484166.1A CN114218091A (en) 2021-12-07 2021-12-07 Regression testing method, device, equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111484166.1A CN114218091A (en) 2021-12-07 2021-12-07 Regression testing method, device, equipment and readable storage medium

Publications (1)

Publication Number Publication Date
CN114218091A true CN114218091A (en) 2022-03-22

Family

ID=80700096

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111484166.1A Pending CN114218091A (en) 2021-12-07 2021-12-07 Regression testing method, device, equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN114218091A (en)

Similar Documents

Publication Publication Date Title
CN107622014B (en) Test report generation method and device, readable storage medium and computer equipment
CN105553769B (en) A kind of data acquisition and analysis system and method
CN110413506A (en) Test case recommended method, device, equipment and storage medium
CN109947635B (en) Data reporting method, device, storage medium and terminal equipment
US20090222646A1 (en) Method and apparatus for detecting processor behavior using instruction trace data
CN109766261B (en) Coverage test method, coverage test device, computer equipment and storage medium
CN111240876B (en) Fault positioning method and device for micro-service, storage medium and terminal
CN105574150A (en) Data processing method and device
CN105373293A (en) Data acquisition method and apparatus
CN105577472A (en) Data acquisition test method and device
CN111897727A (en) Software testing method and device, computer equipment and storage medium
CN105468508A (en) Code testing method and apparatus
CN111026647A (en) Code coverage rate obtaining method and device, computer equipment and storage medium
CN108399125A (en) Automated testing method, device, computer equipment and storage medium
CN106970870B (en) Webpage test platform, webpage test method and webpage test system
CN105912467B (en) Performance test method and device
CN114218091A (en) Regression testing method, device, equipment and readable storage medium
CN115481025A (en) Script recording method and device for automatic test, computer equipment and medium
CN115309661A (en) Application testing method and device, electronic equipment and readable storage medium
CN108563578A (en) SDK compatibility detection method, device, equipment and readable storage medium
CN105391602A (en) Data acquisition test method and device
CN113238931A (en) Test coverage calculation method and device based on execution path tracking technology
CN107102938B (en) Test script updating method and device
CN110866492A (en) Baseline branch identification method and device and computer system
CN114328225A (en) Transaction flow testing method, device, equipment and readable 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