CN110781077A - Regression testing method and device for test cases - Google Patents

Regression testing method and device for test cases Download PDF

Info

Publication number
CN110781077A
CN110781077A CN201910932701.1A CN201910932701A CN110781077A CN 110781077 A CN110781077 A CN 110781077A CN 201910932701 A CN201910932701 A CN 201910932701A CN 110781077 A CN110781077 A CN 110781077A
Authority
CN
China
Prior art keywords
case
library
test
regressed
regression
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn
Application number
CN201910932701.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.)
Suzhou Wave Intelligent Technology Co Ltd
Original Assignee
Suzhou Wave Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Wave Intelligent Technology Co Ltd filed Critical Suzhou Wave Intelligent Technology Co Ltd
Priority to CN201910932701.1A priority Critical patent/CN110781077A/en
Publication of CN110781077A publication Critical patent/CN110781077A/en
Withdrawn 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/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites

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)
  • Stored Programmes (AREA)

Abstract

The invention relates to a regression testing method and a device for a test case, wherein the method comprises the following steps: responding to the update of the code version, comparing the new code with the old code to determine that a changed method exists, and storing the changed method into a changed method library; checking a calling method path of a test case in the case library, responding to the fact that the calling method path of the test case comprises at least one method with change, and storing the test case into the case library to be regressed; pulling a case to be regressed from a case library to be regressed and executing a test by means of a method in the change method library; and updating the tested new calling method path to a case library, and storing the test execution result into a regression test result library. The method provided by the invention is utilized to pointedly select the test cases needing regression, and only the grasped test cases are subjected to regression testing, so that the regression testing range is reduced, and the pertinence and the effectiveness of the regression testing are improved.

Description

