CN113176995B - Interface testing method, device, equipment and medium based on testing scene - Google Patents

Interface testing method, device, equipment and medium based on testing scene Download PDF

Info

Publication number
CN113176995B
CN113176995B CN202110466037.3A CN202110466037A CN113176995B CN 113176995 B CN113176995 B CN 113176995B CN 202110466037 A CN202110466037 A CN 202110466037A CN 113176995 B CN113176995 B CN 113176995B
Authority
CN
China
Prior art keywords
test
data
scene
initialization
action
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
CN202110466037.3A
Other languages
Chinese (zh)
Other versions
CN113176995A (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.)
Ping An Bank Co Ltd
Original Assignee
Ping An Bank 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 Ping An Bank Co Ltd filed Critical Ping An Bank Co Ltd
Priority to CN202110466037.3A priority Critical patent/CN113176995B/en
Publication of CN113176995A publication Critical patent/CN113176995A/en
Application granted granted Critical
Publication of CN113176995B publication Critical patent/CN113176995B/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/3688Test management for test execution, e.g. scheduling of test suites
    • 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

Abstract

The invention relates to the technical field of automatic test tools, and discloses an interface test method, device, equipment and medium based on a test scene, wherein the method comprises the following steps: the method comprises the steps of acquiring a test action list and initialization configuration data from a scene library through free assembly of a test scene and a test scene strategy, automatically setting up required initialization data, generating a final action list through action deduplication, interface aggregation and sequencing, automatically assembling a test case execution list, acquiring a return result after execution, checking through transparent verification to obtain a final verification result, and automatically displaying through a log display mode. The invention realizes that the interface test can be carried out by automatically generating the test case execution list and displaying the result only by assembling the test scene and the test scene strategy, thereby achieving the purpose of conveniently and reasonably automatically carrying out the interface test and improving the accuracy and quality of the interface test.

Description

Interface testing method, device, equipment and medium based on testing scene
Technical Field
The present invention relates to the field of automated test tools, and in particular, to a test scenario-based interface test method, apparatus, device, and medium.
Background
With the rapid development of computer technology, the system is more and more complex, the requirements cannot be met by means of the traditional front-end test, and in order to meet the requirements of early intervention test, interface tests are generated. The interface test refers to writing test cases of various test scenes according to a test document, and testing the performance of the interface under each test scene by using the written test cases. In the prior art, as the complexity of the system is higher and higher, the interfaces are more and more, the difficulty of writing test cases of reasonable test strategies is great, and the test of any interface in the actual process is required to be performed by setting up a test environment for the test scene of each interface, creating initialization data, writing the test cases and other manual inputs, and the professional is required to consume a long time to complete, so that the process has the defects of high workload, low efficiency and high operation and maintenance cost.
Disclosure of Invention
The invention provides an interface testing method, device, computer equipment and storage medium based on a testing scene, which realize more convenient and reasonable automatic interface testing, reduce the technical threshold of testers, improve the testing efficiency, reduce the labor cost, avoid the omission of testers and improve the accuracy and quality of interface testing.
An interface testing method based on a testing scene comprises the following steps:
receiving an interface test request, and acquiring a test case serial number, a test scene set and a test scene strategy in the interface test request; the test scene set comprises a plurality of test scenes;
acquiring a test action list and initialization configuration data associated with each test scene from a scene library;
constructing initialization data according to all the initialization configuration data and the test scene policies;
performing action deduplication and interface aggregation and sequencing on all the test action lists to obtain a final action list corresponding to the test case serial number;
according to the initialization data and the final action list, a test case execution list is assembled, and the test case execution list is executed to obtain a return result;
and carrying out transparent verification on the returned result to obtain a final verification result, and displaying the final verification result in a log display mode to complete the interface test request.
An interface testing device based on a testing scene, comprising:
the receiving module is used for receiving an interface test request and acquiring a test case serial number, a test scene set and a test scene strategy in the interface test request; the test scene set comprises a plurality of test scenes;
The acquisition module is used for acquiring a test action list and initialization configuration data associated with each test scene from the scene library;
the building module is used for building initialization data according to all the initialization configuration data and the test scene policies;
the sequencing module is used for performing action deduplication and interface aggregation and sequencing on all the test action lists to obtain a final action list corresponding to the test case serial number;
the assembly module is used for assembling a test case execution list according to the initialization data and the final action list, executing the test case execution list and obtaining a return result;
and the verification module is used for carrying out transparent verification on the returned result to obtain a final verification result, and displaying the final verification result in a log display mode to complete the interface test request.
A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the steps of the test scenario-based interface test method described above when the computer program is executed.
A computer readable storage medium storing a computer program which, when executed by a processor, implements the steps of the test scenario-based interface test method described above.
According to the interface testing method, the device, the computer equipment and the storage medium based on the testing scene, the serial numbers of the testing cases, the testing scene set and the testing scene strategies in the interface testing request are obtained; acquiring a test action list and initialization configuration data associated with each test scene from a scene library; constructing initialization data according to all the initialization configuration data and the test scene policies; performing action deduplication and interface aggregation and sequencing on all the test action lists to obtain a final action list; according to the initialization data and the final action list, a test case execution list is assembled, and the test case execution list is executed to obtain a return result; the method comprises the steps of carrying out transparent verification on a returned result to obtain a final verification result, and displaying the final verification result through a log display mode, so that the purposes of acquiring a test action list and initialization configuration data from a scene library through free assembly and a test scene strategy, automatically setting up required initialization data, generating a final action list through action deduplication, interface aggregation and sequencing, automatically assembling the final action list into a test case execution list, obtaining the executed returned result, carrying out verification through the transparent verification to obtain the final verification result, and automatically displaying the final verification result through the log display mode to provide a test result for a tester for the test at the time, automatically generating the test case execution list to carry out interface test without manually writing the test case, and displaying the result through a display mode combining a history log.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed in the description of the embodiments of the present invention will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present invention, 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 schematic view of an application environment of an interface testing method based on a testing scenario according to an embodiment of the present invention;
FIG. 2 is a flow chart of a test scenario-based interface test method in an embodiment of the invention;
FIG. 3 is a flowchart of step S30 of a test scenario-based interface testing method according to an embodiment of the present invention;
FIG. 4 is a flowchart of step S50 of a test scenario-based interface testing method according to an embodiment of the present invention;
FIG. 5 is a flowchart of step S60 of a test scenario-based interface testing method according to an embodiment of the present invention;
FIG. 6 is a schematic block diagram of a conversion module of an interface test apparatus based on a test scenario in an embodiment of the present invention;
FIG. 7 is a schematic diagram of a computer device in accordance with an embodiment of the invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The interface testing method based on the testing scene provided by the invention can be applied to an application environment as shown in fig. 1, wherein a client (computer equipment) communicates with a server through a network. Among them, clients (computer devices) include, but are not limited to, personal computers, notebook computers, smartphones, tablet computers, cameras, and portable wearable devices. The server may be implemented as a stand-alone server or as a server cluster composed of a plurality of servers.
In an embodiment, as shown in fig. 2, an interface testing method based on a testing scenario is provided, and the technical scheme mainly includes the following steps S10-S60:
s10, receiving an interface test request, and acquiring a test case serial number, a test scene set and a test scene strategy in the interface test request; the set of test scenarios includes a plurality of test scenarios.
Understandably, the interface test request is a request to be generated by an interface to be tested, the test case serial number is a unique identification number matched with the test scene set according to the test scene set related to the test case, the test scene set is a set of test scenes related to the test case to be tested, that is, one test case serial number corresponds to one test scene set, and the test scene is a scene for designing the interface to be tested according to a scene template, for example: the method comprises the steps of ATM withdrawal, inserting a bank card, inputting a password, inputting withdrawal amount, withdrawing withdrawal, taking a card and other scenes, designing the test scene according to a scene template, wherein one test scene set comprises a plurality of test scenes, the scene template is a preset template, the test scene strategy is a strategy for testing interface tests, and the test scene strategy comprises a Bayesian strategy, a random strategy, a Cartesian full coverage strategy and a historical genetic strategy.
S20, acquiring a test action list and initialization configuration data associated with each test scene from a field Jing Ku.
It is to be understood that the scenario library stores all the scenarios and manages all the scenarios, the test scenario in the scenario library and one test action list and one initialization configuration data, the test action list is a predesigned test action set of the test scenario, the initialization configuration data is configuration data related to initialization data required by the predesigned test scenario, that is, data of a test scenario, a test structure and various data forms required to test the test scenario, and may also be obtained by extracting historical initialization configuration data related to the scenario, the initialization configuration data includes the test environment identifier, the test structure type and a test data form set, the test environment identifier is a unique identifier for establishing a test environment, for example, the test environment identifier includes a DB environment (database environment), an MQ environment (message queue environment), a redisi.e., the test structure type is a type of a format for constructing a test structure, the test structure is a file of a test case in a test process, for example, the test structure type includes a type of a js structure, a type of a XML (js) and the like, and the test structure type can be different from the data form set which the test scenario can be different from the data form set.
S30, constructing initialization data according to all the initialization configuration data and the test scene policies.
The process of constructing includes obtaining a test environment package matching with the test environment identifier in each initialization configuration data, installing the test environment package, and in a test environment corresponding to the test environment package, extracting a to-be-tested data form set corresponding to the test scene policy from the test data form set in each initialization configuration data according to the test scene policy, automatically constructing each test form data according to each test structure type and the to-be-tested data form set corresponding to each test structure type, generating all the test form data, and constructing the initialization data, wherein the initialization data is data to be prepared for testing each test scene.
In an embodiment, as shown in fig. 3, in the step S30, that is, the building initialization data according to all the initialization configuration data and the test scene policies includes:
s301, acquiring a test environment package matched with a test environment identifier in each initialization configuration data through a test construction center, and installing the acquired test environment package; the initialization configuration data includes the test environment identification, a test structure type, and a test data morphology set.
Understandably, the test construction center stores the test environment packages with all the test environment identifiers matched, one test environment identifier corresponds to one test environment package, and the matching process is a process of finding the test environment package corresponding to the test environment identifier.
The initialization configuration data comprises the test environment identifier, a test structure type and a test data form set, wherein the test environment identifier is a unique identifier for establishing a test environment, the test structure type is a type for establishing a format of a test structure, the test structure is a file format of a test case in a test process, for example, the test structure type comprises an XML type, a JSON type and a DB type, and the test data form set is a set of data of different forms which possibly appear and are designed according to a test scene.
S302, according to the test scene strategy, extracting a data form set to be tested corresponding to the test data form set from the test data form set in each initialization configuration data.
The test scene policy includes a bayesian policy, a random policy, a cartesian full coverage policy and a historical genetic policy, when the test scene policy is a bayesian policy, according to a bayesian algorithm, the bayesian algorithm is a classification algorithm of statistics, which is an algorithm for classifying by using probability statistical knowledge, various highest probability data forms are extracted from each test data form set, and are determined as the data form set to be tested; when the test scene strategy is a random strategy, according to a random algorithm, the random algorithm is that a pseudorandom number sequence is generated by matching a srand function and the rand function in a mode of generating random numbers, the random function uses the current time as a seed for generating the pseudorandom number sequence before generating the random numbers, the rand generates a series of random numbers according to the value of the seed, and the data form set to be tested is extracted from each test data form set according to the generated series of random numbers; when the testing scene strategy is a Cartesian full coverage strategy, the Cartesian full coverage strategy is a strategy for testing in a full-scale testing mode, and each testing data form set is determined to be the corresponding data form set to be tested; when the test scene strategy is a historical genetic strategy, a historical failure data form library and a historical test data form set which are matched with the test case serial number are obtained, and the data form set to be tested which is the same as the historical failure data form library or the historical test data form set is extracted from each test data form set.
In an embodiment, in step S302, the extracting, according to the test scenario policy, the set of data forms to be tested corresponding to the set of data forms to be tested from the set of test data forms in each piece of initialization configuration data includes:
s3021, when the testing scene strategy is a Bayesian strategy, extracting the data form set to be tested corresponding to each testing data form set according to a Bayesian algorithm.
Understandably, when the test scene policy is a bayesian policy, according to a bayesian algorithm, the bayesian algorithm is a classification algorithm of statistics, which is an algorithm for classifying by using probability statistics knowledge, various data forms with highest probability are extracted from each test data form set, and are determined as the data form set to be tested.
S3022, when the test scene policy is a random policy, extracting the data form set to be tested corresponding to each test data form set according to a random algorithm.
It can be understood that when the test scene policy is a random policy, according to a random algorithm, the random algorithm is to generate a pseudo-random number sequence by using a srand function and a rand function in a mode of generating random numbers, the rand function uses the current time as a seed for generating the pseudo-random number sequence before generating the random numbers, the rand generates a series of random numbers according to the value of the seed, and the set of data forms to be tested is extracted from each set of test data forms according to the generated series of random numbers.
And S3023, when the testing scene strategy is a Cartesian full coverage strategy, determining each testing data form set as the corresponding data form set to be tested.
Understandably, when the test scenario policy is a cartesian full coverage policy, the cartesian full coverage policy is a policy of testing by a full-scale test mode, and each test data morphology set is determined as the data morphology set to be tested corresponding to the test scenario policy.
According to the invention, when the test scene strategy is a Bayesian strategy, the data form set to be tested corresponding to each test data form set is extracted from each test data form set according to a Bayesian algorithm; when the test scene strategy is a random strategy, extracting the data form set to be tested corresponding to the test data form set from each test data form set according to a random algorithm; when the test scene strategy is a Cartesian full coverage strategy, each test data form set is determined to be the corresponding data form set to be tested, so that the data form set to be tested conforming to the test scene strategy is extracted from the test data form set through different test scene strategies automatically matching corresponding algorithms, and the data form set to be tested can be scientifically extracted for subsequent test case generation.
In an embodiment, in step S302, the extracting, according to the test scenario policy, the set of data forms to be tested corresponding to the set of data forms to be tested from the set of test data forms in each piece of initialization configuration data further includes:
s3024, when the test scene strategy is a historical genetic strategy, acquiring a historical failure data form base and a historical test data form set which are matched with the test case serial number.
The historical failure data morphology library is understandably a set of data morphologies in which test failures occur historically, and the historical test data morphology set is a test data morphology set used in a latest historical iterative test matched with the test case serial number.
S3025, extracting the data form set to be tested, which is the same as the historical failure data form library or the historical test data form set, from each of the test data form sets.
Understandably, the same data morphology as the data morphology in the historical failure data morphology library or the data morphology in the historical test data morphology set is extracted from each of the test data morphology sets, and is determined as the data morphology set to be tested.
The method and the device realize that when the test scene strategy is a historical genetic strategy, a historical failure data form base and a historical test data form set which are matched with the test case serial number are obtained; the data form set to be tested, which is the same as the historical failure data form library or the historical test data form set, is extracted from each of the test data form sets, so that the data form which is easy to fail and verify is extracted by combining the data of failure under the historical inheritance and the data which is used last time, the labor cost is reduced, and the data form set to be tested is extracted more scientifically.
S303, according to the test structure type in each initialization configuration data and the data form set to be tested corresponding to the test structure type, constructing test form data corresponding to each initialization configuration data.
The test structure is a file format of a test case in a test process, for example, a test structure type comprises an XML type, a JSON type, a DB type and the like, the test data form set is a set of data in different forms which may occur and are designed according to a test scene, and according to the test structure type, a form template is applied to a data form in the data form set to be tested to generate the test form data conforming to the test structure type.
S304, initializing all the test form data and constructing the initialization data.
The invention realizes that a test environment package matched with the test environment identifier in each initialization configuration data is obtained through a test construction center, and the obtained test environment package is installed; extracting a data form set to be tested corresponding to the test data form set from the test data form set in each initialization configuration data according to the test scene strategy; constructing test form data corresponding to each initialization configuration data according to the test structure type in each initialization configuration data and the corresponding data form set to be tested; all the test form data are initialized, and the initialization data are built, so that the test environment package is obtained through a test building center, the test environment package is automatically installed, the form set of the data to be tested is automatically extracted according to a test scene strategy, and the form set of the data to be tested is built into the test form data according to the test structure type, so that the initialization is performed to build the initialization data, the initialization data can be automatically built, the cost of manual building is reduced, the test efficiency is improved, and the success rate of building is improved.
And S40, performing action deduplication and interface aggregation and sequencing on all the test action lists to obtain a final action list corresponding to the test case serial number.
It can be understood that the test action lists of the test scenes are repeated, because the test scenes test various related interfaces, the action deduplication is to remove the same actions in all the test action lists, the interfaces are aggregated and ordered to aggregate actions of the same interfaces together, and the final action lists corresponding to the test case serial numbers one by one are ordered according to the sequence among the interfaces.
S50, according to the initialization data and the final action list, assembling a test case execution list, and executing the test case execution list to obtain a return result.
The assembling process may be a process of obtaining a report Wen Moban corresponding to an action in the final action list from a template library, tracing effective data corresponding to the action in the final action list from the initialization data, automatically filling the effective data into the message template corresponding to the action to obtain a test case execution table corresponding to the action, assembling all the test case execution tables corresponding to the action to generate the test case execution list, executing the test case execution list, and returning a result of executing the test case execution list by each interface, wherein the returned result is a result of executing the test case execution list by each related interface, and the test case execution list includes a plurality of test case execution tables.
The template library is a test case template for managing all the message templates, the message templates are test design for each scene or each interface, the message templates comprise interface interaction modes, the retrospective processing process is to find the test scene associated with the action in the final action list, find the initialization configuration data associated with the test scene according to the found test scene, and retrospectively determine the retrospective data as the effective data according to the data of the initialization data built by the initialization configuration data.
In one embodiment, as shown in fig. 4, in the step S50, the assembling a test case execution list according to the initialization data and the final action list includes:
s501, obtaining a message template corresponding to the action in the final action list from a template library.
Understandably, the template library is used for managing all the message templates, the message templates are test case templates for performing test design on each scene or each interface, the message templates comprise interface interaction modes, and all the message templates are stored in the template library.
S502, tracing effective data corresponding to the action in the final action list from the initialization data.
Understandably, the retrospective processing is to find the test scenario associated with the action in the final action list, find the initialization configuration data associated with the found test scenario according to the found test scenario, and finally retrospectively trace the data of the initialization data built by the initialization configuration data, and determine the retrospective data as the valid data.
S503, filling the effective data corresponding to the action into the message template corresponding to the action to obtain a test case execution table corresponding to the action.
Understandably, the valid data is automatically filled into the message template corresponding to the action, and the test case execution table corresponding to the action is obtained.
S504, assembling the test case execution table corresponding to each action to obtain the test case execution list.
Understandably, all the test case execution tables corresponding to the actions are assembled to generate the test case execution list.
The invention realizes the report Wen Moban corresponding to the action in the final action list by acquiring the report from a template library; tracing back valid data corresponding to the action in the final action list from the initialization data; filling the effective data corresponding to the action into the message template corresponding to the action to obtain a test case execution table corresponding to the action; and assembling the test case execution list corresponding to each action to obtain the test case execution list, so that the test case execution list is automatically filled and generated through a message template in a template library, and the test case execution list is automatically assembled, thereby reducing the labor cost and improving the test efficiency.
S60, carrying out transparent verification on the returned result to obtain a final verification result, and displaying the final verification result in a log display mode to complete the interface test request.
The transparent verification includes synchronous verification and asynchronous verification, wherein the synchronous verification process is a verification process of whether the effective data corresponding to the test case execution table and the return data in the return result are consistent or not, so as to obtain a first verification result of the test case execution table, the first verification result is a result obtained through the synchronous verification, the asynchronous verification process is a process of performing database-falling verification on the process data of the intermediate data corresponding to the test case execution table, so as to obtain a second verification result corresponding to the test case execution table, and a third verification result is determined according to the first verification result and the second verification result corresponding to the test case execution table; and summarizing the third verification results corresponding to the test case execution tables to obtain the final verification result.
The log display mode is a mode of graphically displaying the related log information of the history matched with the serial number of the test case, and the final verification result is displayed by using the log display mode, so that the interface test request is completed.
In an embodiment, as shown in fig. 5, in step S60, that is, the performing the transparent verification on the returned result to obtain a final verification result includes:
s601, acquiring the effective data and the intermediate data corresponding to each test case execution table in the test case execution list.
The intermediate data is understandably process data generated by executing the test case execution table.
S602, according to the effective data corresponding to the test case execution table, synchronous verification is carried out on the return data corresponding to the test case execution table in the return results, and a first verification result corresponding to the test case execution table is obtained.
Understandably, the synchronous checking process is a checking process of whether the valid data corresponding to the test case execution table and the returned data in the returned result are consistent, so as to obtain a first checking result of the test case execution table, where the first checking result is a result obtained through the synchronous checking.
S603, performing asynchronous verification on the intermediate data corresponding to the test case execution table to obtain a second verification result corresponding to the test case execution table.
Understandably, the asynchronous checking process is to perform a database-falling check on the process data performed on the intermediate data corresponding to the test case execution table.
S604, determining the third check result corresponding to the test case execution table according to the first check result and the second check result corresponding to the test case execution table.
S605, summarizing the third verification results corresponding to the test case execution tables to obtain the final verification result.
Understandably, all the third verification results are converged together, and whether the test passes or not and the verification pass or not are judged, and the final verification result is generated, wherein the final verification result indicates whether the test result of the interface test request passes or not and whether the test result of the interface test request passes or not.
The invention realizes the realization of the effective data and the intermediate data corresponding to each test case execution table in the test case execution list; the intermediate data is process data generated by executing the test case execution table; according to the effective data corresponding to the test case execution table, synchronous verification is carried out on the returned data corresponding to the test case execution table in the returned results, and a first verification result corresponding to the test case execution table is obtained; asynchronous checking is carried out on the intermediate data corresponding to the test case execution table, and a second checking result corresponding to the test case execution table is obtained; determining a third check result corresponding to the test case execution table according to the first check result and the second check result corresponding to the test case execution table; and summarizing the third verification results corresponding to the test case execution tables to obtain the final verification results, so that synchronous verification and asynchronous verification are carried out through effective data, returned data and intermediate data, the final verification results are automatically output, and the test accuracy is improved.
The invention realizes that the serial numbers, the test scene sets and the test scene strategies of the test cases in the interface test request are obtained by receiving the interface test request; the test scene set comprises a plurality of test scenes; acquiring a test action list and initialization configuration data associated with each test scene from a scene library; constructing initialization data according to all the initialization configuration data and the test scene policies; performing action deduplication and interface aggregation and sequencing on all the test action lists to obtain a final action list corresponding to the test case serial number; according to the initialization data and the final action list, a test case execution list is assembled, and the test case execution list is executed to obtain a return result; and carrying out transparent verification on the returned result to obtain a final verification result, and displaying the final verification result in a log display mode to complete the interface test request.
In an embodiment, in the step S60, the displaying by a log displaying manner includes:
s606, performing process backtracking on each third verification result in the final verification results to obtain a chained relation diagram, and simultaneously obtaining a historical verification result matched with the serial number of the test case from a historical result library.
The process backtracking is a backtracking process of each processing result, namely backtracking the flow of each processing node, a chained relation is formed in the process backtracking, namely, a node is linked with a node relation, so that the chained relation is formed into a graph, the chained relation graph is obtained, a database of the historical verification results of all the interface tests tested in the historical result library is stored, the historical verification results of all the interface tests tested in the historical result library are all associated with a unique test case serial number, the historical verification results of the serial number of the test case are matched from the historical result library, the historical verification results are the third verification results of the historical interface tests, the matched process is a process of using a character matching degree technology to find the sequence of all the characters in the serial number of the test case, and the three previous historical verification results are obtained.
S607, generating a result graph according to the final check result and all the history check results.
Understandably, the number of test passes and the number of test fails in the final verification result are plotted by a curve, and the test passes of the same interface in the final verification result and all the historical verification results are summarized and the test cases of the same interface are plotted by a curve.
And S608, displaying the final verification result, the chained relation graph and the result graph according to the log display mode.
Understandably, the final verification result, the chained relation graph and the result graph are displayed on an application program display interface, and the log display mode is a mode of graphically displaying related log information of a history matched with the serial number of the test case.
The invention realizes that a chain type relation graph is obtained by carrying out process backtracking on each third verification result in the final verification results; acquiring a historical verification result matched with the serial number of the test case from a historical result library; generating a result graph according to the final verification result and all the historical verification results; and displaying the final verification result, the chained relation graph and the result graph according to the log display mode, and displaying the final verification result by using the log display mode so as to finish the interface test request, so that the display mode combining the history log is realized, and the interface test can be more conveniently and reasonably automatically performed.
The invention realizes the test case serial number, the test scene set and the test scene strategy in the interface test request; acquiring a test action list and initialization configuration data associated with each test scene from a scene library; constructing initialization data according to all the initialization configuration data and the test scene policies; performing action deduplication and interface aggregation and sequencing on all the test action lists to obtain a final action list; according to the initialization data and the final action list, a test case execution list is assembled, and the test case execution list is executed to obtain a return result; the method comprises the steps of carrying out transparent verification on a returned result to obtain a final verification result, and displaying the final verification result through a log display mode, so that the purposes of acquiring a test action list and initialization configuration data from a scene library through free assembly and a test scene strategy, automatically setting up required initialization data, generating a final action list through action deduplication, interface aggregation and sequencing, automatically assembling the final action list into a test case execution list, obtaining the executed returned result, carrying out verification through the transparent verification to obtain the final verification result, and automatically displaying the final verification result through the log display mode to provide a test result for a tester for the test at the time, automatically generating the test case execution list to carry out interface test without manually writing the test case, and displaying the result through a display mode combining a history log.
In an embodiment, an interface testing device based on a testing scenario is provided, where the interface testing device based on the testing scenario corresponds to the interface testing method based on the testing scenario in the foregoing embodiment one by one. As shown in fig. 6, the test scenario-based interface test device includes a receiving module 11, an acquiring module 12, a building module 13, a sorting module 14, an assembling module 15 and a checking module 16. The functional modules are described in detail as follows:
the receiving module 11 is configured to receive an interface test request, and obtain a serial number of a test case, a test scene set and a test scene policy in the interface test request; the test scene set comprises a plurality of test scenes;
an obtaining module 12, configured to obtain a test action list and initialization configuration data associated with each of the test scenarios from a scenario library;
a building module 13, configured to build initialization data according to all the initialization configuration data and the test scene policies;
the sorting module 14 is configured to perform action deduplication and interface aggregation and sorting on all the test action lists to obtain a final action list corresponding to the test case serial number;
the assembling module 15 is configured to assemble a test case execution list according to the initialization data and the final action list, execute the test case execution list, and obtain a return result;
And the verification module 16 is used for performing transparent verification on the returned result to obtain a final verification result, and displaying the final verification result in a log display mode to complete the interface test request.
For specific limitations of the test scenario-based interface test apparatus, reference may be made to the above limitations of the test scenario-based interface test method, and no further description is given herein. The modules in the interface testing device based on the testing scene can be all or partially implemented by software, hardware and a combination thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In one embodiment, a computer device is provided, which may be a server, the internal structure of which may be as shown in fig. 7. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program, when executed by a processor, implements a test scenario-based interface test method.
In one embodiment, a computer device is provided that includes a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor executes the computer program to implement the test scenario-based interface test method of the above embodiments.
In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, which when executed by a processor implements the test scenario-based interface test method of the above embodiment.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in embodiments provided herein may include non-volatile and/or volatile memory. The nonvolatile memory can include Read Only Memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), memory bus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), among others.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of the functional units and modules is illustrated, and in practical application, the above-described functional distribution may be performed by different functional units and modules according to needs, i.e. the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-described functions.
The above embodiments are only for illustrating the technical solution of the present invention, and not for limiting the same; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention, and are intended to be included in the scope of the present invention.

Claims (7)

1. An interface testing method based on a testing scene is characterized by comprising the following steps:
receiving an interface test request, and acquiring a test case serial number, a test scene set and a test scene strategy in the interface test request; the test scene set comprises a plurality of test scenes;
Acquiring a test action list and initialization configuration data associated with each test scene from a scene library;
constructing initialization data according to all the initialization configuration data and the test scene policies;
performing action deduplication and interface aggregation and sequencing on all the test action lists to obtain a final action list corresponding to the test case serial number;
according to the initialization data and the final action list, a test case execution list is assembled, and the test case execution list is executed to obtain a return result;
performing transparent verification on the returned result to obtain a final verification result, and displaying the final verification result in a log display mode to complete the interface test request;
and constructing initialization data according to all the initialization configuration data and the test scene policies, wherein the initialization data comprises:
acquiring a test environment package matched with the test environment identifier in each initialization configuration data through a test construction center, and installing the acquired test environment package; the initialization configuration data comprises the test environment identifier, a test structure type and a test data form set;
extracting a data form set to be tested corresponding to the test data form set from the test data form set in each initialization configuration data according to the test scene strategy;
Constructing test form data corresponding to each initialization configuration data according to the test structure type in each initialization configuration data and the corresponding data form set to be tested;
initializing all the test form data and building the initialization data;
the step of extracting the set of data forms to be tested corresponding to the initialization configuration data from the set of data forms to be tested in each initialization configuration data according to the test scene policy includes:
when the test scene strategy is a Bayesian strategy, extracting the data form set to be tested corresponding to the test data form set from each test data form set according to a Bayesian algorithm;
when the test scene strategy is a random strategy, extracting the data form set to be tested corresponding to the test data form set from each test data form set according to a random algorithm;
when the test scene strategy is a Cartesian full coverage strategy, determining each test data form set as the data form set to be tested corresponding to the test data form set;
and assembling a test case execution list according to the initialization data and the final action list, wherein the test case execution list comprises the following components:
acquiring a report Wen Moban corresponding to the action in the final action list from a template library;
Tracing back valid data corresponding to the action in the final action list from the initialization data;
filling the effective data corresponding to the action into the message template corresponding to the action to obtain a test case execution table corresponding to the action;
and assembling the test case execution table corresponding to each action to obtain the test case execution list.
2. The method for testing an interface based on a test scenario according to claim 1, wherein the extracting the set of data forms to be tested corresponding to the initialization configuration data from the set of data forms to be tested according to the test scenario policy, further comprises:
when the test scene strategy is a historical genetic strategy, acquiring a historical failure data form library and a historical test data form set which are matched with the test case serial numbers;
and extracting the data form set to be tested, which is the same as the historical failure data form library or the historical test data form set, from each test data form set.
3. The method for testing an interface based on a test scenario as claimed in claim 1, wherein said performing a transparent verification on the returned result to obtain a final verification result comprises:
Acquiring the effective data and the intermediate data corresponding to each test case execution table in the test case execution list;
according to the effective data corresponding to the test case execution table, synchronous verification is carried out on the returned data corresponding to the test case execution table in the returned results, and a first verification result corresponding to the test case execution table is obtained;
asynchronous checking is carried out on the intermediate data corresponding to the test case execution table, and a second checking result corresponding to the test case execution table is obtained;
determining a third check result corresponding to the test case execution table according to the first check result and the second check result corresponding to the test case execution table;
and summarizing the third verification results corresponding to the test case execution tables to obtain the final verification result.
4. The interface testing method based on the testing scenario as claimed in claim 3, wherein the presenting by a log presenting manner includes:
performing process backtracking on each third verification result in the final verification results to obtain a chained relation diagram, and simultaneously obtaining a historical verification result matched with the serial number of the test case from a historical result library;
Generating a result graph according to the final verification result and all the historical verification results;
and displaying the final verification result, the chained relation graph and the result graph according to the log display mode.
5. An interface testing device based on a testing scene, comprising:
the receiving module is used for receiving an interface test request and acquiring a test case serial number, a test scene set and a test scene strategy in the interface test request; the test scene set comprises a plurality of test scenes;
the acquisition module is used for acquiring a test action list and initialization configuration data associated with each test scene from the scene library;
the building module is used for building initialization data according to all the initialization configuration data and the test scene policies;
the sequencing module is used for performing action deduplication and interface aggregation and sequencing on all the test action lists to obtain a final action list corresponding to the test case serial number;
the assembly module is used for assembling a test case execution list according to the initialization data and the final action list, executing the test case execution list and obtaining a return result;
The verification module is used for carrying out transparent verification on the returned result to obtain a final verification result, and displaying the final verification result in a log display mode to complete the interface test request;
and constructing initialization data according to all the initialization configuration data and the test scene policies, wherein the initialization data comprises:
acquiring a test environment package matched with the test environment identifier in each initialization configuration data through a test construction center, and installing the acquired test environment package; the initialization configuration data comprises the test environment identifier, a test structure type and a test data form set;
extracting a data form set to be tested corresponding to the test data form set from the test data form set in each initialization configuration data according to the test scene strategy;
constructing test form data corresponding to each initialization configuration data according to the test structure type in each initialization configuration data and the corresponding data form set to be tested;
initializing all the test form data and building the initialization data;
the step of extracting the set of data forms to be tested corresponding to the initialization configuration data from the set of data forms to be tested in each initialization configuration data according to the test scene policy includes:
When the test scene strategy is a Bayesian strategy, extracting the data form set to be tested corresponding to the test data form set from each test data form set according to a Bayesian algorithm;
when the test scene strategy is a random strategy, extracting the data form set to be tested corresponding to the test data form set from each test data form set according to a random algorithm;
when the test scene strategy is a Cartesian full coverage strategy, determining each test data form set as the data form set to be tested corresponding to the test data form set;
and assembling a test case execution list according to the initialization data and the final action list, wherein the test case execution list comprises the following components:
acquiring a report Wen Moban corresponding to the action in the final action list from a template library;
tracing back valid data corresponding to the action in the final action list from the initialization data;
filling the effective data corresponding to the action into the message template corresponding to the action to obtain a test case execution table corresponding to the action;
and assembling the test case execution table corresponding to each action to obtain the test case execution list.
6. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the test scenario-based interface test method according to any one of claims 1 to 4 when executing the computer program.
7. A computer readable storage medium storing a computer program, wherein the computer program when executed by a processor implements the test scenario-based interface test method according to any one of claims 1 to 4.
CN202110466037.3A 2021-04-28 2021-04-28 Interface testing method, device, equipment and medium based on testing scene Active CN113176995B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110466037.3A CN113176995B (en) 2021-04-28 2021-04-28 Interface testing method, device, equipment and medium based on testing scene

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110466037.3A CN113176995B (en) 2021-04-28 2021-04-28 Interface testing method, device, equipment and medium based on testing scene

