CN113312259B - Interface testing method and device - Google Patents

Interface testing method and device Download PDF

Info

Publication number
CN113312259B
CN113312259B CN202110579668.6A CN202110579668A CN113312259B CN 113312259 B CN113312259 B CN 113312259B CN 202110579668 A CN202110579668 A CN 202110579668A CN 113312259 B CN113312259 B CN 113312259B
Authority
CN
China
Prior art keywords
field
test
date
data
test case
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110579668.6A
Other languages
Chinese (zh)
Other versions
CN113312259A (en
Inventor
曾凌子
邓泳笙
符敬伟
江旻
杨杨
张晶
李理
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
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 CN202110579668.6A priority Critical patent/CN113312259B/en
Publication of CN113312259A publication Critical patent/CN113312259A/en
Application granted granted Critical
Publication of CN113312259B publication Critical patent/CN113312259B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/02Banking, e.g. interest calculation or account maintenance

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Business, Economics & Management (AREA)
  • Physics & Mathematics (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • General Engineering & Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Computer Hardware Design (AREA)
  • Development Economics (AREA)
  • General Business, Economics & Management (AREA)
  • Technology Law (AREA)
  • Strategic Management (AREA)
  • Marketing (AREA)
  • Economics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention relates to the field of financial science and technology (Fintech), and discloses an interface testing method and device, which are used for determining a first data record associated with a test case in a business database before recording; wherein the date data is a date relative relation with a field value of a set date field as a reference; recording a first test result of the test case after running in a first service system; before the test case is played back, the service database is restored through the first data record; the date data of the second data record is obtained according to the relative relationship of the date and the playback time; playing back the test case and recording a second test result of the test case after running in a second service system; and determining an interface test result of the first service system to be upgraded to the second service system according to the two test results. By the method, the upgraded interface can be tested based on the same test case in the service system upgrading process, and the defect that the test case needs to be repeatedly built in the interface test process is overcome.

Description

Interface testing method and device
Technical Field
The embodiment of the application relates to the field of financial science (Fintech), in particular to an interface testing method and device.
Background
With the development of computer technology, more and more technologies (such as big data, cloud computing or blockchain) are applied in the financial field, and the traditional financial industry is gradually changing to financial technology. In the context of big data technology, various business systems of banks are being continuously upgraded and updated. After each business system of the bank is upgraded, the interfaces of the business systems before and after the upgrade are required to be tested in order to ensure that each external system normally uses each business of the bank.
At present, the method for testing the interface of the bank business system mainly comprises the following steps of writing an automatic test script for each test point:
1. according to the test points, acquiring data in a required data form from a data warehouse, and constructing a request message module;
2. an interface automatic calling module;
3. and the return result checking module comprises a check on the return message and the database content.
Taking bank loan business as an example, the automatic test is related to a plurality of test scenes and data life cycles, the constructed data needs to follow batches, and the constructed test data is disposable and cannot be reused; thus requiring the construction of a large number of test cases.
In view of the foregoing, there is a need for an efficient method of testing interfaces.
Disclosure of Invention
The application provides an interface testing method and device, which are used for efficiently realizing automatic testing of an interface after a service system is upgraded, namely, a test case aiming at the same test point does not need to be repeatedly constructed.
In a first aspect, an embodiment of the present application provides an interface testing method, including: determining a first data record associated with a test case in a pre-recording service database; the date data in the first data record is a date relative relation with a field value of a set date field as a reference; recording a first test result of the test case after running in a first service system corresponding to the service database; before the test case is played back, restoring the service database through the first data record; date data of a second data record corresponding to the first data record in the service database is obtained according to the date relative relation and the playback time; playing back the test case, and recording a second test result of the test case after running in a second service system corresponding to the service database; and determining an interface test result of the first service system to be upgraded to the second service system according to the first test result and the second test result.
Based on the scheme, the method is based on the means of flow recording and playback, and specifically combines the characteristic that the test case has life cycle in a service system, and before flow recording, the date relative relation between the time when the flow is recorded and the field value of a set date field can be recorded; therefore, after the service system is upgraded by a technician, in order to realize high availability of data, the historical data record of the test case which is tested by the test point can be called, and the interface of the upgraded service system is continuously tested; in the process, the data record of the test case in the service database can be restored to the data record before the flow record, and meanwhile, date data in the data record before the flow record is restored is adaptively modified according to the date relative relation, so that whether the test result of the test case under the same test point is consistent or not can be determined based on the same test environment, and whether the interface is abnormal or not in the upgrading process of the service system is finally judged. By the method, the upgraded interface can be tested based on the same test case in the service system upgrading process, and the defect that the test case needs to be repeatedly built in the interface test in the background technology is overcome.
In one possible implementation method, the determining the first data record associated with the test case in the pre-recording service database includes: determining the data form of the test case; the data form is table information of each data table with at least one keyword of the test case in the service database, and the data form also comprises indication information for indicating a date field; determining a third data record associated with the test case in the service database before recording and each date field in the third data record according to the data form; and regarding any non-set date field in the third data record, taking the relation between the field value of the set date field and the field value of the non-set date field in the third data record as the date data in the non-set date field, thereby obtaining the first data record.
Based on the scheme, before the test case is used for testing the interface of the first service system, all record information of the test case in the service database, namely, a third data record and each date field in the third data record, can be obtained according to the data form of the test case, and then the date recorded in the service database for each date field can be converted into date data with a relative relation with the field value of a set date field, so that the first data record can be obtained. According to the scheme, before interface testing, records of a test case in a service database, which are related to date fields, are converted into date data which has a relative relation with a field value of a set date field, so that when a service system is upgraded, a historical test case can be used for testing an interface of the upgraded service system, at the moment, the date of the test case in the current service database only needs to be adaptively modified according to the relative relation, the test environment at the time of testing is consistent with the test environment at the time of recording the test case, and whether the interface of the upgraded service system is abnormal or not can be determined based on the test result at the time of testing and the test result at the time of recording, one-time recording of the test case is realized, the recorded test case can be used for testing the interface at the time of upgrading the service system each time, and the defect that the test case needs to be repeatedly constructed when the interface is tested in the background technology is overcome.
In a possible implementation method, the restoring the service database through the first data record includes: determining a fourth data record associated with the test case in the service database before playback according to the data form; restoring the service database according to the first data record and the fourth data record; and determining date data of the date field in the second data record according to the date relative relation and playback time of the date field in the first data record aiming at any date field in the second data record corresponding to the first data record in the restored service database.
Based on the scheme, after the service system is upgraded, whether the interface of the upgraded service system is abnormal or not is judged, and the interface of the upgraded service system can be tested based on historical test cases; the method comprises the steps of acquiring all record information, namely fourth data record, of a test case in a service database based on the data form of the test case, modifying the fourth data record based on the first data record, so that the record information of the test case in the service database is modified into record information of a previous interface test, and especially, the data of a date field of the test case in the service database is required to be adaptively modified according to the relative relation and the time (namely playback time) of the current interface test, so that the environment of the current interface test is consistent with the environment of the previous interface test, and therefore, under the same test environment, if the two test results are consistent (the test result of the default previous interface test in the application is that the interface is normal), the upgrade of the current service system is indicated, and the interface is not abnormal. The method can realize one-time recording of the test cases, but can use the recorded test cases for interface test in each service system upgrading, thereby overcoming the defect that the test cases need to be repeatedly constructed in the interface test in the background technology.
In one possible implementation method, the determining, according to the first test result and the second test result, an interface test result of upgrading the first service system to the second service system includes: acquiring each check field of the test case; each check field is determined according to a plurality of test results of the test case; determining, for any check field, a relationship of a first value of the check field in the first test result to a second value in the second test result; and determining an interface test result of the first service system upgraded to the second service system according to the relation between the first test result and the second test result of each check field.
Based on the scheme, in the process of testing the interface after the service system is upgraded, whether the interface is abnormal or not can be checked according to each check field of the test case. For any check field, comparing a first value of the check field in a first test result (i.e. a test result of the early interface test) with a second value of the check field in a second test result, if the first value and the second value are the same for each field to be checked, it is indicated that the interface after the service system is upgraded is not abnormal (in this application, the test result of the default early interface test is that the interface is normal). In the method, because each check field of the test case for checking whether the interface is abnormal is automatically confirmed by testing the test case for a plurality of times, an accurate and comprehensive standard for determining whether the interface is abnormal after the service system is upgraded can be obtained, and the method for automatically determining the evaluation standard is far greater than the efficiency and quality of manually establishing the evaluation standard.
In one possible implementation method, the verification fields are determined according to a plurality of test results for the test case, including: recording a third test result and a fourth test result of the test case after the test case operates in the first service system; and for any field in the test results, if the third value of the field in the third test result is the same as the fourth value in the fourth test result, determining the field as a check field.
Based on the scheme, after testing the interfaces of the service system by using the test cases, multiple requests are initiated to the same service system based on the request message recorded during the test, for example, two requests are initiated, so that a check field can be determined based on the test results returned by the two requests; for the same request message, the fields returned by the service system for two times should be the same, but the values of some fields change along with the sequence of the requests, which means that the fields with the changed time and values along with the requests cannot become the detection standard for judging whether the interface is abnormal in the upgrading process of the service system, but instead, the fields with the unchanged values in the two requests can be used as the detection standard for judging whether the interface is abnormal in the upgrading process of the service system. Based on the detection standard, the detection standard for judging whether the interface is abnormal or not in the upgrading process of the service system can be automatically determined by initiating the request message when the flow recording is carried out to the service system for a plurality of times.
In one possible implementation method, before the determining that the field is a check field, the method further includes: determining that the return code of the first message in the third test result is the same as the return code of the second message in the fourth test result; and determining, for any field in the test results, that the field is a check field if the third value of the field in the third test result is the same as the fourth value in the fourth test result, including: for any message field in the test result, if the field value of the message field in the first message is the same as the field value in the second message, the message field is used as a check field; and aiming at any table field in the test results, if the field value of the table field in the first table record corresponding to the third test result is the same as the field value in the second table record corresponding to the fourth test result, taking the table field as a check field.
Based on the scheme, when the request message in the process of recording the flow is sent to the service system for multiple times (such as twice) to automatically determine each check field, the return code of the message in the test result of the two times is consistent because the test of the interface comprises the check of the return message and the database content, and then each message field to be checked and each table field to be checked are determined, so that the problem that each field for checking cannot be finally obtained due to inconsistent return code after each table field is determined is avoided.
In one possible implementation, the determining the data morphology of the test case includes: inquiring the service database according to the first keyword in the test case to obtain the second keyword of the test case; inquiring each data table with the first key word or the second key word from the service database; denoising each data table with the first key word or the second key word to obtain each effective data table; if the table structure of each effective data table comprises a date field, setting indication information for the date field; and taking the table information of each effective data table and the indication information of each date field as the data form of the test case.
Based on the scheme, in the service database, each keyword for representing the test case possibly exists in the same test case, so that each data table containing each keyword can be obtained through inquiring the service database, each obtained data table is denoised, and each effective data table is further obtained, further, if one effective data table contains a date field, indication information can be set for the date field, and finally, table information of each effective data table and indication information of each date field can be used as data forms of the test case, so that all record information of the test case can be obtained from the service database according to the data forms of the test case in the process of testing an interface of the service system; in addition, since the indication information is set for the date field, when the corresponding data of the date field is adjusted when the interface of the service system after upgrading is tested, the date can be quickly adjusted by means of the date field with the indication information.
In a second aspect, an embodiment of the present application provides an interface testing apparatus, including: the data record determining unit is used for determining a first data record associated with the test case in the pre-recording service database; the date data in the first data record is a date relative relation with a field value of a set date field as a reference; the recording and playback unit is used for recording a first test result of the test case after running in a first service system corresponding to the service database; the service database restoring unit is used for restoring the service database through the first data record before playing back the test case; date data of a second data record corresponding to the first data record in the service database is obtained according to the date relative relation and the playback time; the recording and playback unit is further configured to play back the test case, and record a second test result of the test case after the test case is operated in a second service system corresponding to the service database; and the interface test result output unit is used for determining the interface test result of the first service system upgraded to the second service system according to the first test result and the second test result.
Based on the scheme, the method is based on the means of flow recording and playback, and specifically combines the characteristic that the test case has life cycle in a service system, and before flow recording, the date relative relation between the time when the flow is recorded and the field value of a set date field can be recorded; therefore, after the service system is upgraded by a technician, in order to realize high availability of data, the historical data record of the test case which is tested by the test point can be called, and the interface of the upgraded service system is continuously tested; in the process, the data record of the test case in the service database can be restored to the data record before the flow record, and meanwhile, date data in the data record before the flow record is restored is adaptively modified according to the date relative relation, so that whether the test result of the test case under the same test point is consistent or not can be determined based on the same test environment, and whether the interface is abnormal or not in the upgrading process of the service system is finally judged. By the method, the upgraded interface can be tested based on the same test case in the service system upgrading process, and the defect that the test case needs to be repeatedly built in the interface test in the background technology is overcome.
In a possible implementation method, the data record determining unit is specifically configured to: determining the data form of the test case; the data form is table information of each data table with at least one keyword of the test case in the service database, and the data form also comprises indication information for indicating a date field; determining a third data record associated with the test case in the service database before recording and each date field in the third data record according to the data form; and regarding any non-set date field in the third data record, taking the relation between the field value of the set date field and the field value of the non-set date field in the third data record as the date data in the non-set date field, thereby obtaining the first data record.
Based on the scheme, before the test case is used for testing the interface of the first service system, all record information of the test case in the service database, namely, a third data record and each date field in the third data record, can be obtained according to the data form of the test case, and then the date recorded in the service database for each date field can be converted into date data with a relative relation with the field value of a set date field, so that the first data record can be obtained. According to the scheme, before interface testing, records of a test case in a service database, which are related to date fields, are converted into date data which has a relative relation with a field value of a set date field, so that when a service system is upgraded, a historical test case can be used for testing an interface of the upgraded service system, at the moment, the date of the test case in the current service database only needs to be adaptively modified according to the relative relation, the test environment at the time of testing is consistent with the test environment at the time of recording the test case, and whether the interface of the upgraded service system is abnormal or not can be determined based on the test result at the time of testing and the test result at the time of recording, one-time recording of the test case is realized, the recorded test case can be used for testing the interface at the time of upgrading the service system each time, and the defect that the test case needs to be repeatedly constructed when the interface is tested in the background technology is overcome.
In one possible implementation method, the service database restoring unit is specifically configured to: determining a fourth data record associated with the test case in the service database before playback according to the data form; restoring the service database according to the first data record and the fourth data record; and determining date data of the date field in the second data record according to the date relative relation and playback time of the date field in the first data record aiming at any date field in the second data record corresponding to the first data record in the restored service database.
Based on the scheme, after the service system is upgraded, whether the interface of the upgraded service system is abnormal or not is judged, and the interface of the upgraded service system can be tested based on historical test cases; the method comprises the steps of acquiring all record information, namely fourth data record, of a test case in a service database based on the data form of the test case, modifying the fourth data record based on the first data record, so that the record information of the test case in the service database is modified into record information of a previous interface test, and especially, the data of a date field of the test case in the service database is required to be adaptively modified according to the relative relation and the time (namely playback time) of the current interface test, so that the environment of the current interface test is consistent with the environment of the previous interface test, and therefore, under the same test environment, if the two test results are consistent (the test result of the default previous interface test in the application is that the interface is normal), the upgrade of the current service system is indicated, and the interface is not abnormal. The method can realize one-time recording of the test cases, but can use the recorded test cases for interface test in each service system upgrading, thereby overcoming the defect that the test cases need to be repeatedly constructed in the interface test in the background technology.
In one possible implementation method, the interface test result output unit is specifically configured to: acquiring each check field of the test case; each check field is determined according to a plurality of test results of the test case; determining, for any check field, a relationship of a first value of the check field in the first test result to a second value in the second test result; and determining an interface test result of the first service system upgraded to the second service system according to the relation between the first test result and the second test result of each check field.
Based on the scheme, in the process of testing the interface after the service system is upgraded, whether the interface is abnormal or not can be checked according to each check field of the test case. For any check field, comparing a first value of the check field in a first test result (i.e. a test result of the early interface test) with a second value of the check field in a second test result, if the first value and the second value are the same for each field to be checked, it is indicated that the interface after the service system is upgraded is not abnormal (in this application, the test result of the default early interface test is that the interface is normal). In the method, because each check field of the test case for checking whether the interface is abnormal is automatically confirmed by testing the test case for a plurality of times, an accurate and comprehensive standard for determining whether the interface is abnormal after the service system is upgraded can be obtained, and the method for automatically determining the evaluation standard is far greater than the efficiency and quality of manually establishing the evaluation standard.
In one possible implementation method, the apparatus further includes a check field determining unit; the check field determining unit is configured to: recording a third test result and a fourth test result of the test case after the test case operates in the first service system; and for any field in the test results, if the third value of the field in the third test result is the same as the fourth value in the fourth test result, determining the field as a check field.
Based on the scheme, after testing the interfaces of the service system by using the test cases, multiple requests are initiated to the same service system based on the request message recorded during the test, for example, two requests are initiated, so that a check field can be determined based on the test results returned by the two requests; for the same request message, the fields returned by the service system for two times should be the same, but the values of some fields change along with the sequence of the requests, which means that the fields with the changed time and values along with the requests cannot become the detection standard for judging whether the interface is abnormal in the upgrading process of the service system, but instead, the fields with the unchanged values in the two requests can be used as the detection standard for judging whether the interface is abnormal in the upgrading process of the service system. Based on the detection standard, the detection standard for judging whether the interface is abnormal or not in the upgrading process of the service system can be automatically determined by initiating the request message when the flow recording is carried out to the service system for a plurality of times.
In a possible implementation method, the check field determining unit is further configured to: determining that the return code of the first message in the third test result is the same as the return code of the second message in the fourth test result; the check field determining unit is specifically configured to: for any message field in the test result, if the field value of the message field in the first message is the same as the field value in the second message, the message field is used as a check field; and aiming at any table field in the test results, if the field value of the table field in the first table record corresponding to the third test result is the same as the field value in the second table record corresponding to the fourth test result, taking the table field as a check field.
Based on the scheme, when the request message in the process of recording the flow is sent to the service system for multiple times (such as twice) to automatically determine each check field, the return code of the message in the test result of the two times is consistent because the test of the interface comprises the check of the return message and the database content, and then each message field to be checked and each table field to be checked are determined, so that the problem that each field for checking cannot be finally obtained due to inconsistent return code after each table field is determined is avoided.
In one possible implementation, the apparatus further includes a data morphology determination unit; the data form determining unit is used for: inquiring the service database according to the first keyword in the test case to obtain the second keyword of the test case; inquiring each data table with the first key word or the second key word from the service database; denoising each data table with the first key word or the second key word to obtain each effective data table; if the table structure of each effective data table comprises a date field, setting indication information for the date field; and taking the table information of each effective data table and the indication information of each date field as the data form of the test case.
Based on the scheme, in the service database, each keyword for representing the test case possibly exists in the same test case, so that each data table containing each keyword can be obtained through inquiring the service database, each obtained data table is denoised, and each effective data table is further obtained, further, if one effective data table contains a date field, indication information can be set for the date field, and finally, table information of each effective data table and indication information of each date field can be used as data forms of the test case, so that all record information of the test case can be obtained from the service database according to the data forms of the test case in the process of testing an interface of the service system; in addition, since the indication information is set for the date field, when the corresponding data of the date field is adjusted when the interface of the service system after upgrading is tested, the date can be quickly adjusted by means of the date field with the indication information.
In a third aspect, embodiments of the present application provide a computing device comprising:
a memory for storing program instructions;
and the processor is used for calling the program instructions stored in the memory and executing any implementation method according to the obtained program.
In a fourth aspect, embodiments of the present application provide a computer-readable storage medium storing computer-executable instructions for causing a computer to perform any one of the implementation methods of the first aspect.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a diagram of an interface testing method according to an embodiment of the present application;
fig. 2 is a schematic diagram of an interface testing device according to an embodiment of the present application;
fig. 3 is a schematic diagram of a computing device according to an embodiment of the present application.
Detailed Description
For the purposes of making the objects, technical solutions and advantages of the present application more apparent, the present application will be described in further detail below with reference to the accompanying drawings, wherein it is apparent that the described embodiments are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
At present, along with the great expansion of banking business and the continuous update of computer technology, a banking business system is continuously updated. After a user upgrades a service system, and tests the availability of the interface of the service system, it has a very important meaning for whether the service system can normally provide services to the outside.
The current method for testing the interfaces of the service system is to write test cases. If the interface of the service system is tested by using the written test case, then whether the interface of the service system is normally available can be determined according to the test result returned by the service system under the test case.
However, if the interface test method is applied to a scene of strong life cycle of data of banks and the like, users need to write test cases continuously along with continuous updating of the service system, so that the aim of testing the interfaces of the service system can be met. For example, in testing the interface of a loan service system of a bank, many test scenarios are related to the data lifecycle, and constructing test cases needs to follow the lot, even if the test environment has a small data volume, one lot will be in an hour level. More importantly, the test cases are discarded after one use, resulting in significant wastage of data. It is apparent that this method of interface testing is inefficient.
In view of the above technical problems, the present application provides an interface testing method, as shown in fig. 1, including the following steps:
step 101, determining a first data record associated with a test case in a pre-recording service database; the date data in the first data record is a date relative relationship with a field value of a set date field as a reference.
As is well known, loan transactions for banks are extremely complex, such as the types of transactions involved may include clearing operations, determining anti-fraud operations, etc. In this step, the clearing operation may be used as a test point. When the clearing operation is used as the test point, the test point can be refined according to the time of the last payment by the user, for example, the test point can be cleared on the day of borrowing, the next day of borrowing, the first bill, and the like, and various test points under the clearing operation are not exemplified one by one in the application. Each test point corresponds to an interface test scene, and under each interface test scene, a first data record associated with a test case in the service database can be determined before the flow is recorded, wherein the test case is an object determined by a user and used under each interface test.
For example, in the present application, a test point, i.e. a test point for clearing the next day of borrowing, may be selected as an example, and a test case may be an account that is determined by a user from a service database and is to be cleared the next day of borrowing, so that before testing whether an interface of a loan service system corresponding to the account is normal when the account is cleared the next day of borrowing, all record information associated with the account needs to be obtained from the service database, that is, a first data record associated with the test case is determined, where date data in the first data record is a date relative relationship with a field value of a set date field as a reference.
For example, when the user tests the interface of the loan service system corresponding to the test point of the day of borrowing and the day of borrowing, a test case can be selected as follows: the date of borrowing when an account borrows a set number of amounts (e.g., 1000 yuan) to a bank's loan service system is 2021.5.1 days, then the account will repay the borrowing to the bank on the 2021.5.2 day, i.e., 1000 yuan is required to be repaied. It is noted that, to simplify the interface test procedure, the account may be assumed to be a 1000-yuan at a time for borrowing to the bank.
For the loan scene of a bank, the data generally show the characteristic of life cycle, so the embodiment of the application can introduce the concept of date time sequence, for example, when the borrowing date is 0T, the date of other transactions occurring before or after the borrowing date can be recorded as 0 T+/-M days; for another example, for an account for a staged payment, its first bill day may represent 1T day, and other dates of transactions occurring before or after the first bill day may be credited as 1t±m days. For example, for the example of the test case that 1000 yuan is borrowed on 2021.5.1 days and 1000 yuan is paid on 2021.5.2 days, the date data recorded in the first data record may be 2021.5.2 days/0T+1 days before the flow recording, wherein 0T+1 days indicates that the clearing transaction occurs on the borrowing day-the day after 2021.5.1 days/0T, that is, the date on which the clearing transaction occurs is 2021.5.2 days. In other words, in the embodiment of the present application, the date setting field is selected as the borrowing date, where the value of the date setting field corresponding to the borrowing date is 2021.5.1 days, and when the interface test is that the date of the borrowing date is the next day, the time 2021.5.2 days of flow recording can be expressed as 0t+1 days. The selection of the date field is not limited in this application.
Step 102, recording a first test result of the test case after running in a first service system corresponding to the service database.
Following the previous example, when the interface test is borrowing day-next day statement, the flow record for this step will be: the request message of the test case for repaying all 1000 yuan can be sent to the loan service system of the bank; after receiving the request message of the test case, the loan service system of the bank processes the test case based on the request message and returns a processed first test result to the test case.
It is stated that, because the focus of the present application is to determine whether the interface of the service system after upgrading, i.e. the interface of the second service system, is still normal, the interface of the service system before default upgrading, i.e. the interface test is normal in the test process, i.e. the first test result when the default flow is recorded in the embodiment of the present application.
Step 103, restoring the service database through the first data record before playing back the test case; date data of a second data record corresponding to the first data record in the service database is obtained according to the date relative relation and the playback time.
In this step, in the process of upgrading the service system, in order to ensure that the interface of the upgraded service system does not become abnormally unavailable along with the upgrade, the interface of the upgraded service system needs to be tested again. In order to realize the repeated utilization of the same test case when the updated service system is tested at the interface, the service database needs to be restored to the environment when the test case is recorded before the test case is played back. In this way, the result of the interface test (the test result generated after the interface of the service system after upgrading is tested) can be compared with the first test result (the first test result when the default flow is recorded in the embodiment of the application is that the interface test is normal) under the same test environment, so that whether the upgrading event of the service system can cause adverse effect on the interface can be judged.
For example, when the test point of the interface test is the next day of borrowing, the test case returns 2021.5.1 days of 1000 yuan of borrowing on 2021.5.2 days, if on 2021.5.19 days, the user completes one upgrade action on the loan service system, and whether the interface of the upgraded loan service system is abnormal or not will be tested on the same day. Before the test case is played back, the service database in the interface test is restored according to all record information, namely the first data record, of the test case in the service database before the flow is recorded. Since the current interface test date is 2021.5.19 days, the borrowing date of the test case needs to be 2021.5.18 days according to the relative date relationship described above, namely, 0T+1 days. That is, since the current interface test date 2021.5.19 is equivalent to the interface test date 2021.5.2 at the time of flow recording, and 2021.5.2 is 0t+1 relative to 2021.5.1; therefore, when the test point of the interface test is the next day of borrowing, and the current interface test date is 2021.5.19 days, the interface test date needs to be pushed forward by one day, so as to generate the borrowing date of the interface test, that is, the borrowing date of the test case needs to be updated to 2021.5.18 days during the interface test.
And 104, playing back the test case, and recording a second test result of the test case after running in a second service system corresponding to the service database.
In this step, regarding the test of the interface of the service system after upgrading, after restoring the data record of the test case in the service database currently and the data record of the test case in the service database before recording the flow, the recorded flow can be played back, that is, the test case one-time repayment 1000 yuan request message is sent to the loan service system after upgrading, and the response result of the service system after upgrading to the request message is recorded. The updated service system is the second service system, and the response result is the second test result.
And 105, determining an interface test result of the first service system to be upgraded to the second service system according to the first test result and the second test result.
Based on the foregoing step 102, the present application defaults that the response result when recording the flow is that the interface test is normal, and then by comparing the response result when playing back the flow with the response result when recording the flow, it can be determined whether the upgrade of the service system will cause an adverse effect on the interface.
Based on the scheme, the method is based on the means of flow recording and playback, and specifically combines the characteristic that the test case has life cycle in a service system, and before flow recording, the date relative relation between the time when the flow is recorded and the field value of a set date field can be recorded; therefore, after the service system is upgraded by a technician, in order to realize high availability of data, the historical data record of the test case which is tested by the test point can be called, and the interface of the upgraded service system is continuously tested; in the process, the data record of the test case in the service database can be restored to the data record before the flow record, and meanwhile, date data in the data record before the flow record is restored is adaptively modified according to the date relative relation, so that whether the test result of the test case under the same test point is consistent or not can be determined based on the same test environment, and whether the interface is abnormal or not in the upgrading process of the service system is finally judged. By the method, the upgraded interface can be tested based on the same test case in the service system upgrading process, and the defect that the test case needs to be repeatedly built in the interface test in the background technology is overcome.
Some of the above steps will be described in detail below with reference to examples, respectively.
In one implementation of the step 101, the determining the first data record associated with the test case in the pre-record service database includes: determining the data form of the test case; the data form is table information of each data table with at least one keyword of the test case in the service database, and the data form also comprises indication information for indicating a date field; determining a third data record associated with the test case in the service database before recording and each date field in the third data record according to the data form; and regarding any non-set date field in the third data record, taking the relation between the field value of the set date field and the field value of the non-set date field in the third data record as the date data in the non-set date field, thereby obtaining the first data record.
In some implementations of the present application, the determining the data morphology of the test case includes: inquiring the service database according to the first keyword in the test case to obtain the second keyword of the test case; inquiring each data table with the first key word or the second key word from the service database; denoising each data table with the first key word or the second key word to obtain each effective data table; if the table structure of each effective data table comprises a date field, setting indication information for the date field; and taking the table information of each effective data table and the indication information of each date field as the data form of the test case.
When testing the interface of the loan service system of the bank by using the test case, the bank card number is often used as an identification of the test case, that is, different bank card numbers can be used for representing different test cases. However, not every business system in a bank identifies the same test case using a bank card number. However, although the same test case may be represented by using different identifiers, for the same service database, the bank card number may be used as a keyword, and the service database may be searched, so as to obtain keywords that are also used to identify the test case, such as an account number, a client number, an identification card number, and the like. The bank card number is the first keyword, and the account number, the client number, the identity card number and the like are the second keywords.
Then, when the service database is searched according to the first keyword and the second keyword, the data tables with the first keyword or the second keyword can be searched from the service database. For example, when the data table is searched for the service database based on the bank card number corresponding to a certain test case, if it can be determined that 3 data tables in the service database respectively contain the bank card number, and when the data table is searched for the service database based on the account number, the client number and the identity card number corresponding to the bank card number, if it can be determined that 1 data table in the service database contains the account number, and 4 data tables respectively contain the client number and 2 data tables respectively contain the identity card number. That is, 10 data tables are obtained at this time, and each of the data tables contains the record information of the test case.
However, considering that the same identification card number can open a plurality of bank cards, the same bank card may also simultaneously correspond to a plurality of customer numbers and account numbers, and so on, denoising the obtained 10 data tables is needed at this time to obtain effective record information about the test case. If there may be 2 data tables among the 10 data tables, the data table does not represent the test case, but is noise data. The remaining 8 data tables from which the 2 noise data tables are filtered can be used as valid data tables for the test case by denoising.
Then, for any one of the 8 valid data tables, if it is determined that the valid data table includes a date field, indication information may be set for the date field, where the set indication information may be used to quickly convert a value corresponding to the date field into a relative date having a relative relationship with a field value of a set date field before recording traffic (for example, when a test point of an interface is a borrowing day next day in the foregoing example, in a scenario where 2021.5.1 is a borrowing day, 2021.5.2 days in a service database needs to be additionally recorded as 0t+1 days), and on the other hand, when a service database is restored before playing back traffic, a value corresponding to a current date field may be quickly converted into a correct absolute date according to the relative date relationship (for example, when a service system is updated in the foregoing example, the same test point is tested using the same test example, when a new interface is tested on 2021.5.19 days, in the foregoing example, the test point needs to be relatively updated as the borrowing day 2021.5.18 days based on the relative date of t+1 in the foregoing example).
Finally, the table information of the 8 valid data tables and the indication information of each date field can be used as the data form of the test case.
After the data form of the test case is obtained, before the flow is recorded, the corresponding database record, namely the third database record and each date field, can be read from the service database according to the data form; further, after the database record is read, for the valid data table containing the date field (the valid data table containing the date field can be quickly determined by checking whether the set indication information is contained or not), the database record corresponding to the date field can be converted to convert the absolute date of the database record into a relative date related to the field value of a set date field.
As in the previous example, the date before the flow recording is 2021.5.2 days, which is an absolute date, wherein if the borrowing date is taken as the set date field and the corresponding field value is 2021.5.1 days, the 2021.5.2 days can be converted into 0t+1 days and used as the first data record.
In one implementation of the above step 103, the restoring the service database through the first data record includes: determining a fourth data record associated with the test case in the service database before playback according to the data form; restoring the service database according to the first data record and the fourth data record; and determining date data of the date field in the second data record according to the date relative relation and playback time of the date field in the first data record aiming at any date field in the second data record corresponding to the first data record in the restored service database.
For example, in the foregoing example, when the test point is the next day of borrowing, before the flow is recorded, a valid data table in the service database for recording the repayment record may be written with a 1000-yuan record of the test case on 2021.5.1 days; then after the flow is recorded, the valid data table may be written with a record of test cases owed 0-ary on 2021.5.2 days. And when the loan service system arranged at the 2021.5.19 day bank realizes the upgrading and requires the testing of whether the interface of the upgraded service system is still normal or not on the same day, the testing case which is set up by the 2021.5.1 day borrowing and 2021.5.2 can be used for testing whether the function of the interface of the upgraded service system which is set up by the next day of borrowing is normal or not.
According to the data form of the test case, all record information of the test case in the service database before the interface test, namely the fourth data record, can be obtained, and at this time, the information recorded in the effective data table recording the repayment record about the test case may be the record of the test case in the arrears 0 element of 2021.5.2 days. Obviously, if the data record of the test case before the data record in the service database is subjected to the flow record is not restored at this time, but the interface test is directly performed, the loan service system sends error reporting information to the test case, so that the user is prompted that the repayment is not required, and the interface test result is invalid for the interface test. Therefore, before testing the interface of the service system after upgrading, it is also necessary to restore all record information of the test case in the service database to the database record before recording the flow, that is, add, delete and modify the fourth data record based on the first data record, which may specifically include the following contents:
1. Deleting more data records than the first data records in the fourth data records;
2. adding the missing data record in the fourth data record compared with the first data record in the fourth data record;
3. the data record in the fourth data record for which there is a change from the first data record is restored to its information in the first data record in the fourth data record.
After the service database is restored according to the fourth data record and the first data record, the field value of the date field is also required to be converted into a new date for the date field in the service database. For example, in the effective data table for recording the test case payment records, for the date records of the test case payment on 2021.5.1 days and the date of the 2021.5.2 days for payment, when the interface test is based on 2021.5.19 days, the interface test point is the next day of payment, and the date of payment at the interface test is updated to 2021.5.18 days based on the relative relationship of the date of 0T+1 days. The date 2021.5.19 of the interface test in the application is the playback time.
In one implementation of the step 105, the determining, according to the first test result and the second test result, an interface test result of upgrading the first service system to the second service system includes: acquiring each check field of the test case; each check field is determined according to a plurality of test results of the test case; determining, for any check field, a relationship of a first value of the check field in the first test result to a second value in the second test result; and determining an interface test result of the first service system upgraded to the second service system according to the relation between the first test result and the second test result of each check field.
For example, when the test point is the next day of borrowing, and specifically 1000 yuan of borrowing on 2021.5.1 days and 1000 yuan of repayment on 2021.5.2 days, when the flow is recorded, interface calling type names and method names to be recorded, external calling method types and database request method types can be configured based on an AOP technology. When the test case calls the interface, the request return message called by the external interface, the parameters and the return value of the database operation are recorded, and then stored in sequence and deposited as a flow. The following steps are specifically mentioned:
Step 1: and configuring interface calling method classes to be monitored, namely, function methods for processing request messages, and method classes for external requests and database calling.
Step 2: after the request arrives at the method class, it is executed by the AOP agent mounted above the subsystem process:
step 21: recording a request message and a return message;
step 22: recording database call and return in the current thread processing process, and calling request and return by an external interface;
step 23: serialization, the asynchronous in-stock is a flow and is noted as flow 1.
Step 3: and backing up the service database according to the data form of the test case to obtain a backup file A.
It is noted that, here, the flow 1 and the backup file a are the first test result.
When the test points which are arranged on 2021.5.19 days to upgrade the loan service system of the bank and require the test of the day-by-day clearing of borrowing on the same day are arranged, the test cases of 1000 yuan for 2021.5.1 day borrowing and 1000 yuan for 2021.5.2 day repayment can be reused. Before the interface test is performed, the data record of the test case in the service database of 2021.5.19 days needs to be restored to the data record of 2021.5.2 days when the interface test is performed, and meanwhile, the borrowing date needs to be updated to 2021.5.18 days. At this time:
Step 1: and reading a request message when the flow 1 is recorded, processing the request message of the INVOKE in the Java bean of the interface in the process JVM through the AOP agent, recording a return message, and storing the return message in a warehouse after serialization as the flow 2.
Step 2: and backing up the service database according to the data form of the test case to obtain a backup file B.
Here, the flow 2 and the backup file B are the second test result.
After the second test result is obtained, whether the loan service system of the bank influences the normal operation of the interface in the upgrading process can be determined by comparing the second test result with the first test result and according to the result obtained after comparison.
In some implementations of the present application, the check fields are determined according to a plurality of test results for the test case, including: recording a third test result and a fourth test result of the test case after the test case operates in the first service system; and for any field in the test results, if the third value of the field in the third test result is the same as the fourth value in the fourth test result, determining the field as a check field.
After testing the interface of the service system by using the test case, initiating multiple requests to the same service system based on the request message recorded during testing, for example, initiating two requests, so that a check field can be determined based on the test results returned by the two requests; for the same request message, the fields returned by the service system for two times should be the same, but the values of some fields change along with the sequence of the requests, which means that the fields with the changed time and values along with the requests cannot become the detection standard for judging whether the interface is abnormal in the upgrading process of the service system, but instead, the fields with the unchanged values in the two requests can be used as the detection standard for judging whether the interface is abnormal in the upgrading process of the service system. Based on the detection standard, the detection standard for judging whether the interface is abnormal or not in the upgrading process of the service system can be automatically determined by initiating the request message when the flow recording is carried out to the service system for a plurality of times.
In some implementations of the present application, before determining that the field is a check field, further includes: determining that the return code of the first message in the third test result is the same as the return code of the second message in the fourth test result; and determining, for any field in the test results, that the field is a check field if the third value of the field in the third test result is the same as the fourth value in the fourth test result, including: for any message field in the test result, if the field value of the message field in the first message is the same as the field value in the second message, the message field is used as a check field; and aiming at any table field in the test results, if the field value of the table field in the first table record corresponding to the third test result is the same as the field value in the second table record corresponding to the fourth test result, taking the table field as a check field.
When the request message during flow recording is sent to the service system for automatically determining each check field for multiple times (such as twice), the return code of the message in the two test results is identical to the return code of the message in the two test results, so that the problem that the return code is inconsistent after each table field is determined, and each field for verification cannot be finally obtained is avoided.
How the check fields are automatically generated is described below by a specific example:
step 1: and playing back the flow 1 on the loan service system when the flow is recorded twice, and respectively recording a return message and a database record after playing back when the flow is played back twice.
Step 2: and analyzing the flow database SQL to obtain a database table and a field list related to the test case.
For example, for an SQL: SELECT FIELD1 the FIELD2 FROM db1.Tab 1 WHERE FIELD3 =', the database FROM which the test case association can be resolved is DB1, TABLE1, and the FIELDs include FIELD1, FIELD2, FIELD3.
Step 3: comparing the returned messages during the two times of flow playback, firstly checking whether the returned codes of the service system in the two times of returned messages are consistent, and if not, prompting manual intervention; if the values are consistent, the same field is set as a check field, and the different field is set as a noise field.
Step 4: and (2) under the condition that the return codes of the returned messages of the two times are consistent, taking out database records stored after the two times of playback, comparing the library table and the fields related to the test case obtained in the step (2), setting the fields with the same value as check fields, and setting different fields as noise fields.
Step 5: and (3) integrating the results of the step (3) and the step (4) to obtain a check field of the test case during interface test.
Based on the same concept, the embodiment of the present application provides an interface testing device, as shown in fig. 2, which includes a data record determining unit 201, a record playback unit 202, a service database restoring unit 203, and an interface test result output unit 204:
a data record determining unit 201, configured to determine a first data record associated with a test case in a pre-recording service database; the date data in the first data record is a date relative relation with a field value of a set date field as a reference;
a recording and playback unit 202, configured to record a first test result of the test case after the test case runs in a first service system corresponding to the service database;
a service database restoring unit 203, configured to restore the service database through the first data record before playing back the test case; date data of a second data record corresponding to the first data record in the service database is obtained according to the date relative relation and the playback time;
the recording and playback unit 202 is further configured to play back the test case, and record a second test result of the test case after running in a second service system corresponding to the service database;
And the interface test result output unit 204 is configured to determine an interface test result of the first service system upgraded to the second service system according to the first test result and the second test result.
Further, for the apparatus, the data record determining unit 201 is specifically configured to: determining the data form of the test case; the data form is table information of each data table with at least one keyword of the test case in the service database, and the data form also comprises indication information for indicating a date field; determining a third data record associated with the test case in the service database before recording and each date field in the third data record according to the data form; and regarding any non-set date field in the third data record, taking the relation between the field value of the set date field and the field value of the non-set date field in the third data record as the date data in the non-set date field, thereby obtaining the first data record.
Further, for the device, the service database restoring unit 203 is specifically configured to: determining a fourth data record associated with the test case in the service database before playback according to the data form; restoring the service database according to the first data record and the fourth data record; and determining date data of the date field in the second data record according to the date relative relation and playback time of the date field in the first data record aiming at any date field in the second data record corresponding to the first data record in the restored service database.
Further, for the device, the interface test result output unit 204 is specifically configured to: acquiring each check field of the test case; each check field is determined according to a plurality of test results of the test case; determining, for any check field, a relationship of a first value of the check field in the first test result to a second value in the second test result; and determining an interface test result of the first service system upgraded to the second service system according to the relation between the first test result and the second test result of each check field.
Further, for the apparatus, a check field determining unit 205 is further included; a check field determining unit 205, configured to: recording a third test result and a fourth test result of the test case after the test case operates in the first service system; and for any field in the test results, if the third value of the field in the third test result is the same as the fourth value in the fourth test result, determining the field as a check field.
Further, for the apparatus, the check field determining unit 205 is further configured to: determining that the return code of the first message in the third test result is the same as the return code of the second message in the fourth test result; the check field determining unit is specifically configured to: for any message field in the test result, if the field value of the message field in the first message is the same as the field value in the second message, the message field is used as a check field; and aiming at any table field in the test results, if the field value of the table field in the first table record corresponding to the third test result is the same as the field value in the second table record corresponding to the fourth test result, taking the table field as a check field.
Further, for the apparatus, the data morphology determining unit 206 is further included for the apparatus; a data morphology determining unit 206 for: inquiring the service database according to the first keyword in the test case to obtain the second keyword of the test case; inquiring each data table with the first key word or the second key word from the service database; denoising each data table with the first key word or the second key word to obtain each effective data table; if the table structure of each effective data table comprises a date field, setting indication information for the date field; and taking the table information of each effective data table and the indication information of each date field as the data form of the test case.
Embodiments of the present application also provide a computing device, which may be specifically a desktop computer, a portable computer, a smart phone, a tablet computer, a personal digital assistant (Personal Digital Assistant, PDA), and the like. The computing device may include a central processing unit (Center 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 (Liquid Crystal Display, LCD), cathode Ray Tube (CRT), etc.
Memory, which may include Read Only Memory (ROM) and Random Access Memory (RAM), provides program instructions and data stored in the memory to the processor. In the embodiment of the application, the memory may be used to store program instructions of the interface test method;
and the processor is used for calling the program instructions stored in the memory and executing an interface test method according to the obtained program.
As shown in fig. 3, a schematic diagram of a computing device according to an embodiment of the present application is provided, where the computing device includes:
a processor 301, a memory 302, a transceiver 303, and 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 the program in the memory 302, and execute the interface test method described above;
the processor 301 may be a central processing unit (central processing unit, CPU for short), a network processor (network processor, NP for short) or a combination of CPU and NP. But also a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (programmable logic device, PLD), or a combination thereof. The PLD may be a complex programmable logic device (complex programmable logic device, CPLD for short), a field-programmable gate array (field-programmable gate array, FPGA for short), general-purpose array logic (generic array logic, GAL for short), or any combination thereof.
The memory 302 is configured to store 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 volatile memory (RAM), such as random-access memory (RAM); the memory 302 may also include a nonvolatile memory (non-volatile memory), such as a flash memory (flash memory), a Hard Disk Drive (HDD) or a Solid State Drive (SSD); memory 302 may also include a combination of the types of memory described above.
Memory 302 stores the following elements, executable modules or data structures, or a subset thereof, or an extended set thereof:
operation instructions: including various operational instructions for carrying out various operations.
Operating system: including various system programs for implementing various basic services and handling hardware-based tasks.
Bus 305 may be a peripheral component interconnect standard (peripheral component interconnect, PCI) bus, or an extended industry standard architecture (extended industry standard architecture, EISA) bus, among others. The buses may be divided into address buses, data buses, control buses, etc. For ease of illustration, only one thick line is shown in fig. 3, but not only one bus or one type of bus.
Bus interface 304 may be a wired communication interface, 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 an interface test method.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, or a 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 flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations 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 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. It is therefore intended that the following claims be interpreted as including the preferred embodiments and all such alterations and modifications as fall within the scope of the application.
It will be apparent to those skilled in the art that various modifications and variations can be made in the present application without departing from the spirit or scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims and the equivalents thereof, the present application is intended to cover such modifications and variations.

Claims (10)

1. An interface testing method, comprising:
determining a first data record associated with a test case in a pre-recording service database; the date data in the first data record is a date relative relation with a field value of a set date field as a reference;
recording a first test result of the test case after running in a first service system corresponding to the service database;
before the test case is played back, restoring the service database through the first data record; date data of a second data record corresponding to the first data record in the service database is obtained according to the date relative relation and the playback time;
playing back the test case, and recording a second test result of the test case after running in a second service system corresponding to the service database;
And determining an interface test result of the first service system to be upgraded to the second service system according to the first test result and the second test result.
2. The method of claim 1, wherein,
the determining the first data record associated with the test case in the pre-recording service database comprises the following steps:
determining the data form of the test case; the data form is table information of each data table with at least one keyword of the test case in the service database, and the data form also comprises indication information for indicating a date field;
determining a third data record associated with the test case in the service database before recording and each date field in the third data record according to the data form;
and regarding any non-set date field in the third data record, taking the relation between the field value of the set date field and the field value of the non-set date field in the third data record as the date data in the non-set date field, thereby obtaining the first data record.
3. The method of claim 2, wherein,
The restoring the service database through the first data record includes:
determining a fourth data record associated with the test case in the service database before playback according to the data form;
restoring the service database according to the first data record and the fourth data record;
and determining date data of the date field in the second data record according to the date relative relation and playback time of the date field in the first data record aiming at any date field in the second data record corresponding to the first data record in the restored service database.
4. The method of claim 1, wherein,
and determining an interface test result of the first service system to be upgraded to the second service system according to the first test result and the second test result, wherein the interface test result comprises:
acquiring each check field of the test case; each check field is determined according to a plurality of test results of the test case;
determining, for any check field, a relationship of a first value of the check field in the first test result to a second value in the second test result;
And determining an interface test result of the first service system upgraded to the second service system according to the relation between the first test result and the second test result of each check field.
5. The method of claim 4, wherein,
each check field is determined according to a plurality of test results of the test case, and comprises the following steps:
recording a third test result and a fourth test result of the test case after the test case operates in the first service system;
and for any field in the test results, if the third value of the field in the third test result is the same as the fourth value in the fourth test result, determining the field as a check field.
6. The method of claim 5, wherein,
before determining that the field is a check field, the method further includes:
determining that the return code of the first message in the third test result is the same as the return code of the second message in the fourth test result;
and determining, for any field in the test results, that the field is a check field if the third value of the field in the third test result is the same as the fourth value in the fourth test result, including:
For any message field in the test result, if the field value of the message field in the first message is the same as the field value in the second message, the message field is used as a check field;
and aiming at any table field in the test results, if the field value of the table field in the first table record corresponding to the third test result is the same as the field value in the second table record corresponding to the fourth test result, taking the table field as a check field.
7. The method of any one of claim 2 to 5,
the determining the data form of the test case comprises the following steps:
inquiring the service database according to the first keyword in the test case to obtain the second keyword of the test case;
inquiring each data table with the first key word or the second key word from the service database;
denoising each data table with the first key word or the second key word to obtain each effective data table;
if the table structure of each effective data table comprises a date field, setting indication information for the date field;
and taking the table information of each effective data table and the indication information of each date field as the data form of the test case.
8. An interface testing apparatus, comprising:
the data record determining unit is used for determining a first data record associated with the test case in the pre-recording service database; the date data in the first data record is a date relative relation with a field value of a set date field as a reference;
the recording and playback unit is used for recording a first test result of the test case after running in a first service system corresponding to the service database;
the service database restoring unit is used for restoring the service database through the first data record before playing back the test case; date data of a second data record corresponding to the first data record in the service database is obtained according to the date relative relation and the playback time;
the recording and playback unit is further configured to play back the test case, and record a second test result of the test case after the test case is operated in a second service system corresponding to the service database;
and the interface test result output unit is used for determining the interface test result of the first service system upgraded to the second service system according to the first test result and the second test result.
9. A computer device, comprising:
a memory for storing a computer program;
a processor for invoking a computer program stored in said memory, performing the method according to any of claims 1-7 in accordance with the obtained program.
10. A computer-readable storage medium storing computer-executable instructions for causing a computer to perform the method of any one of claims 1-7.
CN202110579668.6A 2021-05-26 2021-05-26 Interface testing method and device Active CN113312259B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110579668.6A CN113312259B (en) 2021-05-26 2021-05-26 Interface testing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110579668.6A CN113312259B (en) 2021-05-26 2021-05-26 Interface testing method and device

Publications (2)

Publication Number Publication Date
CN113312259A CN113312259A (en) 2021-08-27
CN113312259B true CN113312259B (en) 2023-12-29

Family

ID=77375166

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110579668.6A Active CN113312259B (en) 2021-05-26 2021-05-26 Interface testing method and device

Country Status (1)

Country Link
CN (1) CN113312259B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113742250B (en) * 2021-11-05 2022-03-29 广州易方信息科技股份有限公司 Automatic interface testing method and device
CN116028376B (en) * 2023-03-27 2023-08-29 云筑信息科技(成都)有限公司 Method for rapidly generating interface automation use cases based on flow recording

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5809500A (en) * 1997-02-26 1998-09-15 Century Technology Services, Inc. System for converting programs and databases to correct year 2000 processing errors
CN101135989A (en) * 2006-08-31 2008-03-05 中国银联股份有限公司 Automatization test method and device for Web applied system
KR20150048365A (en) * 2013-10-28 2015-05-07 에스케이플래닛 주식회사 System and method for verifying application
CN111767227A (en) * 2020-06-30 2020-10-13 深圳前海微众银行股份有限公司 Recording playback test method and device
CN112559361A (en) * 2020-12-22 2021-03-26 京东数字科技控股股份有限公司 Flow playback method, device, equipment and computer readable medium
CN112650688A (en) * 2020-12-30 2021-04-13 深圳前海微众银行股份有限公司 Automated regression testing method, associated device and computer program product
WO2021088724A1 (en) * 2019-11-05 2021-05-14 深圳前海微众银行股份有限公司 Testing method and apparatus

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050273452A1 (en) * 2004-06-04 2005-12-08 Microsoft Corporation Matching database records

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5809500A (en) * 1997-02-26 1998-09-15 Century Technology Services, Inc. System for converting programs and databases to correct year 2000 processing errors
CN101135989A (en) * 2006-08-31 2008-03-05 中国银联股份有限公司 Automatization test method and device for Web applied system
KR20150048365A (en) * 2013-10-28 2015-05-07 에스케이플래닛 주식회사 System and method for verifying application
WO2021088724A1 (en) * 2019-11-05 2021-05-14 深圳前海微众银行股份有限公司 Testing method and apparatus
CN111767227A (en) * 2020-06-30 2020-10-13 深圳前海微众银行股份有限公司 Recording playback test method and device
CN112559361A (en) * 2020-12-22 2021-03-26 京东数字科技控股股份有限公司 Flow playback method, device, equipment and computer readable medium
CN112650688A (en) * 2020-12-30 2021-04-13 深圳前海微众银行股份有限公司 Automated regression testing method, associated device and computer program product

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
基于交易日志的自动化测试技术在功能测试中的应用;冯瑶;孙骏亚;刘跃光;王智忠;;中国金融电脑(11);全文 *
金融系统生产模拟比对自动化测试研究与应用;阳骁尧;王步锋;张同虎;成银乾;李冬晓;刘正;郭晓骞;;中国金融电脑(05);全文 *

Also Published As

Publication number Publication date
CN113312259A (en) 2021-08-27

Similar Documents

Publication Publication Date Title
US7962386B2 (en) Enterprise service architecture platform architecture for multi-application computer system
CN111260465B (en) Service processing method, device, server and storage medium
CN109598407B (en) Method and device for executing business process
CN113312259B (en) Interface testing method and device
CN107230092B (en) Accounting processing method and device and server
CN111506580B (en) Transaction storage method based on centralized block chain type account book
CN110033362B (en) Money drawing method, device and equipment
CN112416725A (en) Pressure testing method and device
CN113220598B (en) System test method, device, equipment, medium and program product
CN115062079A (en) Transaction flow processing method, device, equipment and storage medium
CN114490415A (en) Service testing method, computer device, storage medium, and computer program product
CN115437903A (en) Interface test method, device, apparatus, storage medium, and program
CN111625458A (en) Service system testing method, device and equipment
CN105988866B (en) Information processing unit and its control method
CN111369346B (en) User credit evaluation method, device, server and storage medium
CN113342681A (en) Regression testing method and device
CN114493821B (en) Data verification and cancellation method and device, computer equipment and storage medium
CN111429132B (en) Service processing method and device
US11513862B2 (en) System and method for state management of devices
CN116894601A (en) Index processing method, device, equipment and storage medium
CN117291741A (en) Account data processing method, device, equipment, storage medium and program product
CN118152384A (en) Data auditing method, device, electronic equipment, storage medium and program product
CN116881167A (en) Test case generation method and related device
CN114579462A (en) Method and device for determining test case execution information and computer equipment
CN117350872A (en) Data reconciliation method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant