CN113176995A - 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
CN113176995A
CN113176995A CN202110466037.3A CN202110466037A CN113176995A CN 113176995 A CN113176995 A CN 113176995A CN 202110466037 A CN202110466037 A CN 202110466037A CN 113176995 A CN113176995 A CN 113176995A
Authority
CN
China
Prior art keywords
test
data
interface
scene
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.)
Granted
Application number
CN202110466037.3A
Other languages
Chinese (zh)
Other versions
CN113176995B (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

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/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

Landscapes

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

Abstract

The invention relates to the 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 obtaining a test action list and initialization configuration data from a scene library through freely assembling a test scene and a test scene strategy, automatically building required initialization data, generating a final action list through action duplication removal, interface aggregation and sequencing, automatically assembling a test case execution list, obtaining a return result after execution, verifying through transparent transmission verification to obtain a final verification result, and automatically displaying through a log display mode. The invention can automatically generate the test case execution list for interface test only by assembling the test scene and the test scene strategy, and can display the result, 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 invention relates to the technical field of automatic test tools, in particular to an interface test method, device, equipment and medium based on a test scene.
Background
With the rapid development of computer technology, systems become more complex, and the requirements cannot be met by traditional front-end tests, and interface tests are carried out as soon as possible in order to meet the requirements of early intervention tests. The interface test means that test cases of various test scenes are compiled according to test documents, and the performance of the interface under each test scene is tested by using the compiled test cases. In the prior art, along with the increasing complexity of a system and the increasing number of interfaces, the difficulty in compiling test cases of a reasonable test strategy is extremely high, and in the actual process, the test of any interface needs to build a test environment, create initialization data, compile the test cases and other manual input for the test scene of each interface, and needs to be completed by a professional in a long time, so that the process is high in workload, low in efficiency and high in operation and maintenance cost.
Disclosure of Invention
The invention provides an interface testing method and device based on a testing scene, computer equipment and a storage medium, which realize more convenient and reasonable automatic interface testing, reduce the technical threshold of testers, improve the testing efficiency, reduce the labor cost, avoid omission of the testers and improve the accuracy and quality of the 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 scenario set comprises a plurality of test scenarios;
acquiring a test action list and initialization configuration data associated with each test scene from a scene library;
establishing initialization data according to all the initialization configuration data and the test scene strategies;
performing action duplicate removal and interface aggregation and sequencing on all the test action lists to obtain a final action list corresponding to the test case serial number;
assembling a test case execution list according to the initialization data and the final action list, and executing the test case execution list to obtain a return result;
and carrying out transparent transmission verification on the returned result to obtain a final verification result, and displaying in a log display mode to complete the interface test request.
An interface testing apparatus based on a test scenario, comprising:
the interface test system comprises a receiving module, a test module and a test module, wherein 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 scenario set comprises a plurality of test scenarios;
the acquisition module is used for acquiring a test action list and initialization configuration data associated with each test scene from a scene library;
the building module is used for building initialization data according to all the initialization configuration data and the test scene strategies;
the sequencing module is used for performing action duplicate removal 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, and executing the test case execution list to obtain a return result;
and the checking module is used for carrying out transparent transmission checking on the returned result to obtain a final checking result, and displaying the final checking result in a log display mode to complete the interface test request.
A computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the test scenario-based interface testing method when executing the computer program.
A computer-readable storage medium, in which a computer program is stored, which, when being executed by a processor, carries out the steps of the above-mentioned test scenario-based interface testing method.
According to the interface testing method and device based on the testing scene, the computer equipment and the storage medium, the serial number of the testing case, the testing scene set and the testing scene strategy 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; establishing initialization data according to all the initialization configuration data and the test scene strategies; performing action duplicate removal, interface aggregation and sequencing on all the test action lists to obtain a final action list; assembling a test case execution list according to the initialization data and the final action list, and executing the test case execution list to obtain a return result; the returned result is subjected to transparent transmission verification to obtain a final verification result, and the final verification result is displayed in a log display mode, so that a test scenario and a test scenario strategy are freely assembled, a test action list and initialization configuration data are obtained from a scenario library, required initialization data are automatically set up, a final action list is generated through action deduplication, interface aggregation and sequencing, a test case execution list is automatically assembled, a returned result after execution is obtained, the final verification result is obtained through transparent transmission verification, the test result is automatically displayed in a log display mode to provide a test effect for a tester to test this time, the test case execution list is not required to be manually compiled, the test scenario and the test scenario strategy are assembled, the test case execution list can be automatically generated to carry out interface test, and the result is displayed in a display mode of combining a history log, the interface test can be automatically carried out more conveniently and reasonably, the technical threshold of testers is reduced, the test efficiency is improved, the labor cost is reduced, omission of the testers is avoided, and the accuracy and the quality of the interface test are improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments of the present invention will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to these drawings without inventive labor.
FIG. 1 is a schematic diagram 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 flowchart of a test scenario based interface testing method according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating step S30 of the interface testing method based on the test scenario according to an embodiment of the present invention;
FIG. 4 is a flowchart illustrating step S50 of the interface testing method based on the test scenario according to an embodiment of the present invention;
FIG. 5 is a flowchart illustrating step S60 of the interface testing method based on the test scenario according to an embodiment of the present invention;
FIG. 6 is a functional block diagram of a conversion module of the interface testing apparatus based on the testing scenario according to an embodiment of the present invention;
FIG. 7 is a schematic diagram of a computer device in an embodiment of the invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The interface testing method based on the testing scenario provided by the invention can be applied to the application environment shown in fig. 1, wherein a client (computer device) communicates with a server through a network. The client (computer device) includes, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, cameras, and portable wearable devices. The server may be implemented as a stand-alone server or as a server cluster consisting of a plurality of servers.
In an embodiment, as shown in fig. 2, an interface testing method based on a testing scenario is provided, which mainly includes the following steps S10-S60:
s10, receiving an interface test request, and acquiring a test case serial number, a test scenario set and a test scenario 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 for an interface to be tested, the test case serial number is a unique identification number matched with the test case serial number according to the test scenario set related to the test case, the test scenario set is a set of test scenarios related to the test case to be tested, that is, one test case serial number corresponds to one test scenario set, and the test scenario is a scenario for designing the interface to be tested according to a scenario template, for example: the method comprises the following steps of ATM withdrawing money, inserting a bank card, inputting a password, inputting a withdrawal amount, withdrawing money, fetching a card and other scenes, designing a test scene relating the scene to an interface to be tested 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 the interface test, and the test scene strategy comprises a Bayesian strategy, a random strategy, a Cartesian full coverage strategy and a historical genetic strategy.
And S20, obtaining a test action list and initialization configuration data associated with each test scene from a scene library.
Understandably, the scene library stores all scenes and manages all scenes, the test scene in the scene library is associated with one test action list and one initialization configuration data, the test action list is a pre-designed test action set of the test scene, the initialization configuration data is configuration data related to initialization data required by the pre-designed test scene, that is, data of a test environment, a test structure and various data forms required by testing the test scene, and can also be extracted from historical initialization configuration data related to the scene, the initialization configuration data includes the test environment identifier, the test structure type and the test data form set, the test environment identifier is a unique identifier for establishing the test environment, for example, the test environment identifier includes a DB environment (database environment); the initialization configuration data includes a test environment identifier for extracting the test environment, and the test environment identifier includes a DB environment (database environment) interface, a test structure type and a test data form set, MQ environment (message queue environment), REDIS environment (remote dictionary service environment), etc., where the test structure type is a type of format for constructing a test structure, the test structure is a file format of a test case in a test process, for example, the test structure type includes an XML type, a JSON type, a DB type, etc., and the test data form set is a set of data of different forms that may appear and is designed according to a test scenario.
And S30, establishing initialization data according to all the initialization configuration data and the test scenario strategies.
Understandably, the setting up process includes obtaining a test environment package matched with the test environment identifier in each piece of initialization configuration data, installing the test environment package, placing the test environment package 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 piece of initialization configuration data according to the test scene policy, automatically setting up each piece of 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 pieces of test form data, and setting up the initialization data, wherein the initialization data is data required 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 scenario policy includes:
s301, obtaining a test environment packet matched with the test environment identification in each piece of initialization configuration data through a test building center, and installing the obtained test environment packet; the initialization configuration data comprises the test environment identification, the test structure type and the test data form set.
Understandably, the test building center stores all test environment packages matched with the test environment identifiers, 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 includes the test environment identifier, the test structure type and the test data form set, the test environment identifier is a unique identifier for establishing a test environment, the test structure type is a type of a format for constructing a test structure, the test structure is a file format of a test case in a test process, for example, the test structure type includes an XML type, a JSON type, a DB type and the like, and the test data form set is a set of data in different forms that may appear and is designed according to a test scenario.
S302, according to the test scene strategy, extracting a corresponding to-be-tested data form set from the test data form set in each initialization configuration data.
Understandably, the test scene strategies comprise a Bayesian strategy, a random strategy, a Cartesian full coverage strategy and a historical genetic strategy, when the test scene strategies are the Bayesian strategy, according to the Bayesian algorithm, the Bayesian algorithm is a statistical classification algorithm which is a classification algorithm using probability statistical knowledge to classify, various data forms with the highest probability are extracted from each test data form set, and the data forms are determined as the to-be-tested data form set; when the test scene strategy is a random strategy, according to a random algorithm, the random algorithm is a pseudo-random number sequence generated by matching a random function and a rand function in a mode of generating random numbers, before the rand function generates the random numbers, the system takes the current time as a seed for generating the pseudo-random number sequence, 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 test scene strategy is a cartesian full coverage strategy, the cartesian full coverage strategy is a strategy for testing in a full-scale test mode, and each test data form set is determined as the corresponding to-be-tested data form set; and 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 serial number of the test case, 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.
In an embodiment, the step S302, namely, the extracting the corresponding to-be-tested data shape set from the test data shape set in each initialization configuration data according to the test scenario policy includes:
and S3021, when the test scenario policy is a Bayesian policy, extracting the corresponding to-be-tested data form set from each test data form set according to a Bayesian algorithm.
Understandably, when the test scene policy is a bayesian policy, according to the bayesian algorithm, the bayesian algorithm is a statistical classification algorithm, which is an algorithm for classifying by using probability statistical knowledge, various data forms with the highest probability are extracted from each test data form set and determined as the to-be-tested data form set.
And S3022, when the test scenario policy is a random policy, extracting the corresponding to-be-tested data form set from each test data form set according to a random algorithm.
Understandably, when the test scenario policy is a random policy, according to a random algorithm, the random algorithm is a pseudo-random number sequence generated by using the combination of a srand function and a rand function in a manner of generating random numbers, before the rand function generates random numbers, the system takes the current time as a seed for generating the pseudo-random number sequence, 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.
And S3023, when the test scenario policy is a Cartesian full coverage policy, determining each test data form set as the corresponding to-be-tested data form set.
Understandably, when the test scenario policy is a cartesian full coverage policy, the cartesian full coverage policy is a policy for testing in a full-scale test manner, and each test data form set is determined as the corresponding to-be-tested data form set.
According to the invention, when the test scene strategy is a Bayesian strategy, the corresponding data form set to be tested is extracted from each test data form set according to a Bayesian algorithm; when the test scene strategy is a random strategy, extracting the corresponding data form set to be tested from each test data form set according to a random algorithm; and when the test scene strategy is a Cartesian full-coverage strategy, determining each test data form set as the corresponding to-be-tested data form set, so that the to-be-tested data form sets conforming to the test scene strategy are extracted from the test data form sets through automatically matching corresponding algorithms by different test scene strategies, and the to-be-tested data form sets can be scientifically extracted for subsequent test case generation.
In an embodiment, in the step S302, that is, according to the test scenario policy, the extracting the corresponding to-be-tested data configuration set from the test data configuration set in each initialization configuration data further includes:
and S3024, when the test scenario policy is a historical genetic policy, acquiring a historical failure data form library and a historical test data form set which are matched with the test case flow number.
Understandably, the historical failure data form library is a collection of data forms with historical test failures, and the historical test data form collection is a test data form collection used in the latest historical iteration test matched with the serial number of the test case.
S3025, extracting the to-be-tested data pattern set that is the same as the historical failure data pattern library or the historical test data pattern set from each of the test data pattern sets.
Understandably, the data form which is the same as the data form in the historical failure data form library or the data form in the historical test data form set is extracted from each test data form set and is determined as the data form 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 library and a historical test data form set which are matched with the test case serial number are obtained; 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, so that the data form which is easy to fail and is verified is extracted by combining the failed data inherited from the history and the data used for the last time, the labor cost is reduced, and the data form set to be tested is extracted more scientifically.
And S303, constructing test form data corresponding to each initialization configuration data 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.
Understandably, the test structure is a file format of a test case in a test process, for example, the test structure type includes 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 that may appear and is designed according to a test scenario, and the data form in the to-be-tested data form set is subjected to form template application according to the test structure type 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 the test environment packet matched with the test environment identification in each initialization configuration data is obtained through the test building center, and the obtained test environment packet is installed; extracting a corresponding to-be-tested 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 data form set to be tested corresponding to the test structure type; all the test form data are initialized, 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 data form set to be tested is automatically extracted according to a test scene strategy, the data form set to be tested is built into the test form data according to the test structure type, initialization is carried out 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 building success rate is improved.
And S40, performing action duplicate removal and interface aggregation and sequencing on all the test action lists to obtain a final action list corresponding to the test case serial number.
Understandably, the test action lists of the test scenarios may be repeated because the test scenarios may test various related interfaces, the action deduplication is to remove the same actions in all the test action lists, the interface aggregation and sorting is to aggregate the actions of the same interfaces together and sort according to the sequence between the interfaces, so as to obtain the final action list corresponding to the test case serial numbers one to one.
And S50, assembling a test case execution list according to the initialization data and the final action list, and executing the test case execution list to obtain a return result.
Understandably, the assembling process is to obtain a message template corresponding to an action in the final action list from a template library, trace back valid data corresponding to the action in the final action list from the initialization data, automatically fill the valid data into the message template corresponding to the action to obtain a test case execution list corresponding to the action, assemble all the test case execution lists corresponding to the action to generate the test case execution list, execute the test case execution list, and return a result of executing the test case execution list by each interface, wherein the return result is a result of executing the test case execution list by each related interface, and the test case execution list comprises a plurality of test case execution lists.
The template library is a test case template for managing all the message templates, the message templates are test case templates for testing and designing each scene or each interface, the message templates comprise interface interaction modes, the tracing 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, finally trace back the data of the initialization data built by the initialization configuration data, and determine the traced back data as the effective data.
In an embodiment, as shown in fig. 4, the step S50, namely 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 manages all the message templates, the message templates are test case templates for testing and designing each scene or each interface, the message templates include interface interaction modes, and all the message templates are stored in the template library.
S502, trace back valid data corresponding to the action in the final action list from the initialization data.
Understandably, the processing procedure of the trace back is to find the test scenario associated with the action in the final action list, find the initialization configuration data associated with the test scenario according to the found test scenario, finally trace back the data of the initialization data built by the initialization configuration data, and determine the traced back data as the valid data.
S503, filling the effective data corresponding to the action into the message template corresponding to the action, and obtaining a test case execution table corresponding to the action.
Understandably, the effective data is automatically filled into the message template corresponding to the action, and a test case execution table corresponding to the action is obtained.
S504, the test case execution tables corresponding to the actions are assembled to obtain the test case execution list.
Understandably, assembling all the test case execution tables corresponding to the actions to generate the test case execution list.
The invention realizes that the message template corresponding to the action in the final action list is obtained from the template library; tracing 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 the message templates in the template library and is automatically assembled into the test case execution list, the labor cost is reduced, and the test efficiency is improved.
And S60, carrying out transparent transmission verification on the returned result to obtain a final verification result, and displaying in a log display mode to complete the interface test request.
Understandably, the transparent transmission check comprises a synchronous check and an asynchronous check, the synchronous check is a check process of whether the valid data corresponding to the test case execution table is consistent with the return data in the return result or not so as to obtain a first check result of the test case execution table, the first check result is a result obtained through the synchronous check, the asynchronous check is a process of performing library falling check on the process data of the intermediate data corresponding to the test case execution table so as to obtain a second check result corresponding to the test case execution table, and a third check result is determined 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.
And displaying the final verification result by using the log display mode, so as to complete the interface test request.
In an embodiment, as shown in fig. 5, in the step S60, that is, performing transparent transmission verification on the returned result to obtain a final verification result, the method includes:
s601, obtaining the effective data and the intermediate data corresponding to each test case execution table in the test case execution list.
Understandably, the intermediate data is 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 conducted 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.
Understandably, the synchronous verification process is a verification process for verifying whether the valid data corresponding to the test case execution table is consistent with the return data in the return result, so as to obtain a first verification result of the test case execution table, where the first verification result is a result obtained through the synchronous verification.
S603, the intermediate data corresponding to the test case execution table is subjected to asynchronous verification to obtain a second verification result corresponding to the test case execution table.
Understandably, the asynchronous verification process is to perform library falling verification on the process data of the intermediate data corresponding to the test case execution table.
S604, determining the third verification result corresponding to the test case execution table according to the first verification result and the second verification 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, whether the test is passed and the verification is passed is judged, and the final verification result is generated, wherein the final verification result indicates whether the test result of the interface test request is passed and the verification is passed.
The invention realizes that the effective data and the intermediate data corresponding to each test case execution table in the test case execution list are obtained; 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, synchronously verifying the returned data corresponding to the test case execution table in the returned results to obtain a first verification result corresponding to the test case execution table; 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; determining a third verification result corresponding to the test case execution table 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, so that synchronous verification and asynchronous verification are performed through effective data, returned data and intermediate data, the final verification result is automatically output, and the test accuracy is improved.
The invention realizes that the serial number of the test case, the test scene set and the test scene strategy in the interface test request are obtained by receiving the interface test request; the test scenario set comprises a plurality of test scenarios; acquiring a test action list and initialization configuration data associated with each test scene from a scene library; establishing initialization data according to all the initialization configuration data and the test scene strategies; performing action duplicate removal and interface aggregation and sequencing on all the test action lists to obtain a final action list corresponding to the test case serial number; assembling a test case execution list according to the initialization data and the final action list, and executing the test case execution list to obtain a return result; and carrying out transparent transmission verification on the returned result to obtain a final verification result, and displaying in a log display mode to complete the interface test request.
In an embodiment, the step S60, namely the displaying by the log displaying manner, includes:
and S606, performing process backtracking on each third verification result in the final verification result to obtain a chain relation graph, and simultaneously obtaining a historical verification result matched with the serial number of the test case from a historical result library.
Understandably, the process backtracking is a backtracking process of each processing result, namely, a process for backtracking each processing node, a chain-type relation is formed in the process backtracking, namely, a relation that one node is linked with one node, so that the chain-type relations form a graph to obtain the chain-type relation graph, the historical result library stores a database of the historical verification results of all the historical tested interface tests, the historical verification results of all the historical tested interface tests in the historical result library are all associated with a unique test case serial number, the historical verification results of the test case serial number are matched from the historical result library, the historical verification results are third verification results of the historical interface tests, the matching process is to find out a sequence of the matching number of all the characters in the test case serial number from more to less by using a character matching degree technology and arrange the sequence, and obtaining the historical verification results of the first three of the sequence.
And S607, generating a result curve graph according to the final verification result and all the historical verification results.
Understandably, the number of passed tests and the number of failed tests in the final verification result are depicted by a curve, and the tests of the same interface in the final verification result and all the historical verification results are summarized and the test condition of the same interface is depicted by the curve.
S608, displaying the final verification result, the chain relation graph and the result curve graph according to the log display mode.
Understandably, the final verification result, the chain relation graph and the result curve graph are displayed on an application program display interface, and the log display mode is a mode of carrying out graphical display through historical related log information matched with the test case serial number.
The invention realizes the process backtracking of each third verification result in the final verification result to obtain the chain relation graph; acquiring a historical verification result matched with the serial number of the test case from a historical result library; generating a result curve graph according to the final verification result and all the historical verification results; and displaying the final verification result, the chain relation graph and the result curve graph according to the log display mode, and displaying the final verification result by using the log display mode so as to complete the interface test request.
The invention realizes the purpose of obtaining the serial number of the test case, 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; establishing initialization data according to all the initialization configuration data and the test scene strategies; performing action duplicate removal, interface aggregation and sequencing on all the test action lists to obtain a final action list; assembling a test case execution list according to the initialization data and the final action list, and executing the test case execution list to obtain a return result; the returned result is subjected to transparent transmission verification to obtain a final verification result, and the final verification result is displayed in a log display mode, so that a test scenario and a test scenario strategy are freely assembled, a test action list and initialization configuration data are obtained from a scenario library, required initialization data are automatically set up, a final action list is generated through action deduplication, interface aggregation and sequencing, a test case execution list is automatically assembled, a returned result after execution is obtained, the final verification result is obtained through transparent transmission verification, the test result is automatically displayed in a log display mode to provide a test effect for a tester to test this time, the test case execution list is not required to be manually compiled, the test scenario and the test scenario strategy are assembled, the test case execution list can be automatically generated to carry out interface test, and the result is displayed in a display mode of combining a history log, the interface test can be automatically carried out more conveniently and reasonably, the technical threshold of testers is reduced, the test efficiency is improved, the labor cost is reduced, omission of the testers is avoided, and the accuracy and the quality of the interface test are improved.
In an embodiment, an interface testing apparatus based on a test scenario is provided, and the interface testing apparatus based on the test scenario corresponds to the interface testing method based on the test scenario in the above embodiment one to one. As shown in fig. 6, the interface testing apparatus based on the test scenario includes a receiving module 11, an obtaining module 12, a building module 13, a sorting module 14, an assembling module 15, and a verifying module 16. The functional modules are explained in detail as follows:
the receiving module 11 is configured to receive an interface test request, and obtain a test case serial number, a test scenario set, and a test scenario policy in the interface test request; the test scenario set comprises a plurality of test scenarios;
an obtaining module 12, configured to obtain, from a scene library, a test action list and initialization configuration data associated with each test scene;
the building module 13 is used for building initialization data according to all the initialization configuration data and the test scene strategies;
the sequencing module 14 is configured to perform 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 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 checking module 16 is configured to perform transparent transmission checking on the returned result to obtain a final checking result, and display the final checking result in a log display manner to complete the interface test request.
For specific limitations of the interface testing apparatus based on the test scenario, reference may be made to the above limitations of the interface testing method based on the test scenario, and details are not repeated here. All or part of each module in the interface testing device based on the testing scenario can be realized by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the 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 comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a test scenario based interface testing method.
In one embodiment, a computer device is provided, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor, and when the processor executes the computer program, the interface testing method based on the test scenario in the above embodiments is implemented.
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 testing method in the above-described embodiments.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, databases, or other media used in embodiments provided herein may include non-volatile and/or volatile memory. Non-volatile 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), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present 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 solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present invention, and are intended to be included within the scope of the present invention.