Publications (2)

Publication Number Publication Date
CN113176995A CN113176995A (en) 2021-07-27
CN113176995B true CN113176995B (en) 2024-03-19

Family

ID=76926777

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110466037.3A Active CN113176995B (en) 2021-04-28 2021-04-28 Interface testing method, device, equipment and medium based on testing scene

Country Status (1)

Country Link
CN (1) CN113176995B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107992427A (en) * 2017-12-26 2018-05-04 顺丰科技有限公司 Create method, apparatus, equipment and its storage medium of operational trials scene
CN111858376A (en) * 2020-07-29 2020-10-30 平安养老保险股份有限公司 Request message generation method and interface test method
CN112256558A (en) * 2020-09-17 2021-01-22 苏宁云计算有限公司 Test case generation method and device, computer equipment and storage medium
KR20210042866A (en) * 2020-06-10 2021-04-20 베이징 바이두 넷컴 사이언스 앤 테크놀로지 코., 엘티디. Method and apparatus for storing auto-drive test data, electronic device, storage medium and program

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090271214A1 (en) * 2008-04-29 2009-10-29 Affiliated Computer Services, Inc. Rules engine framework
US9367435B2 (en) * 2013-12-12 2016-06-14 Vertafore, Inc. Integration testing method and system for web services

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107992427A (en) * 2017-12-26 2018-05-04 顺丰科技有限公司 Create method, apparatus, equipment and its storage medium of operational trials scene
KR20210042866A (en) * 2020-06-10 2021-04-20 베이징 바이두 넷컴 사이언스 앤 테크놀로지 코., 엘티디. Method and apparatus for storing auto-drive test data, electronic device, storage medium and program
CN111858376A (en) * 2020-07-29 2020-10-30 平安养老保险股份有限公司 Request message generation method and interface test method
CN112256558A (en) * 2020-09-17 2021-01-22 苏宁云计算有限公司 Test case generation method and device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN113176995A (en) 2021-07-27

