CN113254352A - Test method, device, equipment and storage medium for test case - Google Patents

Test method, device, equipment and storage medium for test case Download PDF

Info

Publication number
CN113254352A
CN113254352A CN202110714988.8A CN202110714988A CN113254352A CN 113254352 A CN113254352 A CN 113254352A CN 202110714988 A CN202110714988 A CN 202110714988A CN 113254352 A CN113254352 A CN 113254352A
Authority
CN
China
Prior art keywords
transaction information
transaction
test
ring
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110714988.8A
Other languages
Chinese (zh)
Inventor
刘庆辰
陈洪美
王欣
李佩刚
苏畅
周荣林
李凤
仝知非
高晶晶
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Agricultural Bank of China
Original Assignee
Agricultural Bank of China
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 Agricultural Bank of China filed Critical Agricultural Bank of China
Priority to CN202110714988.8A priority Critical patent/CN113254352A/en
Publication of CN113254352A publication Critical patent/CN113254352A/en
Pending legal-status Critical Current

Links

Images

Classifications

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

Abstract

The embodiment of the application provides a test method, a test device, test equipment and a storage medium for test cases, wherein the method comprises the following steps: acquiring test data and a transaction ring, wherein the transaction ring comprises a plurality of transaction messages in the same service scene, and the latter transaction message in the transaction ring depends on the former transaction message; inputting the test data into a test case corresponding to the first transaction information in the transaction ring to obtain output data of the test case corresponding to the first transaction information; and inputting the output data of the test case corresponding to the previous transaction information into the test case corresponding to the next transaction information from the second transaction information in the transaction ring so as to test the test case corresponding to each transaction information in the transaction ring. The test method, the test device, the test equipment and the storage medium for the test case provided by the embodiment of the application can be used for reducing the data volume of test data required by the test.

Description