Claims (10)

1. An interface test method based on a test scenario 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 scenario set comprises a plurality of test scenarios;
acquiring a test action list and initialization configuration data associated with each test scene from a scene library;
establishing initialization data according to all the initialization configuration data and the test scene strategies;
performing action duplicate removal and interface aggregation and sequencing on all the test action lists to obtain a final action list corresponding to the test case serial number;
assembling a test case execution list according to the initialization data and the final action list, and executing the test case execution list to obtain a return result;
and carrying out transparent transmission verification on the returned result to obtain a final verification result, and displaying in a log display mode to complete the interface test request.
2. The interface testing method based on the test scenario of claim 1, wherein the building of the initialization data according to all the initialization configuration data and the test scenario policy comprises:
obtaining a test environment packet matched with the test environment identification in each initialization configuration data through a test building center, and installing the obtained test environment packet; the initialization configuration data comprises the test environment identification, the test structure type and the test data form set;
extracting a corresponding to-be-tested 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 data form set to be tested corresponding to the test structure type;
initializing all the test form data, and establishing the initialization data.
3. The interface testing method according to claim 2, wherein the extracting a corresponding set of data patterns to be tested from the set of test data patterns in each of the initialization configuration data according to the test scenario policy comprises:
when the test scene strategy is a Bayesian strategy, extracting the corresponding to-be-tested 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 corresponding data form set to be tested from each test data form set according to a random algorithm;
and when the test scene strategy is a Cartesian full coverage strategy, determining each test data form set as the corresponding to-be-tested data form set.
4. The interface testing method according to claim 2, wherein the extracting of the corresponding to-be-tested data shape set from the test data shape set in each initialization configuration data according to the test scenario policy further comprises:
when the test scenario 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 number;
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.
5. The interface testing method based on testing scenario of claim 1, wherein the assembling into a test case execution list according to the initialization data and the final action list comprises:
acquiring a message template corresponding to the action in the final action list from a template library;
tracing 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. The interface testing method based on the testing scenario of claim 5, wherein the performing transparent transmission verification on the returned result to obtain a final verification result comprises:
obtaining 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, synchronously verifying the returned data corresponding to the test case execution table in the returned results to obtain a first verification result corresponding to the test case execution table;
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;
determining a third verification result corresponding to the test case execution table 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.
7. The interface testing method based on the testing scenario as claimed in claim 6, wherein the displaying by log displaying comprises:
process backtracking is carried out on each third verification result in the final verification result to obtain a chain relation graph, and meanwhile, a historical verification result matched with the serial number of the test case is obtained from a historical result library;
generating a result curve graph according to the final verification result and all the historical verification results;
and displaying the final verification result, the chain relation graph and the result curve graph according to the log display mode.
8. An interface testing device based on a test scenario, comprising:
the interface test system comprises a receiving module, a test module and a test module, wherein 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 scenario set comprises a plurality of test scenarios;
the acquisition module is used for acquiring a test action list and initialization configuration data associated with each test scene from a scene library;
the building module is used for building initialization data according to all the initialization configuration data and the test scene strategies;
the sequencing module is used for performing action duplicate removal 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, and executing the test case execution list to obtain a return result;
and the checking module is used for carrying out transparent transmission checking on the returned result to obtain a final checking result, and displaying the final checking result in a log display mode to complete the interface test request.
9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the test scenario based interface testing method of any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, in which a computer program is stored, which, when being executed by a processor, implements the test scenario-based interface testing method according to any one of claims 1 to 7.
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 true CN113176995A (en) 2021-07-27
CN113176995B 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 (6)

