CN113342681A - Regression testing method and device - Google Patents

Regression testing method and device Download PDF

Info

Publication number
CN113342681A
CN113342681A CN202110727646.XA CN202110727646A CN113342681A CN 113342681 A CN113342681 A CN 113342681A CN 202110727646 A CN202110727646 A CN 202110727646A CN 113342681 A CN113342681 A CN 113342681A
Authority
CN
China
Prior art keywords
field
date
data
operation result
data form
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
CN202110727646.XA
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.)
WeBank Co Ltd
Original Assignee
WeBank 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 WeBank Co Ltd filed Critical WeBank Co Ltd
Priority to CN202110727646.XA priority Critical patent/CN113342681A/en
Publication of CN113342681A publication Critical patent/CN113342681A/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 relates to the field of financial technology (Fintech), and discloses a regression testing method and a regression testing device, wherein the recording data form and the playback data form of a test case in a service database are respectively determined based on the basic data form of the test case, a first operation result of the test case under a first application version is obtained based on the recording data form, and a second operation result of the test case under a second application version is obtained based on the playback data form; and aiming at the same date check field, respectively converting a first date corresponding to the date check field in the first operation result and a second date corresponding to the date check field in the second operation result into a first check relation and a second check relation, and comparing to determine whether the first application version is successfully upgraded into the second application version. According to the method, the data form backup technology and the date translation technology are adopted, the aim of decoupling with the environment in the test process can be achieved, and the accuracy and the efficiency of comparison can be improved when the test results are compared.

Description