Regression testing method and device for test cases
Technical Field
The invention relates to the technical field of automatic testing. The invention further relates to a regression testing method and device of the test case.
Background
In the modern software development process, regression testing is an indispensable development process. Currently, each regression test requires all test cases in the regression case library. This solution has the following problems:
(1) along with the iteration of software versions and the increase of system functions, the number of use cases is gradually huge, and the regression testing efficiency is lower and lower;
(2) the function which changes can not be subjected to targeted regression;
(3) the method cannot adapt to frequent publishing strategies in the agile development process;
(4) as system functionality tends to stabilize, regression testing becomes less and less effective.
In order to solve the above problems, an optimized regression testing method needs to be provided, in which test cases to be regressed are selected in a targeted manner during regression testing, and only the captured test cases are subjected to regression testing, so that the regression testing range is narrowed, and the pertinence and the effectiveness of the regression testing are improved.
Disclosure of Invention
In one aspect, the present invention provides a regression testing method for test cases based on the above objectives, wherein the method includes the following steps:
responding to the update of the code version, comparing the new code with the old code to determine that a changed method exists, and storing the changed method into a changed method library;
checking a calling method path of a test case in the case library, responding to the fact that the calling method path of the test case comprises at least one method with change, and storing the test case into the case library to be regressed;
pulling a case to be regressed from a case library to be regressed and executing a test by means of a method in the change method library;
and updating the tested new calling method path to a case library, and storing the test execution result into a regression test result library.
An embodiment of the regression testing method for test cases according to the present invention, wherein pulling the to-be-regressed case from the to-be-regressed case library and performing the test by means of altering the method in the method library further comprises:
and acquiring a new calling method path of the test case in a point burying mode.
According to the embodiment of the regression testing method of the test case, the field of the change method library comprises the unique identifier of the method, the name of the file where the method is located, the line number of the file where the method is located and the updating time.
According to the embodiment of the regression testing method of the test case, the fields of the case base and the case base to be regressed comprise case numbers, case execution steps, calling method paths and updating time.
According to the embodiment of the regression testing method for the test cases, the fields of the regression testing result library comprise case numbers, execution results, success/failure reasons, starting time and ending time.
On the other hand, the invention also provides a regression testing device for the test case, wherein the device comprises:
at least one processor; and
a memory storing processor-executable program instructions that, when executed by the processor, perform the steps of:
responding to the update of the code version, comparing the new code with the old code to determine that a changed method exists, and storing the changed method into a changed method library;
checking a calling method path of a test case in the case library, responding to the fact that the calling method path of the test case comprises at least one method with change, and storing the test case into the case library to be regressed;
pulling a case to be regressed from a case library to be regressed and executing a test by means of a method in the change method library;
and updating the tested new calling method path to a case library, and storing the test execution result into a regression test result library.
An embodiment of the regression testing apparatus for test cases according to the present invention, wherein pulling the to-be-regressed case from the to-be-regressed case library and executing the test by means of altering the method in the method library further comprises:
and acquiring a new calling method path of the test case in a point burying mode.
According to the embodiment of the regression testing device of the test case, the field of the change method library comprises the unique identifier of the method, the name of the file where the method is located, the line number of the file where the method is located and the updating time.
According to the embodiment of the regression testing device for the test cases, the fields of the case base and the case base to be regressed comprise case numbers, case execution steps, calling method paths and updating time.
According to the embodiment of the regression testing method for the test cases, the fields of the regression testing result library comprise case numbers, execution results, success/failure reasons, starting time and ending time.
By adopting the technical scheme, the invention at least has the following beneficial effects: the invention provides a change method library, an example library to be regressed and a regression test result library, when the regression test is carried out, the change method is determined by comparing codes of new and old versions, the test case to be regressed is captured according to the method calling path of the case in the case library, the range of the regression test is reduced, the captured test case is put into the case library to be regressed and the regression test is carried out, the incremental regression test is realized, the method better adapts to the frequent edition issuing strategy under agile development, and the pertinence and the effectiveness of the regression test are improved.
The present invention provides aspects of embodiments, which should not be used to limit the scope of the present invention. Other embodiments are contemplated in accordance with the techniques described herein, as will be apparent to one of ordinary skill in the art upon study of the following figures and detailed description, and are intended to be included within the scope of the present application.
Embodiments of the invention are explained and described in more detail below with reference to the drawings, but they should not be construed as limiting the invention.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are required to be used in the description of the prior art and the embodiments will be briefly described below, parts in the drawings are not necessarily drawn to scale, and related elements may be omitted, or in some cases the scale may have been exaggerated in order to emphasize and clearly show the novel features described herein. In addition, the structural order may be arranged differently, as is known in the art.
FIG. 1 shows a schematic block diagram of an embodiment of a regression testing method of test cases according to the present invention.
Detailed Description
While the present invention may be embodied in various forms, there is shown in the drawings and will hereinafter be described some exemplary and non-limiting embodiments, with the understanding that the present disclosure is to be considered an exemplification of the invention and is not intended to limit the invention to the specific embodiments illustrated.
FIG. 1 shows a schematic block diagram of an embodiment of a regression testing method of test cases according to the present invention. In the embodiment shown in the figure, the method comprises at least the following steps:
s1: responding to the update of the code version, comparing the new code with the old code to determine that a changed method exists, and storing the changed method into a changed method library;
s2: checking a calling method path of a test case in the case library, responding to the fact that the calling method path of the test case comprises at least one method with change, and storing the test case into the case library to be regressed;
s3: pulling a case to be regressed from a case library to be regressed and executing a test by means of a method in the change method library;
s4: and updating the tested new calling method path to a case library, and storing the test execution result into a regression test result library.
Specifically, when a new code version is pushed to the code version library, step S1 is first to compare the new code with the old code to determine the method of the change, that is, to pull the new code and to obtain the method of the change by text comparison with the old code. And then numbering the changed methods, and storing the changed methods in a changed method library, wherein the changed states of the methods comprise deletion, modification, addition and the like.
Subsequently, step S2 checks the calling method path of the test case in the case library, and stores the test case into the case library to be regressed in response to the calling method path of the test case including at least one method with a change. That is, if the method path called by the test case includes any method with a change, it is determined that the test case needs to be subjected to the regression test. And then, selecting all test cases needing regression testing through the judgment, and putting the selected test cases into the case library to be regressed in an incremental mode.
Based on the to-be-regressed case library, step S3 draws a to-be-regressed case therefrom, and then performs a test by means of a method in the modified method library in cooperation with an unmodified method, that is, performs a regression test on the test case in the to-be-regressed case library.
After the test is completed, step S4 updates the tested new calling method path to the case library, and stores the test execution result in the regression test result library. It should be noted that, since the change method library and the to-be-regressed case library are preferably stored in an incremental manner into a new method or test case, storing the test execution result into the regression test result library is helpful for judging which methods and/or test cases have completed regression testing, besides recording the test result and process for use by a conventional automatic test task, and avoiding the occurrence of omission and/or repetition of regression testing.
In one or more embodiments of the regression testing method for test cases of the present invention, the step S3 of pulling the to-be-regressed case from the to-be-regressed case library and executing the test by means of changing the method in the method library further includes: and acquiring a new calling method path of the test case in a point burying mode. Obtaining the test case call method path may be accomplished in any suitable manner in the art. In some embodiments, preferably, the new calling method path of the test case is obtained by a way of burying a point. And matching and acquiring the calling method path by setting a corresponding buried point.
In several embodiments of the regression testing method for test cases of the present invention, the field of the change method library includes a unique identifier of the method, a name of a file where the method is located, a row number of the file where the method is located, and update time. The method for recording the change through the unique identifier and the method name of the method, the position of the method for recording the change through the file name of the method and the file line number of the method in the code version library, the time for the change is recorded through the updating time, and the change of the same method for multiple times can be distinguished.
In some embodiments of the regression testing method for test cases, the fields of the case base and the case base to be regressed include case numbers, case execution steps, call method paths and update time. In this case, too, the time of the change is recorded by the update time and multiple regression tests of the same use case can be distinguished.
In still other embodiments of the regression testing method for test cases according to the present invention, the fields of the regression testing result library include a case number, an execution result, a success/failure reason, a start time, and an end time.
On the other hand, the invention also provides a regression testing device for the test case, wherein the device comprises: at least one processor; and a memory storing processor-executable program instructions that, when executed by the processor, perform the steps of:
s1: responding to the update of the code version, comparing the new code with the old code to determine that a changed method exists, and storing the changed method into a changed method library;
s2: checking a calling method path of a test case in the case library, responding to the fact that the calling method path of the test case comprises at least one method with change, and storing the test case into the case library to be regressed;
s3: pulling a case to be regressed from a case library to be regressed and executing a test by means of a method in the change method library;
s4: and updating the tested new calling method path to a case library, and storing the test execution result into a regression test result library.
In one or more embodiments of the regression testing apparatus for test cases of the present invention, the step S3 of pulling the to-be-regressed case from the to-be-regressed case library and executing the test by means of changing the method in the method library further includes: and acquiring a new calling method path of the test case in a point burying mode.
In some embodiments of the regression testing apparatus for test cases according to the present invention, the field of the change method library includes a unique identifier of the method, a name of a file where the method is located, a row number of the file where the method is located, and update time.
In some embodiments of the regression testing apparatus for test cases of the present invention, the fields of the case base and the case base to be regressed include a case number, a case execution step, a call method path, and an update time.
In still other embodiments of the regression testing apparatus for test cases according to the present invention, the fields of the regression testing result library include a case number, an execution result, a success/failure reason, a start time, and an end time.
The devices and apparatuses disclosed in the embodiments of the present invention may be various electronic terminal apparatuses, such as a mobile phone, a Personal Digital Assistant (PDA), a tablet computer (PAD), a smart television, and the like, or may be a large terminal apparatus, such as a server, and therefore the scope of protection disclosed in the embodiments of the present invention should not be limited to a specific type of device and apparatus. The client disclosed in the embodiment of the present invention may be applied to any one of the above electronic terminal devices in the form of electronic hardware, computer software, or a combination of both.
The computer-readable storage media (e.g., memory) described herein may be either volatile memory or nonvolatile memory, or may include both volatile and nonvolatile memory. By way of example, and not limitation, nonvolatile memory can include Read Only Memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM), which can act as external cache memory. By way of example and not limitation, RAM is available in a variety of forms such as synchronous RAM (DRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), and Direct Rambus RAM (DRRAM). The storage devices of the disclosed aspects are intended to comprise, without being limited to, these and other suitable types of memory.
By adopting the technical scheme, the invention at least has the following beneficial effects: the invention provides a change method library, an example library to be regressed and a regression test result library, when the regression test is carried out, the change method is determined by comparing codes of new and old versions, the test case to be regressed is captured according to the method calling path of the case in the case library, the range of the regression test is reduced, the captured test case is put into the case library to be regressed and the regression test is carried out, the incremental regression test is realized, the method better adapts to the frequent edition issuing strategy under agile development, and the pertinence and the effectiveness of the regression test are improved.
It is to be understood that the features listed above for the different embodiments may be combined with each other to form further embodiments within the scope of the invention, where technically feasible. Furthermore, the specific examples and embodiments described herein are non-limiting, and various modifications of the structure, steps and sequence set forth above may be made without departing from the scope of the invention.
In this application, the use of the conjunction of the contrary intention is intended to include the conjunction. The use of definite or indefinite articles is not intended to indicate cardinality. In particular, references to "the" object or "an" and "an" object are intended to mean one of many such objects possible. However, although elements of the disclosed embodiments of the invention may be described or claimed in the singular, the plural is contemplated unless limitation to the singular is explicitly stated. Furthermore, the conjunction "or" may be used to convey simultaneous features, rather than mutually exclusive schemes. In other words, the conjunction "or" should be understood to include "and/or". The term "comprising" is inclusive and has the same scope as "comprising".
The above-described embodiments, particularly any "preferred" embodiments, are possible examples of implementations, and are presented merely for a clear understanding of the principles of the invention. Many variations and modifications may be made to the above-described embodiments without departing substantially from the spirit and principles of the technology described herein. All such modifications are intended to be included within the scope of this disclosure.