* 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
US20150169432A1 (en) * 2013-12-12 2015-06-18 Vertafore, Inc. Integration testing method and system for web services
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

Patent Citations (6)

* 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
US20150169432A1 (en) * 2013-12-12 2015-06-18 Vertafore, Inc. Integration testing method and system for web services
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
CN113176995B (en) 2024-03-19

Similar Documents

Publication Publication Date Title
CN110309071B (en) Test code generation method and module, and test method and system
CN112884092B (en) AI model generation method, electronic device, and storage medium
CN109783785B (en) Method and device for generating experiment detection report and computer equipment
CN108874678B (en) Automatic testing method and device for intelligent program
CN113159737B (en) RPA service processing method, RPA management platform, device and medium
CN110134795A (en) Generate method, apparatus, computer equipment and the storage medium of validation problem group
CN110362479B (en) System upgrade test method and system
CN110337076A (en) SMS platform interface test method, device, computer equipment and storage medium
CN108460068A (en) Method, apparatus, storage medium and the terminal that report imports and exports
CN111026647A (en) Code coverage rate obtaining method and device, computer equipment and storage medium
CN112631926A (en) Code test coverage rate display method and device, computer equipment and storage medium
CN115080389A (en) Test system, method, equipment and storage medium for improving index statistical efficiency
CN114185808A (en) Automatic testing method and device, electronic equipment and computer readable storage medium
CN111459796B (en) Automated testing method, apparatus, computer device and storage medium
CN117493188A (en) Interface testing method and device, electronic equipment and storage medium
CN112596723A (en) Database script generation method, device, equipment and medium
US20130283238A1 (en) Testing system for an integrated software system
CN113176995A (en) Interface testing method, device, equipment and medium based on testing scene
CN113791980B (en) Conversion analysis method, device and equipment for test cases and storage medium
CN112035361B (en) Test method, device, computer equipment and storage medium of medical diagnosis model
CN114968816A (en) Data simulation-based strategy testing method, device, equipment and storage medium
CN112559012A (en) System upgrading and testing method and device, computer equipment and readable storage medium
CN112035617A (en) System testing method and device based on data comparison, computer equipment and medium
CN109800155B (en) Method and device for testing QTE interlocking application software based on Probe
CN113485944B (en) Software testing method and system

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