Regression testing method and device
Technical Field
The embodiment of the application relates to the field of financial technology (Fintech), in particular to a regression testing method and device.
Background
With the development of computer technology, more and more technologies (such as big data, cloud computing or block chain) are applied in the financial field, and the traditional financial industry is gradually shifting to the financial technology. For example, the banking industry, in the context of big data technology, often needs to version upgrade applications to better serve a product.
Before the application of the new version is released formally, regression testing needs to be performed on the application of the new version to determine functions of the application of the current running version, which are reserved in the application of the new version, and the functions are complete when the application of the new version is put into use.
For example, for the loan service of a bank, the life cycle is long, the form is extremely complex, and the corresponding batch regression test is complex. Batch regression testing can be achieved as is currently done by:
first, a data packet is prepared, i.e., a maintenance count is prepared, including: selecting a data packet retention date, making a nutrition number plan, and executing batches according to the plan; and after the plan execution is finished, backing up the whole database, wherein a backup packet of the database is a data packet.
Then, a baseline data packet is obtained, including: and restoring the whole database of the data packets to the original environment, then executing the batch of the current running version, and backing up the batched data packets to be used as baseline data packets.
Then, obtaining a check data packet, including: and restoring the whole database of the data package to the original environment, then executing the batch of the new version, and backing up the batched data package as a verification data package.
Finally, outputting the batch regression test result, including: and comparing the check data packet with the baseline data packet based on a manually configured comparison rule, and determining the result of the batch regression test, namely whether the application of the output new version is intact and retains the function of the application of the current running version during the batch regression test.
However, in the batch regression testing scheme, the related data of the data packet is bound to the original nutrient number environment, so that only the original nutrient number environment can be played back for regression testing. That is, the batch regression testing scheme described above requires the entire library to be restored to an independently available environment. In fact, the resources of the test environment are limited, and the test environment is used all the time, so that an independent available test environment can not be provided at any time. Therefore, the batch regression test scheme cannot realize the decoupling of environment dependence and fast regression at any time, and in addition, the mode of manually configuring the comparison rule is not intelligent enough, so that the missed detection of some fields is easy to occur.
In summary, a fast regression method that improves the accuracy of regression test results and does not depend on the test environment is needed.
Disclosure of Invention
The application provides a regression testing method and device, which are used for more accurately determining whether an old version of application is successfully upgraded to a new version of application under the condition of not depending on a testing environment.
In a first aspect, an embodiment of the present application provides a regression testing method, including: determining a recording data form of the test case in a service database based on a basic data form of the test case, and obtaining a first operation result of the test case under a first application version based on the recording data form; the field value of the date field in the recording data form is obtained by date translation; determining the playback data form of the test case in the service database based on the basic data form, and obtaining a second operation result of the test case under a second application version based on the playback data form; the field value of the date field in the playback data form is obtained by date translation; for the same date check field, converting a first date corresponding to the date check field in the first operation result into a first check relation, and converting a second date corresponding to the date check field in the second operation result into a second check relation; comparing the first check relationship with the second check relationship to determine whether the first application version is successfully upgraded to the second application version.
Based on the scheme, when the version of the application is upgraded, if one or some functions in the old version of the application are reserved in the new version of the application, before the new version of the application is online operated, a regression test can be performed to verify whether the/some reserved functions can be operated as they are in the old version of the application. In order to solve the technical problem, a baseline data packet can be obtained through the number of the data packets, and before a test result for comparison is obtained, the whole database of the data packets needs to be restored to the original environment each time, however, in the test process, the environmental resources are limited; in addition, the test results obtained after the application of the new version and the application of the old version are tested with respect to the same function are compared based on the manually configured rule for comparing the fields, so that the problem of missing detection is easily caused. Compared with the scheme of the background technology, the method and the device have the advantages that the data form backup technology and the date translation technology are adopted, so that the aim of decoupling with the environment in the test process can be achieved; in addition, in the embodiment of the application, the field values corresponding to the check fields on the same date in the first operation result and the second operation result are respectively converted into the first check relation and the second check relation, and the first check relation and the second check relation are compared, so that the comparison accuracy and the comparison efficiency can be improved when the test results are compared.
In one possible implementation method, for the same numeric check field, it is determined whether a first value corresponding to the numeric check field in the first operation result is the same as a second value corresponding to the numeric check field in the second operation result, so as to determine whether the first application version is successfully upgraded to the second application version.
Based on the scheme, when the two test results are compared in the process of performing regression testing on one or some functions, in addition to determining whether the configured date check field is consistent in the two test results, the field value of the numerical check field in the two test results also needs to be determined, so that when the application of the first version is upgraded to the application of the second version, whether the application of the second version can still operate as usual or not can be accurately determined.
In one possible implementation method, the determining a playback data form of the test case in the service database includes: acquiring a first data form of the test case in the service database under the second application version; updating the first data form based on the basic data form to obtain a second data form; and for any date field in the second data form, performing translation conversion on the field value of the date field in the second data form based on the date difference value between the date field in the basic data form and the set date field, so as to obtain the playback data form of the test case in the service database.
Based on the scheme, in the process of performing regression testing on one or some functions, the data form of the test case before the function testing is performed on the application of the new version, namely the second application version, needs to be obtained, namely the playback data form, wherein the data form of the test case, namely the first data form, can be obtained from the business database under the condition of the second application version; since the acquired first data form and the basic data form may be different in the related database and data table, in order to test the function to be tested under the same test environment, the first data form needs to be updated based on the basic data form to obtain the second data form, however, the data form at this time is not the final data form that can be used for the function test, at this time, the field value corresponding to the date field in the obtained second data form still needs to be translated, and through the two-step conversion, the obtained data form may be the same as the basic data form, and the data form at this time may be used for testing the function to be tested, so the data form at this time is the playback data form.
In one possible implementation, the base data modality includes a first set of data tables having at least one first data table; the first data modality includes a second data table set having at least one second data table; the updating the first data modality based on the basic data modality to obtain a second data modality includes: deleting from the second set of data tables that are more numerous than the first set of data tables, and adding to the second set of data tables the first set of data tables that are more numerous than the second set of data tables; and/or, for the same data table, if there is a field difference between a first data table in the first data table set and a second data table in the second data table set, deleting the field that is more than the first data table in the second data table from the second data table, adding the field that is more than the second data table in the first data table to the second data table, and updating the field value in the first data table to the same field in the second data table when the fields of the first data table and the second data table are the same; and/or replacing a first data table in the first data table set and a second data table in the second data table set aiming at the same data table with the second data table when the fields are the same, thereby obtaining a second data form.
Based on the scheme, since the acquired first data form and the basic data form may be different in the related database and data table, in order to test the function to be tested in the same test environment, the first data form needs to be updated based on the basic data form to obtain the second data form, wherein the basic data form is used as the update, and the data table and the field are added, deleted and changed for the first data form, so that the obtained second data form has the data table with the same basic data form, and the fields and the values corresponding to the fields are the same in the same data table.
In one possible implementation method, a first historical test case and a second historical test case with the same data form are determined based on the basic data form; respectively acquiring a first historical operation result and a second historical operation result of the first historical test case and the second historical test case under the first application version; and comparing the first historical operation result with the second historical operation result in the same field, and determining the attribute of each field, thereby obtaining each check field for checking whether the first application version is successfully upgraded to the second application version.
Based on the scheme, in the process of performing regression testing on one or some functions, a field comparison rule for comparing two test results can be configured in advance, wherein a first historical test case and a second historical test case which have the same data form as the basic data form can be determined from business data based on a first application version, then a first historical operation result and a second historical operation result of the two historical test cases under the first application version are respectively obtained, and because the fields of the two historical test results are respectively the same, the first historical operation result and the second historical operation result can be compared under the same field, and then the attribute of each field can be determined, wherein the attribute is the comparison rule for the field during comparison. By the method, the comparison rule corresponding to each comparison field when the two test results are compared can be determined accurately without omission, so that the conclusion whether the first application version is successfully upgraded to the second application version can be rapidly output.
In one possible implementation, the comparing the first historical operating result and the second historical operating result in the same field, and determining the attribute of each field includes: for any one of the fields, if the values of the configured date field in the first historical operation result and the configured date field in the second historical operation result are the same, determining that the attribute of the configured date field is a date check field; for any non-date field in the fields, if the values of the non-date field in the first historical operation result and the second historical operation result are the same, determining that the attribute of the non-date field is a numerical value check field; if the values of the non-date fields in the first historical operation result and the second historical operation result are different, determining that the attribute of the non-date field is an ignored field; the ignore field is used for indicating that the comparison of the non-date field is ignored when determining whether the first application version is successfully upgraded to the second application version.
Based on the scheme, when the first historical operation result and the second historical operation result are compared under the same field, the field can be a configuration date field, if the value of the configuration date field in the first historical operation result and the value of the configuration date field in the second historical operation result are the same, the attribute of the configuration date field is indicated to be a date check field, and when the configuration date field is the date check field, the comparison of the configuration date field on the first operation result and the second operation result can be carried out based on the date sequence; the field may also be a non-date field, if the values of the non-date field in the first historical operation result and the second historical operation result are the same, it is indicated that the attribute of the non-date field is a numeric check field, and if the non-date field is a numeric check field, when the non-date field is compared between the first operation result and the second operation result, it is necessary that the field values of the two are the same to determine that the non-date field comparison is passed; if the field is an dateless field, the value of the dateless field in the second historical operation result may not be the same as the value of the dateless field in the second historical operation result, and if the dateless field is an omitted field, the comparison of the fields of the dateless field may be omitted if the dateless field is compared between the first operation result and the second operation result, and it is directly determined that the comparison of the two test results in the dateless field passes.
In one possible implementation, the basic data form is obtained by: backing up a service database of the test case after running under the first application version as a text; constructing an SQL statement for inquiring the test case; acquiring a database and a data table related to the test case under the first application version from the text based on the SQL statement; and taking the data of the database and the test case in the data table as the basic data form of the test case under the first application version.
In a second aspect, an embodiment of the present application provides a regression testing apparatus, including: the first operation result generation unit is used for determining the recording data form of the test case in a service database based on the basic data form of the test case and obtaining a first operation result of the test case under a first application version based on the recording data form; the field value of the date field in the recording data form is obtained by date translation; a second operation result generation unit, configured to determine, based on the basic data form, a playback data form of the test case in the service database, and obtain, based on the playback data form, a second operation result of the test case in a second application version; the field value of the date field in the playback data form is obtained by date translation; the judging unit is used for converting a first date corresponding to the date check field in the first operation result into a first check relation and converting a second date corresponding to the date check field in the second operation result into a second check relation aiming at the same date check field; comparing the first check relationship with the second check relationship to determine whether the first application version is successfully upgraded to the second application version.
In a possible implementation method, the determining unit is further configured to: and determining whether a first value corresponding to the numerical value check field in the first operation result is the same as a second value corresponding to the numerical value check field in the second operation result aiming at the same numerical value check field, so as to determine whether the first application version is successfully upgraded to the second application version.
In a possible implementation method, the second operation result generation unit is specifically configured to: acquiring a first data form of the test case in the service database under the second application version; updating the first data form based on the basic data form to obtain a second data form; and for any date field in the second data form, performing translation conversion on the field value of the date field in the second data form based on the date difference value between the date field in the basic data form and the set date field, so as to obtain the playback data form of the test case in the service database.
In one possible implementation, the base data modality includes a first set of data tables having at least one first data table; the first data modality includes a second data table set having at least one second data table; the second operation result generation unit is specifically configured to: deleting from the second set of data tables that are more numerous than the first set of data tables, and adding to the second set of data tables the first set of data tables that are more numerous than the second set of data tables; and/or, for the same data table, if there is a field difference between a first data table in the first data table set and a second data table in the second data table set, deleting the field that is more than the first data table in the second data table from the second data table, adding the field that is more than the second data table in the first data table to the second data table, and updating the field value in the first data table to the same field in the second data table when the fields of the first data table and the second data table are the same; and/or replacing a first data table in the first data table set and a second data table in the second data table set aiming at the same data table with the second data table when the fields are the same, thereby obtaining a second data form.
In one possible implementation, the apparatus further includes a field attribute determining unit; the field attribute determining unit is configured to: respectively acquiring a first historical test case and a second historical test case with the same field value; on the basis of the same data form, respectively operating the first historical test case and the second historical test case under the first application version to obtain a first historical operating result and a second historical operating result under the first application version; and comparing the first historical operation result with the second historical operation result in the same field, and determining the attribute of each field, thereby obtaining each check field for checking whether the first application version is successfully upgraded to the second application version.
In a possible implementation method, the field attribute determining unit is specifically configured to: for any configuration date field in the fields, if the values of the configuration date field in the first historical operation result and the second historical operation result are the same, determining that the attribute of the configuration date field is a date check field; for any non-date field in the fields, if the values of the non-date field in the first historical operation result and the second historical operation result are the same, determining that the attribute of the non-date field is a numerical value check field; if the values of the non-date fields in the first historical operation result and the second historical operation result are different, determining that the attribute of the non-date field is an ignored field; the ignore field is used for indicating that the comparison of the non-date field is ignored when determining whether the first application version is successfully upgraded to the second application version.
In one possible implementation, the apparatus further includes a base data form generation unit; the basic data form generating unit is configured to: backing up a service database of the test case after running under the first application version as a text; constructing an SQL statement for inquiring the test case; acquiring a database and a data table related to the test case under the first application version from the text based on the SQL statement; and taking the data of the database and the test case in the data table as the basic data form of the test case under the first application version.
In a third aspect, an embodiment of the present application provides a computing device, including:
a memory for storing program instructions;
and the processor is used for calling the program instructions stored in the memory and executing the implementation method of the first aspect according to the obtained program.
In a fourth aspect, the present application provides a computer-readable storage medium storing computer-executable instructions for causing a computer to perform the method according to any one of the first aspects.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a flowchart of a regression testing method according to an embodiment of the present disclosure;
fig. 2 is a schematic diagram of a regression testing apparatus according to an embodiment of the present disclosure;
fig. 3 is a computing device provided in an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application clearer, the present application will be described in further detail with reference to the accompanying drawings, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all embodiments. 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 application.
At present, the banking industry needs to perform maintenance and obtain a baseline data packet when performing batch regression testing, so that during the regression testing, the obtained verification data packet and the baseline data packet can be compared based on a manually configured comparison rule to determine some functions of the application of the current running version that are reserved in the application of the new version, and when the application of the new version is put into use, whether the functions can be normally run or not is determined.
In the process, on one hand, the related data of the data packet is bound in the original nutrient number environment, so that only the original nutrient number environment can be played back for regression testing. That is, the batch regression testing scheme described above requires the entire library to be restored to an independently available environment. In fact, the resources of the test environment are limited, and the test environment is used all the time, so that an independent available test environment can not be provided at any time. Therefore, the batch regression test scheme cannot realize the decoupling of environment dependence and fast regression at any time, and on the other hand, when the verification data packet is compared with the baseline data packet, whether the comparison rule is configured manually or not needs to be checked, so that obviously, the mode of manually configuring the comparison rule is not intelligent enough, and meanwhile, a missed detection field is easy to appear.
In order to solve the above problems, the present application provides a regression testing method. Before describing the regression testing method, the present application first illustrates the application of the method by the following example.
The banking is involved in many businesses, such as deposit business, withdrawal business, loan business, etc. In various business scenarios, many specific businesses may be included. If in the loan service scene, if the loan service is divided according to the loan amount, the loan service can be divided into small-amount loan, medium-amount loan, large-amount loan and other types; if the loan service is divided according to the application type, the loan service can be divided into the vehicle loan service, the house loan service and other types; for example, the loan transaction is divided according to the repayment period, and the loan transaction can be divided into the types of closing off on the day of the loan, closing off in one month, closing off in half a year, closing off in one year and the like. Obviously, by way of example only, for the loan transaction scenario, there may be many data forms, such as data forms that may include closing of the day of the loan, closing of the nth billing day (e.g., closing of the first billing day), closing of the nth billing day after M days of overdue (e.g., closing of the first billing day after 1 day of overdue), and it is conceivable that the data forms involved in the operation of the banking system will be countless and extremely complex.
Since any data form can correspond to one function of the banking system, when a banking worker upgrades the banking system, considering that the data forms related to the banking system in the operation process are very many and complex, only the regression test of the function of clearing the first bill day after 1 day in the loan service scene is taken as an example for detailed description in the implementation of the application, and the regression test of other functions of the banking system can refer to the process of performing the regression test of the function of clearing the first bill day after 1 day illustrated in the application, so that the regression test of other functions of the banking system is not related to the description in the embodiment of the application. If the function of clearing the first account after 1 day of overdue date can be tested on the application of a new version and the function can be operated as usual on the application of an old version under the loan service scene, the regression test needs to be carried out on the function. If the regression test result confirms that the function and other functions to be tested are all intact, the application of the new version can be released formally and put into use.
When judging whether a function to be tested has the operation effect on the application of the new version as the function has on the application of the old version, the function can be checked through regression testing. Specifically, when the result of the function to be tested running on the new version of application is compared with the result of the function running on the old version of application, the same field can be compared, and whether the function is well preserved in the application upgrading process is determined according to the comparison result of each field.
Compared with the current scheme of determining the comparison rule of each field in a manual manner, the embodiment of the present application provides a method for intelligently determining the comparison rule of each field, which may specifically refer to the following examples:
if the function to be tested is the function that the first bill day is cleared after 1 day, for example, when a bank A tests the function that the first bill day is cleared after 1 day, two historical test cases can be determined from the business database based on the application of the old version. The two historical test cases need to have the following characteristics: the two historical test cases need to borrow the same number of loans from the bank A on the same day, and the respective payment dates agreed with the bank A are the first bill date (it can be understood that under the same banking system, because the borrowing occurrence dates of the two historical test cases are the same, the first bill dates of the two historical test cases are the same by default in the embodiment of the application); in addition, the two historical test cases do not actually clear the borrowing from the bank A on the first bill day, but the two historical test cases do not clear the borrowing from the bank A on the day after the first bill day.
For example, the two historical test cases may be ordered as user B and user C, respectively, where:
let user B borrow 1000 yuan from bank A in 1 month 1 day of 2021 (abbreviated as 20210101 day, which is similar to the same writing method of date and is not described herein again), and the date of clearing the borrowing agreed with bank A is 20210201 days, that is, user B needs to clear the borrowing in the first bill day; however, user B actually returns 1000 Yuan to Bank A on 20210202 days, i.e. user B completes the loan when the first bill day is 1 day out;
similarly, user C also borrowed from Bank A1000 Yuan on 20210101 days, and agreed with Bank A to return the borrowed date to 20210201 days, however, user C returned the borrowed 1000 Yuan to Bank A on 20210202 days, and thus user C also settled the loan when the first bill day was 1 day out.
By the above illustration of the two historical test cases, since the user B and the user C borrow the same amount of loans from the bank a on the same day, and both are on the same day — the first bill is overdue for 1 day, and the loans are settled, the records of the user B and the user C in the service database are similar, for example, the database and the data table related to the service are the same, that is, the fields related to the service database are the same. Wherein:
for some non-date fields, such as the amount of borrowed money, the amount of returned money, the amount of settled account balance, etc., the values of the user B and the user C in these fields must be the same, for example, the field values of both the user B and the user C in the amount of borrowed money are 1000 yuan, the field values of both the user B and the user C in the amount of returned money are 1000 yuan, and the field values of both the user B and the user C in the amount of settled account balance are 0 yuan, so that each non-date field having such an attribute may be determined as a value check field in the embodiment of the present application. Thus, when comparing the results of the regression test, if the fields to be compared belong to the numerical check fields, it is necessary to compare whether the field values under the fields are the same, and when determining that the field values are the same, it may be determined that the comparison result about the fields passes the comparison;
for some non-date fields, such as fields related to user personalized data, such as user identification number, mobile phone number, customer number, bank card number, etc., the corresponding values of user B and user C under these fields are necessarily different, and therefore, in the embodiment of the present application, each non-date field having such an attribute may be determined as an ignored field. In this way, when the results of the regression test are compared, if the field to be compared belongs to the ignored field, the comparison of the field is ignored, and it is directly determined that the comparison result of the field is a comparison pass.
For some configuration date fields, such as loan occurrence date, first payment date, actual payment date, etc., the values of the fields of the user B and the user C must be the same, for example, the field values of the fields of the loan occurrence date and the loan actual payment date are 20210101 days, the field values of the fields of the first payment date and the loan actual payment date are 20210201 days, and the field values of the fields of the actual payment date and the loan actual payment date are 20210202 days, so each date field having the attribute can be determined as a date check field in the embodiment of the present application. In this way, when comparing the results of the regression test, if the field to be compared belongs to the date check field, the comparison may be performed based on the date time series, and when it is determined that the two date time series are the same, it may be determined that the comparison result with respect to the field passes the comparison;
it should be noted that, for some other date fields, such as the account opening date of the user, the birth date of the user, etc., the values of the fields for the user B and the user C may be the same or different. However, each date field with this attribute will have no effect in comparing the results of the regression tests. Therefore, each date field having this attribute may be determined as an ignore field in the embodiment of the present application. In this way, when the results of the regression test are compared, if the field to be compared belongs to the ignored field, the comparison of the field is ignored, and it is directly determined that the comparison result of the field is a comparison pass.
By the mode, aiming at the function that the first bill date of the old version of application is cleared after 1 day, the comparison rule of each field can be determined according to the comparison of the operation results of the two historical test cases under the function of the old version of application, and the comparison rule of each field can be used for determining whether the function of the new version of application can achieve the effect of the function of the old version of application when the function is operated during the regression test.
The complex banking business makes the banking business system have many functions, so that for the regression test that needs to be performed before the formal release of the new version of the application, there may be many functions to be tested that need to perform the regression test during the contemporaneous test. Therefore, before the regression test is carried out, data for comparison corresponding to each function to be tested can be stored in advance, namely, for each function to be tested, a basic data form corresponding to each function to be tested can be recorded in advance; with the basic data form, the recording data form can be determined based on the basic data form, and after the recording data form is operated on the application of the old version, the operated result is stored, and the stored operated result can be used as a comparison reference when the regression test of the function is carried out on the application of the new version. The saved run result may be referred to as a first run result. Next, how to obtain the result of the first operation can be explained by a specific example described below.
Based on the foregoing example, when the function to be tested is the function that the first billing day is cleared after 1 day, a test case is constructed based on the application of the old version, for example, the test case may be made to be user D, and if user D borrows 1000 yuan from bank a at 20210220 days, then when the function that the first billing day is cleared after 1 day, the data form of user D in the business database at 20210320 days may be recorded based on user D, that is, the database referred to by user D in the business database at 20210320 days and the data tables referred to may be recorded. Wherein, the data form recorded at this time is the basic data form. Further, it can be assumed that the basic data form corresponding to the user D includes two databases, which are respectively a database 1 and a database 2, where the database 1 includes a data table 1 and a data table 2, and the database 2 includes a data table 3. Further, in the data table 1 of the database 1, one date field a is provided, and the field value corresponding to the date field a is 20210319, in the data table 2 of the database 1, one date field B is provided, and the field value corresponding to the date field B is 20210317, in the data table 3 of the database 2, three fields are provided, and are respectively set as field 1, field 2, and field 3, specifically, field 3 is a date field, and the date corresponding to field 3 is 20210315.
Then, when the function of clearing the first bill by 1 day after the expiration date is tested, the user D needs to be set to clear 1000 yuan for borrowing from the bank A at 20210321 in the testing process, and at this time, the database and the related data tables which are related to the business database by the user D at 20210321 are recorded. The data form recorded at this time is the first operation result. Furthermore, for each date field in the first operation result, the field value corresponding to each date field is converted into an expression of date time sequence, that is, the field value is converted into a relative relationship with the field value of a set date field. For example, in the embodiment of the present application, a date field of the first invoice date may be selected as a set date field, and a field value — 20210321 date corresponding to the date field may be converted into T +1 date for the date field of the actual payment date existing in the first operation result; as another example, 20210319 days of field values corresponding to the date field A in the data table 1 of the database 1 may be converted into T-1 days, 20210317 days of field values corresponding to the date field B in the data table 2 of the database 1 may be converted into T-3 days, and 20210315 days of field values corresponding to the field 3 in the data table 3 of the database 2 may be converted into T-5 days.
In the embodiment of the present application, the form of recorded data is the same as the form of basic data.
Both the recorded basic data form and the first operation result can be saved. The two stored data forms can be applied when the regression test is carried out on the function of clearing the first bill after 1 day before the new version of application is brought online.
For example, on the day of 20220524, the staff of bank A will upgrade the banking system, and the upgrade content includes the function of upgrading the clearing of the first bill by 1 day after the date. Since the data form of the user D for testing the function has been recorded in advance, that is, the basic data form has been recorded, it is only necessary to acquire the database and each data table related to the user D from the current service database on day 20220524, and the data form recorded at this time is set as the first data form.
At this time, when testing whether the function cleared by the new version of application after 1 day of overdue first bill date can operate as the function in the old version of application, the first data form needs to be restored to the basic data form, then the operation of paying 1000 yuan by the user D on 20220525 days is executed on the basis of the restored data form, finally, the data form paid 1000 yuan by the user D on 20220525 days can be compared with the data form paid 1000 yuan by the user D on 20210321 days, and then whether the function cleared by the first bill date after 1 day of overdue first bill date is good when the application version is upgraded can be determined. The recovered data form is a playback data form, and the data form of user D paid for 1000 yuan on day 20220525 is the second operation result.
It can be assumed that the first data form includes two databases, which are database 1 and database 2, respectively, where database 1 includes data table 2, and database 2 includes data table 3. Further, it may be assumed that: for the data table 2 of the database 1 in the first data form, the fields of the data table 2 are completely consistent with the fields of the data table 2 of the database 1 in the basic data form; in the data table 3 of the database 2 in the first data form, a total of 3 fields are included and set as field 1, field 3 and field 4, respectively, where the field value corresponding to field 3 is 20220422.
The first data form differs from the base data form so that the first data form can be restored to the base data form by:
1. with respect to the data table 1 in the database 1 in the basic data form, since the data table 1 exists only in the database 1 in the basic data form, but does not exist in the database 1 in the first data form, it is necessary to completely add the data table 1 in the database 1 in the basic data form to the database 1 in the first data form.
2. With respect to the data table 2 existing in the database 1 in the first data form, since the data table 2 already exists in the database 1 in the base data form and the fields of the two are the same, the data table 2 in the database 1 in the base data form needs to be replaced with the data table 2 in the database 1 in the first data form.
3. For the data table 3 in the database 2 existing in the first data form, since the data table 3 already exists in the database 2 based on the data form, but the two data tables have different fields, the update of the data table 3 in the database 2 in the first data form can be realized by the following two ways:
mode 1: and (4) overall updating. Such as replacing data table 3 in database 2 in the first data modality with data table 3 in database 2 in the base data modality;
mode 2: and updating step by step. If for the value corresponding to field 1 in data table 3 in database 2 in the first data modality, the value of field 1 in table 3 in database 2 in the base data modality can be replaced; similarly, for the value corresponding to field 3 in data table 3 in database 2 in the first data form, the value of field 3 in table 3 in database 2 in the base data form may be replaced, such as updating 20220422 to 20210315; for the field 4 in the data table 3 in the database 2 in the first data form, since the field 4 does not exist in the data table 3 in the database 2 in the base data form, the field 4 in the data table 3 in the database 2 in the first data form needs to be deleted; for field 2 in data table 3 in database 2 existing in the base data modality, while field 2 is not present in data table 3 in database 2 in the first data modality, field 2 in data table 3 in database 2 in the base data modality needs to be added to data table 3 in database 2 in the first data modality.
After the first data form is changed in the above manner, the field values corresponding to the date fields in the data form obtained by the change are still incorrect, so that the data form at this time is still not available for testing the function of running the new version application with the first invoice date expiring by 1 day, that is, the data form at this time is not yet the playback data form, and for example, the data form at this time can be referred to as the second data form. For each date field in the second data form, the field value corresponding to each date field can be corrected according to the date shift.
For example, regarding the value 20210315 corresponding to the field 3 in the data table 3 in the database 2 in the second data form, since the value 20210320, 20210315 corresponding to the field in the first billing day in the base data form can be represented as T-5 days in 20210315, based on the first billing day — 20220524 day when the new version is applied online, the value 20210315 corresponding to the field 3 in the data table 3 in the database 2 in the second data form can be updated, that is, 20220524 days need to be pushed forward for 5 days to obtain 20220519 days, and 20220519 is used to update 20210315, so as to obtain 20220519 corresponding to the value corresponding to the field 3 in the data table 3 in the database 2 in the second data form; similarly, for the value 20210319 corresponding to the date field a in the data table 1 in the database 1 in the second data form, since the value 20210320, 20210319 corresponding to the field of the first invoice date in the base data form may be represented as T-1 day by 20210319, based on the first invoice date — 20220524 day when the new version is applied online, the value 20210319 corresponding to the date field a in the data table 1 in the database 2 in the second data form may be updated, that is, the value 20220524 needs to be pushed forward by 1 day to obtain 20220523 day, and the value — 20220523 corresponding to the date field a in the data table 1 in the database 1 in the second data form is obtained by updating 20210319 by 20220523 day; similarly, for the value 20210317 corresponding to the date field B in the data table 2 in the database 1 in the second data form, since the value 20210320, 20210317 corresponding to the field of the first billing day in the base data form corresponding to 20210317 can be represented as T-3 days, the value 20210317 corresponding to the date field B in the data table 2 in the database 2 in the second data form can be updated based on the first billing day — 20220524 day when the new version is applied online, that is, the date 20220524 needs to be pushed forward by 3 days to obtain 20220521 days, and the date 20220521 needs to update the date 20210317, so that the value 20220521 corresponding to the date field B in the data table 2 in the database 1 in the second data form can be obtained. In this way, by performing the date shift operation on each date field in the second data format, the finally obtained data format is the playback data format.
Based on the obtained playback data form, the function that the first bill date is cleared by 1 day after the application of the new version can be tested on the data form. For example, for the obtained playback data form, the test process needs to set that the user D clears the bank a for 1000 yuan at 20220525 day, and records the database referred by the user D in the service database and the related data tables at 20220525 day. And the data form recorded at the moment is the second operation result. Furthermore, for each date field in the second operation result, the field value corresponding to each date field needs to be converted into an expression of date time sequence, that is, the field value is converted into a relative relationship with the field value of a set date field. Since the first billing date is selected as the set date field in the foregoing example, the first billing date is still used as the set date field to calculate the value corresponding to each date field in the second operation result. The date of the first billing day at this time is 20220524 days. For the date field of the actual repayment date existing in the second operation result, 20220525 date corresponding to the field value of the date field can be converted into T +1 date; as another example, 20220523 days of the field value corresponding to the date field A in the data table 1 of the database 1 may be converted into T-1 days, 20220521 days of the field value corresponding to the date field B in the data table 2 of the database 1 may be converted into T-3 days, and 20220519 of the field value corresponding to the field 3 in the data table 3 of the database 2 may be converted into T-5 days.
It is noted that in the application version upgrading process, when the function that the first billing day is cleared after 1 day is tested, an upgrading error may occur, for example, 20220525 in the second operation result may not be correctly converted into T +1 day; as another example, 20220523 in the second operation result may not be correctly converted to day T-1; further, 20220519 in the second operation result may not be correctly converted to day T-5.
For the test case, for example, the user D, as for the first operation result saved in advance and the second operation result obtained by the regression test, the database and the data table of the user D in the service database related to both the first operation result and the second operation result are the same, or each field of the user D in the service database related to both the first operation result and the second operation result is the same, so that each field of the user D in the first operation result and each field of the user D in the second operation result can be compared according to the field comparison rule for comparing each field formed in the foregoing example. The method specifically comprises the following steps:
and aiming at any field in the first operation result and the second operation result, comparing the field in the first operation result with the field value in the second operation result by using the corresponding comparison rule according to the attribute of the field in the field comparison rule.
For example, for an dateless field in the first operation result and the second operation result, if the dateless field is a return amount, according to the attribute of the return amount field in the field comparison rule, it may be determined that the return amount in the first operation result needs to be compared with the return amount in the second operation result, and when it is determined that the two return amounts are the same, it is determined that the comparison result for the field is a pass;
for example, for a non-date field in the first operation result and the second operation result, if the non-date field is the user identification number, according to the attribute of the field of the user identification number in the field comparison rule, it can be determined that the user identification number in the first operation result and the user identification number in the second operation result do not need to be compared, and the comparison result of the field is directly determined to be passed;
for example, for a configuration date field in the first operation result and the second operation result, if the configuration date field is a loan occurrence date, according to the attribute of the field of the loan occurrence date in the field comparison rule, it may be determined that the loan occurrence date (represented by a date sequence) in the first operation result and the loan occurrence date (represented by a date sequence) in the second operation result need to be compared, and when it is determined that the two date sequences are the same, it is determined that the comparison result for the field is pass;
for example, for a non-configured date field in the first operation result and the second operation result, if the date field is the account opening date of the user, according to the attribute of the field of the account opening date of the user in the field comparison rule, it may be determined that the account opening date of the user in the first operation result and the account opening date of the user in the second operation result do not need to be compared, and the comparison result of the field is directly determined to be passed.
Based on the above example, the present application may summarize the above example, so as to provide a regression testing method, as shown in fig. 1, which is a flowchart of a regression testing method provided in the embodiments of the present application, and the method includes the following steps:
step 101, determining a recording data form of a test case in a service database based on a basic data form of the test case, and obtaining a first operation result of the test case under a first application version based on the recording data form; the field value of the date field in the recorded data form is obtained by date translation.
In step 101, for example in a banking system, the functions involved are diverse. Each time the banking system is upgraded, it is true that one or some of the functions that make up the banking system are upgraded. When the new version of application is used to update the old version of application, it is very necessary to ensure that some functions already existing in the old version of application can still be run in the new version of application as usual (ignoring the situation that the upgrade content of this time is to delete one or some functions in the old version of application). For this reason, during the process of changing the new and old versions of the application, whether the functions existing in the old version of the application can be operated in the new version of the application as usual can be verified by means of regression testing. Thus, any function in the application of the old version can be marked as a function to be tested. The basic data form for regression testing may be pre-constructed prior to regression testing of a function to be tested. In conjunction with the foregoing example, if the function to be tested is the function whose first billing date is cleared by 1 day, and if user D is selected as the test case, the basic data form of the test case may be: on the day of the first bill day, namely 20210320, user D is located in two databases of the service databases, namely database 1 and database 2; specifically, user D is located in data table 1 and data table 2 in database 1, and is located in data table 3 in database 2. Further, for a date field a in the data table 1 of the database 1, the field value corresponding to the date field by the user D is 20210319, for a date field B in the data table 2 of the database 1, the field value corresponding to the date field by the user D is 20210317, and for three fields of the field 1, the field 2, and the field 3 included in the data table 3 of the database 2, specifically, the field value corresponding to the date field by the user D is 20210315.
In the foregoing example, the recorded data form is the basic data form, so that on the day of 20210321, the testing user D returns 1000 yuan for clearing the loan, and records the data form of the user D who has returned the loan in the service database, where the recorded data form is the first operation result. The first operation result may refer to the data in the foregoing example. The first application version may be the old version of the application in the previous example.
It should be noted that the form of the recorded data in the embodiment of the present application may also be different from the form of the basic data; wherein the recording data modality in this case is available based on the base data modality. In obtaining the recording data modality based on the base data modality, a field value of a date field in the recording data modality is obtained by date shift.
It should be noted that, in the embodiments of the present application, an example of obtaining a recorded data form based on a basic data form is not additionally provided, and reference may be made to the process of obtaining a playback data form based on a basic data form in the foregoing example, and implementation logics of the two are consistent, and are not described herein again.
102, determining a playback data form of the test case in the service database based on the basic data form, and obtaining a second operation result of the test case under a second application version based on the playback data form; the field value of the date field in the playback data modality is obtained by date shifting.
With reference to the foregoing example, when the function to be tested is the function that the first billing date is cleared after 1 day, and when, for example, the user D is selected as the test case, since the first operation result of the user D in the first application version is already recorded in step 101, in step 102, the playback data form used by the user D for the regression test can be obtained based on the basic data form, and then the playback data form is operated on the second application version, so that the second operation result can be obtained. The playback data form of the user D may be: on the day of the first bill day, namely 20220524, user D is located in two databases of the service databases, namely database 1 and database 2; specifically, user D is located in data table 1 and data table 2 in database 1, and is located in data table 3 in database 2. Further, for a date field a in the data table 1 of the database 1, the field value corresponding to the date field by the user D is 20220523, for a date field B in the data table 2 of the database 1, the field value corresponding to the date field by the user D is 20220521, and for three fields of the field 1, the field 2, and the field 3 included in the data table 3 of the database 2, specifically, the field value corresponding to the date field by the user D is 20220519. Wherein the second operation result can refer to the data in the foregoing example. The second application version may be the old version of the application in the previous example.
Step 103, for the same date check field, converting a first date corresponding to the date check field in the first operation result into a first check relation, and converting a second date corresponding to the date check field in the second operation result into a second check relation; comparing the first check relationship with the second check relationship to determine whether the first application version is successfully upgraded to the second application version.
In step 103, in connection with the foregoing example, it is assumed that for the date check field of field 3, the corresponding first date 20210315 of field 3 in the first run result is converted to T-5 days, and the corresponding second date 20220519 of field 3 in the second run result is converted to T-5 days, so that by comparing the first check relationship in the first run result and the second check relationship in the second run result, it can be determined whether the first application version was successfully upgraded to the second application version.
Based on the scheme, when the version of the application is upgraded, if one or some functions in the old version of the application are reserved in the new version of the application, before the new version of the application is online operated, a regression test can be performed to verify whether the/some reserved functions can be operated as they are in the old version of the application. In order to solve the technical problem, a baseline data packet can be obtained through the number of the data packets, and before a test result for comparison is obtained, the whole database of the data packets needs to be restored to the original environment each time, however, in the test process, the environmental resources are limited; in addition, the test results obtained after the application of the new version and the application of the old version are tested with respect to the same function are compared based on the manually configured rule for comparing the fields, so that the problem of missing detection is easily caused. Compared with the scheme of the background technology, the method and the device have the advantages that the data form backup technology and the date translation technology are adopted, so that the aim of decoupling with the environment in the test process can be achieved; in addition, in the embodiment of the application, the field values corresponding to the check fields on the same date in the first operation result and the second operation result are respectively converted into the first check relation and the second check relation, and the first check relation and the second check relation are compared, so that the comparison accuracy and the comparison efficiency can be improved when the test results are compared.
In one implementation of step 103, it is determined whether, for the same numeric check field, a first value corresponding to the numeric check field in the first operation result is the same as a second value corresponding to the numeric check field in the second operation result, so as to determine whether the first application version is successfully upgraded to the second application version.
For example, for the numeric check field of the return amount in the foregoing example, it may be determined whether the first application version was successfully upgraded to the second application version by comparing its corresponding first value in the first run result with its corresponding second value in the second run result.
In one implementation of step 102, the determining a playback data form of the test case in the service database includes: acquiring a first data form of the test case in the service database under the second application version; updating the first data form based on the basic data form to obtain a second data form; and for any date field in the second data form, performing translation conversion on the field value of the date field in the second data form based on the date difference value between the date field in the basic data form and the set date field, so as to obtain the playback data form of the test case in the service database.
Specifically, reference may be made to the process of obtaining the playback data form in the foregoing example, and details are not described here.
In some implementations of the present application, the base data modality includes a first set of data tables having at least one first data table; the first data modality includes a second data table set having at least one second data table; the updating the first data modality based on the basic data modality to obtain a second data modality includes: deleting from the second set of data tables that are more numerous than the first set of data tables, and adding to the second set of data tables the first set of data tables that are more numerous than the second set of data tables; and/or, for the same data table, if there is a field difference between a first data table in the first data table set and a second data table in the second data table set, deleting the field that is more than the first data table in the second data table from the second data table, adding the field that is more than the second data table in the first data table to the second data table, and updating the field value in the first data table to the same field in the second data table when the fields of the first data table and the second data table are the same; and/or replacing a first data table in the first data table set and a second data table in the second data table set aiming at the same data table with the second data table when the fields are the same, thereby obtaining a second data form.
Specifically, reference may be made to the foregoing example, which does not need to describe here any further, since the process of modifying the first data modality and performing date shifting based on the basic data modality when playing back the data modality.
In one implementation of step 101, determining a first historical test case and a second historical test case having the same data modality based on the base data modality; respectively acquiring a first historical operation result and a second historical operation result of the first historical test case and the second historical test case under the first application version; and comparing the first historical operation result with the second historical operation result in the same field, and determining the attribute of each field, thereby obtaining each check field for checking whether the first application version is successfully upgraded to the second application version.
Specifically, reference may be made to the process of determining the field comparison rule in the foregoing example, where the user B and the user C borrow a loan of the same amount from the bank on the same day, and return the loans on the day after the first billing day, respectively, and details are not repeated here.
In some implementations of the present application, the comparing the first historical operation result and the second historical operation result in the same field to determine the attribute of each field includes: for any one of the fields, if the values of the configured date field in the first historical operation result and the configured date field in the second historical operation result are the same, determining that the attribute of the configured date field is a date check field; for any non-date field in the fields, if the values of the non-date field in the first historical operation result and the second historical operation result are the same, determining that the attribute of the non-date field is a numerical value check field; if the values of the non-date fields in the first historical operation result and the second historical operation result are different, determining that the attribute of the non-date field is an ignored field; the ignore field is used for indicating that the comparison of the non-date field is ignored when determining whether the first application version is successfully upgraded to the second application version.
Specifically, reference may be made to the process of determining the field comparison rule by borrowing the same amount of loans from the bank on the same day by the user B and the user C based on the same day in the foregoing example, and returning the loans on the day after the first billing day, and the process of comparing the same field in the first operation result and the second operation result based on the determined field comparison rule, which is not described herein again.
In one implementation of step 101, the base data shape is obtained by: backing up a service database of the test case after running under the first application version as a text; constructing an SQL statement for inquiring the test case; acquiring a database and a data table related to the test case under the first application version from the text based on the SQL statement; and taking the data of the database and the test case in the data table as the basic data form of the test case under the first application version.
For the same test case, due to the difference of the expression habits of the users, the expression of the test case in different data tables in the business database may have difference, for example, in some data tables, the test case is identified by the identification number of the user, in other data tables, the test case is identified by the customer number of the user retained in the bank, and in yet other data tables, the test case is identified by the bank card number of the user, and although the expression forms have difference, the expression forms all represent the same test case. Therefore, in the embodiment of the application, the service database after the test case runs under the first application version is backed up as a text, and then the database and the data table related to the test case under the first application version can be comprehensively searched through the constructed SQL sentence for inquiring the test case, so that the related database and the data of the test case in the data table can be used as the basic data form of the test case under the first application version.
Based on the same concept, the embodiment of the present application provides a schematic diagram of a regression testing apparatus, as shown in fig. 2, the monitoring system includes a first operation result generating unit 201, a second operation result generating unit 202, and a judging unit 203;
a first operation result generating unit 201, configured to determine, based on a basic data form of a test case, a recorded data form of the test case in a service database, and obtain, based on the recorded data form, a first operation result of the test case in a first application version; the field value of the date field in the recorded data form is obtained by date translation.
A second operation result generating unit 202, configured to determine, based on the basic data form, a playback data form of the test case in the service database, and obtain, based on the playback data form, a second operation result of the test case in a second application version; the field value of the date field in the playback data modality is obtained by date shifting.
A determining unit 203, configured to convert, for a same date check field, a first date corresponding to the date check field in the first operation result into a first check relationship, and convert a second date corresponding to the date check field in the second operation result into a second check relationship; comparing the first check relationship with the second check relationship to determine whether the first application version is successfully upgraded to the second application version.
Further, for the apparatus, the determining unit 203 is further configured to: and determining whether a first value corresponding to the numerical value check field in the first operation result is the same as a second value corresponding to the numerical value check field in the second operation result aiming at the same numerical value check field, so as to determine whether the first application version is successfully upgraded to the second application version.
Further, for the apparatus, the second operation result generating unit 202 is specifically configured to: acquiring a first data form of the test case in the service database under the second application version; updating the first data form based on the basic data form to obtain a second data form; and for any date field in the second data form, performing translation conversion on the field value of the date field in the second data form based on the date difference value between the date field in the basic data form and the set date field, so as to obtain the playback data form of the test case in the service database.
Further to the apparatus, the base data modality includes a first set of data tables having at least one first data table; the first data modality includes a second data table set having at least one second data table; the second operation result generating unit 201 is specifically configured to: deleting from the second set of data tables that are more numerous than the first set of data tables, and adding to the second set of data tables the first set of data tables that are more numerous than the second set of data tables; and/or, for the same data table, if there is a field difference between a first data table in the first data table set and a second data table in the second data table set, deleting the field that is more than the first data table in the second data table from the second data table, adding the field that is more than the second data table in the first data table to the second data table, and updating the field value in the first data table to the same field in the second data table when the fields of the first data table and the second data table are the same; and/or replacing a first data table in the first data table set and a second data table in the second data table set aiming at the same data table with the second data table when the fields are the same, thereby obtaining a second data form.
Further, for the apparatus, a field attribute determining unit 204 is further included; a field attribute determining unit 204, configured to: determining a first historical test case and a second historical test case with the same data form based on the basic data form; respectively acquiring a first historical operation result and a second historical operation result of the first historical test case and the second historical test case under the first application version; and comparing the first historical operation result with the second historical operation result in the same field, and determining the attribute of each field, thereby obtaining each check field for checking whether the first application version is successfully upgraded to the second application version.
Further, for the apparatus, the field attribute determining unit 204 is specifically configured to: for any configuration date field in the fields, if the values of the configuration date field in the first historical operation result and the second historical operation result are the same, determining that the attribute of the configuration date field is a date check field; for any non-date field in the fields, if the values of the non-date field in the first historical operation result and the second historical operation result are the same, determining that the attribute of the non-date field is a numerical value check field; if the values of the non-date fields in the first historical operation result and the second historical operation result are different, determining that the attribute of the non-date field is an ignored field; the ignore field is used for indicating that the comparison of the non-date field is ignored when determining whether the first application version is successfully upgraded to the second application version.
Further, for the apparatus, a basic data form generation unit 205 is further included; a basic data form generation unit 205 configured to: backing up a service database of the test case after running under the first application version as a text; constructing an SQL statement for inquiring the test case; acquiring a database and a data table related to the test case under the first application version from the text based on the SQL statement; and taking the data of the database and the test case in the data table as the basic data form of the test case under the first application version.
The embodiment of the present application further provides a computing device, which may specifically be a desktop computer, a portable computer, a smart phone, a tablet computer, a Personal Digital Assistant (PDA), and the like. The computing device may include a Central Processing Unit (CPU), memory, input/output devices, etc., the input devices may include a keyboard, mouse, touch screen, etc., and the output devices may include a Display device, such as a Liquid Crystal Display (LCD), a Cathode Ray Tube (CRT), etc.
Memory, which may include Read Only Memory (ROM) and Random Access Memory (RAM), provides the processor with program instructions and data stored in the memory. In embodiments of the present application, the memory may be configured to store program instructions of a regression testing method;
and the processor is used for calling the program instructions stored in the memory and executing the regression testing method according to the obtained program.
As shown in fig. 3, a schematic diagram of a computing device provided in an embodiment of the present application includes:
a processor 301, a memory 302, a transceiver 303, a bus interface 304; the processor 301, the memory 302 and the transceiver 303 are connected through a bus 305;
the processor 301 is configured to read a program in the memory 302 and execute the regression testing method;
the processor 301 may be a Central Processing Unit (CPU), a Network Processor (NP), or a combination of a CPU and an NP. But also a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a Programmable Logic Device (PLD), or a combination thereof. The PLD may be a Complex Programmable Logic Device (CPLD), a field-programmable gate array (FPGA), a General Array Logic (GAL), or any combination thereof.
The memory 302 is used for storing one or more executable programs, and may store data used by the processor 301 in performing operations.
In particular, the program may include program code including computer operating instructions. The memory 302 may include a volatile memory (volatile memory), such as a random-access memory (RAM); the memory 302 may also include a non-volatile memory (non-volatile memory), such as a flash memory (flash memory), a Hard Disk Drive (HDD) or a solid-state drive (SSD); the memory 302 may also comprise a combination of memories of the kind described above.
The memory 302 stores the following elements, executable modules or data structures, or a subset thereof, or an expanded set thereof:
and (3) operating instructions: including various operational instructions for performing various operations.
Operating the system: including various system programs for implementing various basic services and for handling hardware-based tasks.
The bus 305 may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in FIG. 3, but this does not mean only one bus or one type of bus.
The bus interface 304 may be a wired communication access port, a wireless bus interface, or a combination thereof, wherein the wired bus interface may be, for example, an ethernet interface. The ethernet interface may be an optical interface, an electrical interface, or a combination thereof. The wireless bus interface may be a WLAN interface.
Embodiments of the present application also provide a computer-readable storage medium storing computer-executable instructions for causing a computer to perform a regression testing method.
It will be apparent to those skilled in the art that embodiments of the present application may be provided as a method, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While the preferred embodiments of the present application have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all alterations and modifications as fall within the scope of the application.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.