Claims (10)

1. A regression testing method for test cases is characterized by comprising the following steps:
responding to the update of the code version, comparing the new code with the old code to determine that a changed method exists, and storing the changed method into a changed method library;
checking a calling method path of a test case in a case library, responding to the fact that the calling method path of the test case comprises at least one method with change, and storing the test case into the case library to be regressed;
pulling a case to be regressed from the case library to be regressed and executing a test by means of a method in the change method library;
and updating the tested new calling method path to a case library, and storing the test execution result into a regression test result library.
2. The method of claim 1, wherein the pulling a case to be regressed from the library of cases to be regressed and performing a test by means of a method in the library of alteration methods further comprises:
and acquiring a new calling method path of the test case in a point burying mode.
3. The method of claim 1, wherein the fields of the change method library comprise a unique identifier of the method, a name of a file where the method is located, a row number of the file where the method is located, and an update time.
4. The method according to claim 1, wherein the fields of the use case base and the use case base to be regressed comprise use case numbers, use case execution steps, call method paths and update time.
5. The method of claim 1, wherein the fields of the regression test result library comprise a use case number, an execution result, a success/failure reason, a start time, and an end time.
6. A regression test apparatus for test cases, the apparatus comprising:
at least one processor; and
a memory storing processor-executable program instructions that, when executed by the processor, perform the steps of:
responding to the update of the code version, comparing the new code with the old code to determine that a changed method exists, and storing the changed method into a changed method library;
checking a calling method path of a test case in a case library, responding to the fact that the calling method path of the test case comprises at least one method with change, and storing the test case into the case library to be regressed;
pulling a case to be regressed from the case library to be regressed and executing a test by means of a method in the change method library;
and updating the tested new calling method path to a case library, and storing the test execution result into a regression test result library.
7. The apparatus of claim 6, wherein the pulling of the to-be-regressed use case from the to-be-regressed use case library and the performing of the test by means of the method in the change method library further comprises:
and acquiring a new calling method path of the test case in a point burying mode.
8. The apparatus of claim 6, wherein the fields of the change method library comprise a unique identifier of a method, a name of the method, a name of a file where the method is located, a row number of the file where the method is located, and an update time.
9. The apparatus of claim 6, wherein the fields of the use case base and the use case base to be regressed comprise a use case number, a use case execution step, a calling method path, and an update time.
10. The apparatus of claim 6, wherein the fields of the regression test result library comprise a use case number, an execution result, a success/failure reason, a start time, and an end time.
CN201910932701.1A 2019-09-29 2019-09-29 Regression testing method and device for test cases Withdrawn CN110781077A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910932701.1A CN110781077A (en) 2019-09-29 2019-09-29 Regression testing method and device for test cases

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910932701.1A CN110781077A (en) 2019-09-29 2019-09-29 Regression testing method and device for test cases