Test method, device, equipment and storage medium for test case
Technical Field
The embodiment of the application relates to the technical field of testing, in particular to a testing method, a testing device, testing equipment and a storage medium for testing cases.
Background
In order to ensure that the application system of the bank can normally complete the business requirements of the user, the application system is usually required to be tested. Currently, it is generally necessary to test a plurality of transactions included in an application system for the purpose of testing the application system.
In the related art, a test case corresponding to each transaction is constructed, test data corresponding to each test case is constructed, and the test data corresponding to the test case is executed through the test case of each transaction, so that the test of each transaction is realized.
In the related art, the test data of each of the plurality of test cases are independent from each other or have poor correlation, which results in a large amount of test data required in the test process.
Disclosure of Invention
The embodiment of the application provides a test method, a test device, test equipment and a storage medium for test cases, which are used for reducing the data volume of test data required by tests.
In a first aspect, an embodiment of the present application provides a method for testing a test case, including:
acquiring test data and a transaction ring, wherein the transaction ring comprises a plurality of transaction messages in the same service scene, and the latter transaction message in the transaction ring depends on the former transaction message;
inputting the test data into a test case corresponding to the first transaction information in the transaction ring to obtain output data of the test case corresponding to the first transaction information;
and inputting the output data of the test case corresponding to the previous transaction information into the test case corresponding to the next transaction information from the second transaction information in the transaction ring so as to test the test case corresponding to each transaction information in the transaction ring.
In one possible design, a transaction ring is obtained, including:
acquiring a plurality of transaction information;
matching the plurality of transaction information with a preset transaction library to determine the dependency relationship among the transaction information, wherein the preset transaction library comprises a plurality of standard transaction information and the dependency relationship among the standard transaction information;
and constructing a transaction ring according to the dependency relationship among the transaction information.
In one possible design, the preset transaction library comprises a plurality of preset rule chains, and each preset rule chain comprises at least two pieces of standard transaction information and a dependency relationship between the standard transaction information in the at least two pieces of standard transaction information;
matching the transaction information with a preset transaction library, and determining the dependency relationship among the transaction information, wherein the dependency relationship comprises the following steps:
and matching each transaction information in the transaction information with the standard transaction information included in each preset rule chain to determine the dependency relationship among the transaction information.
In one possible design, obtaining test data includes:
acquiring data types required by test cases corresponding to the transaction information included in the test transaction ring;
and inquiring test data corresponding to the data type from a preset database.
In one possible design, the method further includes:
if test data corresponding to the data types are not inquired in the preset database, acquiring basic data related to a plurality of transaction information;
and constructing test data based on the basic data according to the business rule corresponding to each transaction information in the transaction information.
In one possible design, obtaining a plurality of transaction information includes:
acquiring a plurality of pieces of initial transaction information within a preset time period;
analyzing the plurality of initial transaction information, and determining a service type corresponding to each initial transaction information;
and determining the initial transaction information of which the service type belongs to the preset service type as the transaction information.
In one possible design, the method further includes:
judging whether the quantity of the initial transaction information of which the service type does not belong to the preset service type is larger than a preset value or not;
and if the business type is larger than the preset value, determining the initial transaction information of which the business type does not belong to the preset business type as the transaction information.
In a second aspect, an embodiment of the present application provides a test apparatus for testing cases, including: the device comprises an acquisition module and a processing module;
the acquisition module is used for acquiring the test data and a transaction ring, wherein the transaction ring comprises a plurality of transaction messages in the same service scene, and the latter transaction message in the transaction ring depends on the former transaction message;
the processing module is used for inputting the test data into the test case corresponding to the first transaction information in the transaction ring to obtain the output data of the test case corresponding to the first transaction information;
and the processing module is also used for inputting the output data of the test case corresponding to the previous transaction information into the test case corresponding to the next transaction information from the second transaction information in the transaction ring so as to test the test case corresponding to each transaction information in the transaction ring.
In one possible design, the obtaining module is specifically configured to:
acquiring a plurality of transaction information;
matching the plurality of transaction information with a preset transaction library to determine the dependency relationship among the transaction information, wherein the preset transaction library comprises a plurality of standard transaction information and the dependency relationship among the standard transaction information;
and constructing a transaction ring according to the dependency relationship among the transaction information.
In one possible design, the preset transaction library comprises a plurality of preset rule chains, and each preset rule chain comprises at least two pieces of standard transaction information and a dependency relationship between the standard transaction information in the at least two pieces of standard transaction information;
the acquisition module is specifically configured to:
and matching each transaction information in the transaction information with the standard transaction information included in each preset rule chain to determine the dependency relationship among the transaction information.
In one possible design, the obtaining module is specifically configured to:
acquiring data types required by test cases corresponding to the transaction information included in the test transaction ring;
and inquiring test data corresponding to the data type from a preset database.
In one possible design, the obtaining module is further configured to:
if test data corresponding to the data types are not inquired in the preset database, acquiring basic data related to a plurality of transaction information;
and constructing test data based on the basic data according to the business rule corresponding to each transaction information in the transaction information.
In one possible design, the acquisition module is specifically configured to;
acquiring a plurality of pieces of initial transaction information within a preset time period;
analyzing the plurality of initial transaction information, and determining a service type corresponding to each initial transaction information;
and determining the initial transaction information of which the service type belongs to the preset service type as the transaction information.
In one possible design, the obtaining module is further configured to;
judging whether the quantity of the initial transaction information of which the service type does not belong to the preset service type is larger than a preset value or not;
and if the business type is larger than the preset value, determining the initial transaction information of which the business type does not belong to the preset business type as the transaction information.
In a third aspect, an embodiment of the present application provides a test apparatus, including: a processor and a memory;
the memory stores computer-executable instructions;
the processor executes the computer-executable instructions stored by the memory, causing the processor to perform the method of any of the first aspects above.
In a fourth aspect, embodiments of the present application provide a computer-readable storage medium, in which computer-executable instructions are stored, and when the processor executes the computer-executable instructions, the method according to any one of the above first aspects is implemented.
In a fifth aspect, the present application provides a computer program product comprising a computer program, which when executed by a processor implements the method according to any one of the first aspect above.
The embodiment of the application provides a test method, a test device, test equipment and a storage medium for test cases, wherein the method comprises the following steps: acquiring test data and a transaction ring, wherein the transaction ring comprises a plurality of transaction messages in the same service scene, and the latter transaction message in the transaction ring depends on the former transaction message; inputting the test data into a test case corresponding to the first transaction information in the transaction ring to obtain output data of the test case corresponding to the first transaction information; and inputting the output data of the test case corresponding to the previous transaction information into the test case corresponding to the next transaction information from the second transaction information in the transaction ring so as to test the test case corresponding to each transaction information in the transaction ring. In the method, because the latter transaction information in the transaction ring depends on the former transaction information, after the test data is input into the test case corresponding to the first transaction information in the transaction ring, the output data of the test case corresponding to the former transaction information in the transaction ring can be ensured to be input into the test case corresponding to the latter transaction information, so that the test of a plurality of transaction information in the transaction ring is performed through the test data of the test case corresponding to the first transaction information, and the data volume of the test data required by the test is reduced.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present application, and those skilled in the art can also obtain other drawings according to the drawings without inventive exercise.
Fig. 1 is a schematic view of an application scenario provided in an embodiment of the present application;
fig. 2 is a first schematic flowchart of a testing method for a test case provided in an embodiment of the present application;
FIG. 3 is a schematic diagram of a closed loop test provided by an embodiment of the present application;
fig. 4 is a schematic flowchart illustrating a second testing method for testing cases according to an embodiment of the present application;
FIG. 5 is a schematic structural diagram of a test apparatus for providing test cases according to an embodiment of the present disclosure;
fig. 6 is a schematic hardware structure diagram of a test apparatus according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims of the present application and in the drawings described above, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are, for example, capable of operation in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
In the related art, in the process of executing the test data corresponding to each test case through each test case of each transaction to realize the test of each transaction, the data volume of the test data required in the test process is large because the test data of each of the plurality of test cases are independent or have weak relevance.
In the application, in order to reduce the data volume of the test data required in the test process, the inventor thinks that a transaction ring is constructed in a plurality of transactions, after the test data is executed in the test case corresponding to the first transaction in the transaction ring, the execution result can be input into the test case corresponding to the next transaction, and so on, so that the test of a plurality of transactions in the transaction ring through one test data is realized, and the data volume of the test data required in the test process is reduced.
Next, an application scenario of the technical solution shown in the present application will be described with reference to fig. 1.
Fig. 1 is a schematic view of an application scenario provided in an embodiment of the present application. As shown in fig. 1, includes: an application system, a plurality of business scenarios, and a plurality of transaction information. The application system comprises a plurality of service scenes, and each service scene comprises a plurality of transaction information.
Illustratively, the plurality of service scenarios may be 2, which are respectively: a customer signing contract-releasing scene and a customer purchasing redeeming financing product scene.
For example, the number of transaction information included in the client contract-signing and contract-resolving scenario may be 4, which are: evaluating the risk grade of the client, signing the client for financing, inquiring the result of the client for financing and contracting, and saving the client for financing.
For example, the plurality of transaction information of the customer purchasing the redeeming financial product scenario may be 4, which are: the method comprises the steps of inquiring financial products by a customer, purchasing financial products by the customer, inquiring financial products held by the customer and redeeming financial products by the customer.
Aiming at each business scene, a plurality of corresponding transaction information can form one or a plurality of transaction rings, the latter transaction information in the transaction rings depends on the former transaction information, and the test cases corresponding to the transaction information in the transaction rings can be tested through the test data required by the test case corresponding to the first transaction information in the transaction rings, so that the aim of testing the transactions in the transaction rings is fulfilled. The purpose of testing each transaction in the transaction ring can be achieved through the test data required by the test case corresponding to the first transaction information in the transaction ring, so that the data volume of the test data required by the test is reduced.
The technical solution of the present application will be described in detail with specific examples. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments.
Fig. 2 is a first flowchart illustrating a testing method for a test case according to an embodiment of the present disclosure. As shown in fig. 2, the method includes:
s201, obtaining test data and a transaction ring, wherein the transaction ring comprises a plurality of transaction messages in the same service scene, and the latter transaction message in the transaction ring depends on the former transaction message.
Optionally, the execution subject in the embodiment of the present application is a testing device, and may also be a testing apparatus for a test case arranged in the testing device, where the testing apparatus for the test case may be implemented by a combination of software and/or hardware.
Illustratively, the testing device may be, for example, a testing server, a desktop computer, or the like.
The test data is the test data required by the test case corresponding to the first transaction information in the transaction ring.
The transaction ring (i.e. the service scene closed ring) includes N transaction information sequentially arranged in the same service scene, where N is an integer greater than or equal to 2. The N transaction information arranged in sequence is a complete business operation flow formed after the N transaction information is arranged according to the sequence of the business logic.
Alternatively, a plurality of transaction information included in the same service scenario in the transaction ring may be recorded in the closed-loop scenario table.
The same service scenario is generally a service scenario included in an application system that satisfies 3 preset conditions. Wherein, 3 preset conditions are respectively: data sensitivity, business integrity, transaction information association. The data stability refers to the stability of test data required by all business scenes included in the application system, for example, the test data does not relate to data with possibility of real-time change such as accounting date, system date, product quota and the like. And the business integrity means that the dependency of the application system on a batch or peripheral system is low, and the content of the application system comprises a complete business scene. The transaction relevance refers to the close association relationship of the transaction information in the application system, and the transaction information is reversible (the test data of the test case corresponding to the transaction information can be restored to the original state), so that the cyclic use of the test data can be ensured.
Illustratively, the transaction ring of a service scenario includes 2 pieces of transaction information, which are respectively: a query financing subscription and a modify financing subscription, wherein modifying a financing subscription depends on the query financing subscription.
S202, inputting the test data into the test case corresponding to the first transaction information in the transaction ring to obtain the output data of the test case corresponding to the first transaction information.
The transaction information in the transaction ring has corresponding transaction codes, and the test case corresponding to each transaction information is obtained from the test case base according to the transaction codes.
The transaction code corresponding to each of the transaction information may be stored in a closed-loop scenario table.
The test case library may be preset and stored in the test equipment.
For a business system with an automatic test construction result in the early stage (namely under the condition that a plurality of cases exist), the test cases corresponding to the transaction information are obtained from the automatic test construction result according to the transaction codes corresponding to the transaction information, and the test cases corresponding to the transaction information are stored in a test case library.
It should be noted that, when the test case corresponding to the transaction information is obtained, it is necessary to determine whether the test case matches the transaction information and/or whether the test case can be modified and maintained; if yes, the test case is put into a test case library.
In practical application, aiming at a business system with an automatic testing construction result in the early stage, transaction information is possibly added in the later stage, and for the transaction information added in the later stage, test data corresponding to the transaction information added in the later stage can be obtained in a mode that a tester edits or modifies similar cases by himself.
For a business system without an automatic test construction result in the early stage, a tester can automatically compile a plurality of test cases corresponding to the transaction information.
Optionally, the test case corresponding to the transaction information may satisfy the transaction amount and/or case normalization principle corresponding to the transaction information. For example, the case normalization principle includes that special characters (e.g., #, @ and the like) must not be included in the test case, the number of characters included in the test case is less than or equal to a preset threshold, and necessary entries in the test case are not null.
And S203, starting from the second transaction information in the transaction ring, inputting the output data of the test case corresponding to the previous transaction information into the test case corresponding to the next transaction information, so as to test the test case corresponding to each transaction information in the transaction ring.
Optionally, the output data of the test case corresponding to the last transaction information in the transaction ring may also be input into the test case corresponding to the first transaction information in the transaction ring.
Optionally, after the test case corresponding to each transaction information in the transaction ring is tested, a test result may be obtained, and the test result may be compared with a preset result to determine that the test case corresponding to each transaction information may be correctly executed.
In the following, with reference to the embodiment of fig. 3, an exemplary description is given to test cases corresponding to transaction information in a transaction ring. Fig. 3 is a schematic diagram of a closed loop test according to an embodiment of the present disclosure. As shown in fig. 3, includes: a plurality of transaction information, a plurality of test cases, and test data. Illustratively, the transaction information comprises transaction information 1-6, and the test cases comprise test cases 1-6. Wherein, each transaction information corresponds to a test case. For example, transaction information 3 corresponds to test case 3. The test data is the test data corresponding to test case 1. After the test data is input into the test case 1, the output data of the test case 1 can be input into the test case 2, the output data of the test case 2 can be input into the test case 3, and so on, the output data of the test case 6 can be input into the test case 1, that is, the output data of the test case 6 can be recovered into the test data.
In the embodiment of fig. 2, since the latter transaction information in the transaction ring depends on the former transaction information, after the test data is input into the test case corresponding to the first transaction information in the transaction ring, it can be ensured that the output data of the test case corresponding to the former transaction information in the transaction ring is input into the test case corresponding to the latter transaction information, so that the test of the transaction information in the transaction ring is performed through the test data of the test case corresponding to the first transaction information, and the data volume of the test data required by the test is reduced.
On the basis of the above embodiments, the following describes in detail the testing method of the test case provided in the embodiments of the present application with reference to fig. 4, and specifically, refer to the embodiment of fig. 4.
Fig. 4 is a schematic flowchart illustrating a second testing method for a test case according to an embodiment of the present application. As shown in fig. 4, the method includes:
s401, obtaining data types needed by the test cases corresponding to the transaction information included in the test transaction ring.
Specifically, the required data type (i.e., the test data requirement) is selected according to the test case corresponding to each transaction information.
Illustratively, the data types may include accounts, products, amounts, quantities, and the like.
S402, inquiring test data corresponding to the data types from a preset database.
In one possible design, the preset database is a data resource pool, and the preset database includes test data corresponding to the data type required by the test case corresponding to each transaction information. The test data can be queried from a preset database according to the data type.
In such a design, the preset database may be a database designed and stored for the tester. Specifically, a tester firstly obtains basic data and/or test data by means of transaction query or script query database, and judges whether test data required for executing test cases corresponding to transaction information in a transaction ring exists in the current test environment of the electronic equipment;
if yes, judging whether the test data completely meets the requirements of execution of the service scene where each transaction information is located; if so, putting the test data into a database to obtain a preset database; if not, sequencing the self-programmed data processing scripts according to the service rules, compiling into a script collection table (namely a basic data preprocessing step display table and an execution script collection table), processing the basic data according to the script collection table, and constructing the test data.
The underlying data may be, for example, a blank general customer account that has not signed up for any business nor has any products held.
In one possible design, the preset database only includes test data corresponding to the data types required by the test cases corresponding to part of the transaction information.
In the design, if test data corresponding to the data types are not inquired in a preset database, basic data related to a plurality of transaction information is acquired;
and constructing test data based on the basic data according to the business rule corresponding to each transaction information in the transaction information.
Wherein obtaining base data related to the plurality of transaction information comprises: firstly, basic data is obtained by a mode of inquiring a database through transaction or executing a script.
Specifically, the script set table is stored in the electronic device, and the electronic device executes processing on the basic data according to the script set table to construct the test data.
And S403, acquiring a plurality of transaction information.
In one possible design, a transaction library is provided in the test device, and transaction information corresponding to each of the plurality of application scenarios is stored in the transaction library in advance.
Optionally, each application scene has a respective corresponding scene identifier. Aiming at an application scene, acquiring a scene identifier; and inquiring in a transaction library to obtain a plurality of transaction information according to the scene identification.
In another possible design, a plurality of initial transaction information within a preset time period is acquired; analyzing the plurality of initial transaction information, and determining a service type corresponding to each initial transaction information; and determining the initial transaction information of which the service type belongs to the preset service type as the transaction information.
Optionally, the preset time period may be one day, two days, and the like, and here, specific values of the preset time period are not limited.
Exemplary preset business types include fund flow, accounting processing, and the like.
In another possible design, for initial transaction information of which the service type does not belong to a preset service type, whether the number of the initial transaction information is greater than a preset value is judged;
and if the transaction information is larger than the preset value, determining the initial transaction information as the transaction information.
Optionally, the preset value may be total transaction data in a preset time period, or may be a daily average transaction amount in the preset time period. For example, the preset value may be 1000, 1200, and the like, and the specific value of the preset value is not limited herein.
S404, matching the transaction information with a preset transaction library, and determining the dependency relationship among the transaction information.
The preset transaction library comprises a plurality of standard transaction information and a dependency relationship among the standard transaction information.
Further, the preset transaction library may include a plurality of preset rule chains, and each preset rule chain includes at least two pieces of standard transaction information and a dependency relationship between the pieces of standard transaction information in the at least two pieces of standard transaction information.
Matching the transaction information with a preset transaction library, and determining the dependency relationship among the transaction information, wherein the dependency relationship comprises the following steps: and matching each transaction information in the transaction information with the standard transaction information included in each preset rule chain to determine the dependency relationship among the transaction information.
For example, the preset rule chain may have a format as shown in table 1 below.
TABLE 1
Figure BDA0003134520220000111
In the dependency relationship in table 1, the transaction information in the first column is the previous standard transaction information of the standard transaction information in the same row as the transaction information, and the transaction information in the second column is the next standard transaction information of the standard transaction information in the same row as the transaction information.
Illustratively, the transaction information in the first column is 2, then the transaction information 2 is the previous standard transaction information of the standard transaction information 3 in the same row as the transaction information 2.
Illustratively, the transaction information in the second column is 4, and the transaction information 4 is the standard transaction information subsequent to the standard transaction information 3 in the same row as the transaction information 4.
S405, according to the dependency relationship among the transaction information, a transaction ring is constructed.
Illustratively, when the obtained plurality of transaction information includes: in the case of the transaction information 3, 2, 5, and 4, the transaction ring constructed based on the dependency relationship may include the transaction information 2, 3, 4, and 5 arranged in sequence in the above table 1.
Optionally, after the transaction ring is constructed, it may be further determined whether the transaction ring has the reversible transaction information.
Specifically, sample test data is input into a test case corresponding to the first transaction information in the transaction ring, and if the output of the last transaction information in the transaction ring is the same as the sample test data (that is, the test data of the test case corresponding to the first transaction information can be restored to the original state), it is determined that the transaction information of the transaction ring is reversible, and the first transaction information can be determined as the initial transaction in the transaction ring and the last transaction information can be determined as the end-point transaction in the transaction ring.
S406, inputting the test data into the test case corresponding to the first transaction information in the transaction ring to obtain the output data of the test case corresponding to the first transaction information.
And S407, starting from the second transaction information in the transaction ring, inputting the output data of the test case corresponding to the previous transaction information into the test case corresponding to the next transaction information, so as to test the test case corresponding to each transaction information in the transaction ring.
Specifically, the execution method of S406 to S407 is the same as the execution method of S202 to S203, and the execution process of S406 to S407 is not described herein again.
It should be noted that the output data of the test case corresponding to the last transaction information in the transaction ring is the same as the test data required by the test case corresponding to the first transaction information in the transaction ring.
The application is different from the prior art, in the prior art, a bank tests through respective developed or purchased automation tools, and in the testing process, the respective developed or purchased automation tools depend on a stable testing environment and testing data, that is, the stability requirements on the testing environment and the testing data are high, but in practice, the testing data are usually used in a public environment (for example, the testing data can be used by developers and testers), so that the possibility of frequent tampering of the testing data is high, and the testing data cannot be stably and effectively used. In the application, the output data of the test case corresponding to the last transaction information in the transaction ring is the same as the test data required by the test case corresponding to the first transaction information in the transaction ring, so that the test data can be recovered, the possibility of tampering, appropriation and failure of the test data is reduced, and the test data is carried out in the same service scene from creation to use and then returns to the initial state, so that the test data can be repeatedly used, and the repeated creation of the test data is avoided.
In the prior art, the preparation process of the test data is complex, and the test data is required to be obtained by searching and processing layer by layer according to different types of levels such as lines, types and states as a service product directly facing to a client (for example, investment and financing, the lower level is a financing service, a closed financing service, an open financing service and the like), so that the preparation process is complex, the waste of human resources is caused, and the test execution efficiency is reduced. In the application, the data types required by the test cases corresponding to the transaction information included in the test transaction ring are acquired, and the test data corresponding to the data types are inquired from the preset database, so that the test data preparation process can be simplified, the human resources are saved, and the test execution efficiency is improved.
Further, in the application, the latter transaction information in the transaction ring depends on the former transaction information, so that the test data of the test case corresponding to the first transaction information can be ensured to pass, the plurality of transaction information in the transaction ring can be tested, and the data volume of the test data required by the test is reduced.
Fig. 5 is a schematic structural diagram of a testing apparatus for providing a test case according to an embodiment of the present application. As shown in fig. 5, the test apparatus 10 for a test case includes: an acquisition module 101 and a processing module 102;
the acquisition module 101 is configured to acquire test data and a transaction ring, where the transaction ring includes multiple transaction information in the same service scenario, and a subsequent transaction information in the transaction ring depends on a previous transaction information;
the processing module 102 is configured to input the test data into a test case corresponding to the first transaction information in the transaction ring to obtain output data of the test case corresponding to the first transaction information;
the processing module 102 is further configured to input, from the second transaction information in the transaction ring, the output data of the test case corresponding to the previous transaction information into the test case corresponding to the next transaction information, so as to test the test case corresponding to each transaction information in the transaction ring.
The test device provided in the embodiment of the present application can implement the technical solutions shown in the above method embodiments, and the implementation principles and beneficial effects thereof are similar, and are not described herein again.
In one possible design, the obtaining module 101 is specifically configured to:
acquiring a plurality of transaction information;
matching the plurality of transaction information with a preset transaction library to determine the dependency relationship among the transaction information, wherein the preset transaction library comprises a plurality of standard transaction information and the dependency relationship among the standard transaction information;
and constructing a transaction ring according to the dependency relationship among the transaction information.
In one possible design, the preset transaction library comprises a plurality of preset rule chains, and each preset rule chain comprises at least two pieces of standard transaction information and a dependency relationship between the standard transaction information in the at least two pieces of standard transaction information;
the obtaining module 101 is specifically configured to:
and matching each transaction information in the transaction information with the standard transaction information included in each preset rule chain to determine the dependency relationship among the transaction information.
In one possible design, the obtaining module 101 is specifically configured to:
acquiring data types required by test cases corresponding to the transaction information included in the test transaction ring;
and inquiring test data corresponding to the data type from a preset database.
In one possible design, the obtaining module 101 is further configured to:
if test data corresponding to the data types are not inquired in the preset database, acquiring basic data related to a plurality of transaction information;
and constructing test data based on the basic data according to the business rule corresponding to each transaction information in the transaction information.
In one possible design, the obtaining module 101 is specifically configured to;
acquiring a plurality of pieces of initial transaction information within a preset time period;
analyzing the plurality of initial transaction information, and determining a service type corresponding to each initial transaction information;
and determining the initial transaction information of which the service type belongs to the preset service type as the transaction information.
In one possible design, the obtaining module 101 is further configured to;
judging whether the quantity of the initial transaction information of which the service type does not belong to the preset service type is larger than a preset value or not;
and if the business type is larger than the preset value, determining the initial transaction information of which the business type does not belong to the preset business type as the transaction information.
The test device provided in the embodiment of the present application can implement the technical solutions shown in the above method embodiments, and the implementation principles and beneficial effects thereof are similar, and are not described herein again.
Fig. 6 is a schematic hardware structure diagram of a test apparatus according to an embodiment of the present application. As shown in fig. 6, the test apparatus 20 includes: a processor 201 and a memory 202,
the processor 201 and the memory 202 are connected by a bus 203.
In particular implementations, the processor 201 executes computer-executable instructions stored in the memory 202, causing the processor 201 to perform the test methods for test cases as described above.
For a specific implementation process of the processor 201, reference may be made to the above method embodiments, which have similar implementation principles and technical effects, and details of this embodiment are not described herein again.
In the embodiment shown in fig. 6, it should be understood that the Processor may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in the incorporated application may be directly implemented by a hardware processor, or may be implemented by a combination of hardware and software modules in the processor.
The memory may comprise high speed RAM memory and may also include non-volatile storage NVM, such as disk storage.
The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended ISA (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, the buses in the figures of the present application are not limited to only one bus or one type of bus.
The application also provides a computer-readable storage medium, in which computer-executable instructions are stored, and when the processor executes the computer-executable instructions, the method for testing the test case is implemented.
The present application also provides a computer program product comprising a computer program which, when executed by a processor, implements the method of testing a test case as above.
The computer-readable storage medium may be implemented by any type of volatile or non-volatile memory device or combination thereof, such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disk. Readable storage media can be any available media that can be accessed by a general purpose or special purpose computer.
An exemplary readable storage medium is coupled to the processor such the processor can read information from, and write information to, the readable storage medium. Of course, the readable storage medium may also be an integral part of the processor. The processor and the readable storage medium may reside in an Application Specific Integrated Circuits (ASIC). Of course, the processor and the readable storage medium may also reside as discrete components in the apparatus.
The division of the unit is only a logical division, and other division ways are possible in actual implementation, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
Units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should 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 or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present application.

Claims (11)

1. A method for testing a test case, comprising:
acquiring test data and a transaction ring, wherein the transaction ring comprises a plurality of transaction messages in the same service scene, and the latter transaction message in the transaction ring depends on the former transaction message;
inputting test data into a test case corresponding to first transaction information in the transaction ring to obtain output data of the test case corresponding to the first transaction information;
and inputting the output data of the test case corresponding to the previous transaction information into the test case corresponding to the next transaction information from the second transaction information in the transaction ring so as to test the test case corresponding to each transaction information in the transaction ring.
2. The method of claim 1, wherein obtaining a transaction ring comprises:
acquiring a plurality of transaction information;
matching the plurality of transaction information with a preset transaction library to determine the dependency relationship among the transaction information, wherein the preset transaction library comprises a plurality of standard transaction information and the dependency relationship among the standard transaction information;
and constructing a transaction ring according to the dependency relationship among the transaction information.
3. The method according to claim 2, wherein the preset transaction library comprises a plurality of preset rule chains, each preset rule chain comprises at least two pieces of standard transaction information and a dependency relationship between each piece of standard transaction information of the at least two pieces of standard transaction information;
the matching of the transaction information with a preset transaction library to determine the dependency relationship between the transaction information includes:
and matching each transaction information in the transaction information with the standard transaction information included in each preset rule chain to determine the dependency relationship among the transaction information.
4. The method of any of claims 1-3, wherein obtaining test data comprises:
acquiring data types required by testing cases corresponding to the transaction information included in the transaction ring;
and inquiring the test data corresponding to the data type from a preset database.
5. The method of claim 4, further comprising:
if the test data corresponding to the data type is not inquired in the preset database, acquiring basic data related to the transaction information;
and constructing the test data based on the basic data according to the business rule corresponding to each transaction information in the transaction information.
6. The method of claim 2 or 3, wherein said obtaining a plurality of transaction information comprises:
acquiring a plurality of pieces of initial transaction information within a preset time period;
analyzing the plurality of initial transaction information, and determining a service type corresponding to each initial transaction information;
and determining the initial transaction information of which the service type belongs to the preset service type as the transaction information.
7. The method of claim 6, further comprising:
judging whether the quantity of the initial transaction information of which the service type does not belong to the preset service type is greater than a preset value or not;
and if the business type is larger than the preset value, determining the initial transaction information of which the business type does not belong to the preset business type as the transaction information.
8. A test apparatus for testing cases, comprising: the device comprises an acquisition module and a processing module;
the acquisition module is used for acquiring test data and a transaction ring, wherein the transaction ring comprises a plurality of transaction messages in the same service scene, and the latter transaction message in the transaction ring depends on the former transaction message;
the processing module is used for inputting test data into the test case corresponding to the first transaction information in the transaction ring to obtain output data of the test case corresponding to the first transaction information;
the processing module is further configured to input, from the second transaction information in the transaction ring, the output data of the test case corresponding to the previous transaction information into the test case corresponding to the next transaction information, so as to test the test case corresponding to each transaction information in the transaction ring.
9. A test apparatus, comprising: a processor and a memory; the memory stores computer-executable instructions; the processor executes computer-executable instructions stored by the memory, causing the processor to perform the method of any of claims 1 to 7.
10. A computer-readable storage medium having computer-executable instructions stored thereon which, when executed by a processor, implement the method of any one of claims 1 to 7.
11. A computer program product comprising a computer program, characterized in that the computer program realizes the method according to any of claims 1 to 7 when executed by a processor.
CN202110714988.8A 2021-06-25 2021-06-25 Test method, device, equipment and storage medium for test case Pending CN113254352A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110714988.8A CN113254352A (en) 2021-06-25 2021-06-25 Test method, device, equipment and storage medium for test case

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110714988.8A CN113254352A (en) 2021-06-25 2021-06-25 Test method, device, equipment and storage medium for test case

Publications (1)

Publication Number Publication Date
CN113254352A true CN113254352A (en) 2021-08-13

Family

ID=77189760

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110714988.8A Pending CN113254352A (en) 2021-06-25 2021-06-25 Test method, device, equipment and storage medium for test case

Country Status (1)

Country Link
CN (1) CN113254352A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113821441A (en) * 2021-09-29 2021-12-21 平安银行股份有限公司 Execution method, device, equipment and storage medium based on cucumber test case

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111581108A (en) * 2020-05-14 2020-08-25 中国银行股份有限公司 Input data acquisition method and device based on business system transaction test
CN111640019A (en) * 2020-05-12 2020-09-08 中信银行股份有限公司 Method and device for acquiring test data, storage medium and electronic device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111640019A (en) * 2020-05-12 2020-09-08 中信银行股份有限公司 Method and device for acquiring test data, storage medium and electronic device
CN111581108A (en) * 2020-05-14 2020-08-25 中国银行股份有限公司 Input data acquisition method and device based on business system transaction test

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113821441A (en) * 2021-09-29 2021-12-21 平安银行股份有限公司 Execution method, device, equipment and storage medium based on cucumber test case
CN113821441B (en) * 2021-09-29 2023-10-13 平安银行股份有限公司 Execution method, device, equipment and storage medium based on document test case

Similar Documents

Publication Publication Date Title
CN111221726A (en) Test data generation method and device, storage medium and intelligent equipment
CN107423613A (en) The method, apparatus and server of device-fingerprint are determined according to similarity
CN109409641A (en) Risk evaluating method, device, computer equipment and storage medium
CN114048129A (en) Automatic testing method, device, equipment and system for software function change
CN110764999A (en) Automatic testing method and device, computer device and storage medium
CN110046086B (en) Expected data generation method and device for test and electronic equipment
CN113254352A (en) Test method, device, equipment and storage medium for test case
CN110263132B (en) Project case pushing method and device
CN115437965B (en) Data processing method suitable for test management platform
CN111723210A (en) Method and device for storing data table, computer equipment and readable storage medium
CN111340062A (en) Mapping relation determining method and device
CN109840213B (en) Test data creating method, device, terminal and storage medium for GUI test
CN110796178B (en) Decision model training method, sample feature selection method, device and electronic equipment
CN114860608A (en) Scene construction based system automation testing method, device, equipment and medium
CN113436023A (en) Financial product recommendation method and device based on block chain
CN110570301B (en) Risk identification method, device, equipment and medium
CN112232962A (en) Transaction index processing method, device and equipment
CN112613762A (en) Knowledge graph-based group rating method and device and electronic equipment
CN108510071B (en) Data feature extraction method and device and computer readable storage medium
CN108235324B (en) Short message template testing method and server
CN110647454A (en) Method and device for determining system user access information
CN110928788B (en) Service verification method and device
CN113905400B (en) Network optimization processing method and device, electronic equipment and storage medium
CN117349358B (en) Data matching and merging method and system based on distributed graph processing framework
CN113177784B (en) Address type identification method and device

Legal Events

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