Claims (10)

1. A regression testing method, comprising:
determining a recording data form of the test case in a service database based on a basic data form of the test case, and obtaining a first operation result of the test case under a first application version based on the recording data form; the field value of the date field in the recording data form is obtained by date translation;
determining the playback data form of the test case in the service database based on the basic data form, and obtaining a second operation result of the test case under a second application version based on the playback data form; the field value of the date field in the playback data form is obtained by date translation;
for the same date check field, converting a first date corresponding to the date check field in the first operation result into a first check relation, and converting a second date corresponding to the date check field in the second operation result into a second check relation; comparing the first check relationship with the second check relationship to determine whether the first application version is successfully upgraded to the second application version.
2. The method of claim 1, wherein the method further comprises:
and determining whether a first value corresponding to the numerical value check field in the first operation result is the same as a second value corresponding to the numerical value check field in the second operation result aiming at the same numerical value check field, so as to determine whether the first application version is successfully upgraded to the second application version.
3. The method of claim 1,
the determining the playback data form of the test case in the service database includes:
acquiring a first data form of the test case in the service database under the second application version;
updating the first data form based on the basic data form to obtain a second data form;
and for any date field in the second data form, performing translation conversion on the field value of the date field in the second data form based on the date difference value between the date field in the basic data form and the set date field, so as to obtain the playback data form of the test case in the service database.
4. The method of claim 3, wherein the base data modality comprises a first set of data tables having at least one first data table; the first data modality includes a second data table set having at least one second data table;
the updating the first data modality based on the basic data modality to obtain a second data modality includes:
deleting from the second set of data tables that are more numerous than the first set of data tables, and adding to the second set of data tables the first set of data tables that are more numerous than the second set of data tables; and/or the presence of a gas in the gas,
for the same data table, if a first data table in the first data table set and a second data table in the second data table set have a field difference, deleting fields in the second data table which are more than the first data table from the second data table, adding fields in the first data table which are more than the second data table in the second data table, and updating field values in the first data table to be under the same field in the second data table when the fields in the first data table and the second data table are the same; and/or the presence of a gas in the gas,
and replacing a first data table in the first data table set and a second data table in the second data table set aiming at the same data table with the second data table when the fields are the same, thereby obtaining a second data form.
5. The method of claim 1, wherein the method further comprises:
determining a first historical test case and a second historical test case with the same data form based on the basic data form;
respectively acquiring a first historical operation result and a second historical operation result of the first historical test case and the second historical test case under the first application version;
and comparing the first historical operation result with the second historical operation result in the same field, and determining the attribute of each field, thereby obtaining each check field for checking whether the first application version is successfully upgraded to the second application version.
6. The method of claim 5,
the comparing the first historical operation result and the second historical operation result in the same field to determine the attribute of each field includes:
for any configuration date field in the fields, if the values of the configuration date field in the first historical operation result and the second historical operation result are the same, determining that the attribute of the configuration date field is a date check field;
for any non-date field in the fields, if the values of the non-date field in the first historical operation result and the second historical operation result are the same, determining that the attribute of the non-date field is a numerical value check field; if the values of the non-date fields in the first historical operation result and the second historical operation result are different, determining that the attribute of the non-date field is an ignored field; the ignore field is used for indicating that the comparison of the non-date field is ignored when determining whether the first application version is successfully upgraded to the second application version.
7. The method of claim 1, wherein the method further comprises the step of applying a voltage to the substrate
The basic data form is obtained by the following method, including:
backing up a service database of the test case after running under the first application version as a text;
constructing an SQL statement for inquiring the test case;
acquiring a database and a data table related to the test case under the first application version from the text based on the SQL statement;
and taking the data of the database and the test case in the data table as the basic data form of the test case under the first application version.
8. A regression testing apparatus, comprising:
the first operation result generation unit is used for determining the recording data form of the test case in a service database based on the basic data form of the test case and obtaining a first operation result of the test case under a first application version based on the recording data form; the field value of the date field in the recording data form is obtained by date translation;
a second operation result generation unit, configured to determine, based on the basic data form, a playback data form of the test case in the service database, and obtain, based on the playback data form, a second operation result of the test case in a second application version; the field value of the date field in the playback data form is obtained by date translation;
the judging unit is used for converting a first date corresponding to the date check field in the first operation result into a first check relation and converting a second date corresponding to the date check field in the second operation result into a second check relation aiming at the same date check field; comparing the first check relationship with the second check relationship to determine whether the first application version is successfully upgraded to the second application version.
9. A computer device, comprising:
a memory for storing a computer program;
a processor for calling a computer program stored in said memory, for executing the method according to any one of claims 1-7 in accordance with the obtained program.
10. A computer-readable storage medium having stored thereon computer-executable instructions for causing a computer to perform the method of any one of claims 1-7.
CN202110727646.XA 2021-06-29 2021-06-29 Regression testing method and device Pending CN113342681A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110727646.XA CN113342681A (en) 2021-06-29 2021-06-29 Regression testing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110727646.XA CN113342681A (en) 2021-06-29 2021-06-29 Regression testing method and device