Similar Documents

Publication Publication Date Title
CN110309071B (en) Test code generation method and module, and test method and system
CN109302522B (en) Test method, test device, computer system, and computer medium
CN110941546A (en) Automatic test method, device, equipment and storage medium for WEB page case
CN109800258B (en) Data file deployment method, device, computer equipment and storage medium
CN108492005B (en) Project data processing method and device, computer equipment and storage medium
CN112631686A (en) Data processing method, data processing device, computer equipment and storage medium
CN112181854A (en) Method, device, equipment and storage medium for generating flow automation script
CN114490375A (en) Method, device and equipment for testing performance of application program and storage medium
CN113742338A (en) Structured storage system for project acceptance forms
CN112559525B (en) Data checking system, method, device and server
CN111459796B (en) Automated testing method, apparatus, computer device and storage medium
CN110232018A (en) Interface test method, device, computer equipment
CN113176995B (en) Interface testing method, device, equipment and medium based on testing scene
CN110633213B (en) Unit test method, unit test device, computer equipment and storage medium
CN115080389A (en) Test system, method, equipment and storage medium for improving index statistical efficiency
CN112579571B (en) Monitoring data configuration, data monitoring method, device, equipment and storage medium
CN114356454A (en) Account checking data processing method, account checking data processing device, account checking data storage medium and program product
CN113791980A (en) Test case conversion analysis method, device, equipment and storage medium
CN113886221A (en) Test script generation method and device, storage medium and electronic equipment
CN109901998A (en) Recovery method as resource, device, system, computer equipment and storage medium
CN114327377B (en) Method and device for generating demand tracking matrix, computer equipment and storage medium
CN111008131B (en) Automated testing method, apparatus, computer device and storage medium
CN113485944B (en) Software testing method and system
CN114286378B (en) Ad hoc network wireless communication device network performance test system and method
CN114721970B (en) Method and device for automatic testing and accurate testing of construction interface

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