Publications (1)

Publication Number Publication Date
CN110781077A true CN110781077A (en) 2020-02-11

Family

ID=69384648

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910932701.1A Withdrawn CN110781077A (en) 2019-09-29 2019-09-29 Regression testing method and device for test cases

Country Status (1)

Country Link
CN (1) CN110781077A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114564388A (en) * 2022-02-23 2022-05-31 中国农业银行股份有限公司 Program testing method and device, electronic equipment and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114564388A (en) * 2022-02-23 2022-05-31 中国农业银行股份有限公司 Program testing method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN110750267B (en) Service information updating method, device, computer equipment and storage medium
CN109586948A (en) Update method, apparatus, computer equipment and the storage medium of system configuration data
CN109902272B (en) Electronic form data processing method, electronic form data processing device, computer equipment and storage medium
CN108846131A (en) Weex page rendering method, apparatus, terminal and storage medium
CN110727724A (en) Data extraction method and device, computer equipment and storage medium
CN110781077A (en) Regression testing method and device for test cases
CN112597016A (en) Recording method, device and equipment of automatic test script and storage medium
CN112637005B (en) Flow playback method and device, computer equipment and storage medium
CN112486811A (en) Interface test method, device, equipment and medium
CN110543463A (en) Log storage method, device and equipment and readable storage medium
CN110704319A (en) Test case risk analysis method and device
CN110618939A (en) Method and device for automatic test case management
CN115810383A (en) Method and device for realizing bias voltage selection based on read retry
CN108614868B (en) Automatic database upgrading method
CN109240906B (en) Database configuration information adaptation method and device, computer equipment and storage medium
CN111367816B (en) Mobile test method and device, computer equipment and storage medium
CN112486824A (en) Use case code generation method and device, computer equipment and storage medium
CN113051146B (en) Monkey-based testing method, apparatus, device and storage medium
CN111258871A (en) Verification method, device, equipment and storage medium of distributed file system
CN112732238B (en) JS-based execution context acquisition method and related device
CN108959486A (en) Audit field information acquisition methods, device, computer equipment and storage medium
CN113722075B (en) Task management method, system, equipment and storage medium
CN115599861A (en) Data verification method, storage medium and equipment for database synchronization process
CN114218188A (en) Data migration method, device, equipment and storage medium
CN117743269A (en) Bus description file error correction processing method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WW01 Invention patent application withdrawn after publication

Application publication date: 20200211

WW01 Invention patent application withdrawn after publication