Publications (1)

Publication Number Publication Date
CN113342681A true CN113342681A (en) 2021-09-03

Family

ID=77481439

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110727646.XA Pending CN113342681A (en) 2021-06-29 2021-06-29 Regression testing method and device

Country Status (1)

Country Link
CN (1) CN113342681A (en)

Similar Documents

Publication Publication Date Title
CN107077413B (en) Data driven test framework
CN111221726A (en) Test data generation method and device, storage medium and intelligent equipment
US20200175403A1 (en) Systems and methods for expediting rule-based data processing
CN113312259B (en) Interface testing method and device
CN111723102A (en) Intelligent contract updating method and device
EP2199905A1 (en) Lifecycle management and consistency checking of object models using application platform tools
CN110018819B (en) Data checking script generation method, device and equipment
CN111159040A (en) Test data generation method, device, equipment and storage medium
CN109947797B (en) Data inspection device and method
US11100089B2 (en) Systems and methods for use in loading data based on a hierarchical framework
US11347533B2 (en) Enhanced virtual machine image management system
CN111352997A (en) Test environment verification method and system
CN114816772B (en) Debugging method, debugging system and computing device for application running based on compatible layer
CN113342681A (en) Regression testing method and device
CN113434397B (en) Task system testing method and device, electronic equipment and storage medium
CN113986766A (en) Automatic testing method and device
CN113760237A (en) Compiling address updating method and device, terminal equipment and readable storage medium
CN110597862A (en) Data entry method, equipment and system based on information system
CN111723129A (en) Report generation method, report generation device and electronic equipment
US11768855B1 (en) Replicating data across databases by utilizing validation functions for data completeness and sequencing
CN114493821B (en) Data verification and cancellation method and device, computer equipment and storage medium
CN116361270A (en) Data comparison method, terminal equipment and computer readable storage medium
CN116755922A (en) Error code information management method and related equipment
CN117331812A (en) Service code verification method, device, computer equipment, storage medium and product
CN115269660A (en) Cache data 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