CN113485942A - Automatic testing method and device based on independent module - Google Patents

Automatic testing method and device based on independent module Download PDF

Info

Publication number
CN113485942A
CN113485942A CN202110854959.1A CN202110854959A CN113485942A CN 113485942 A CN113485942 A CN 113485942A CN 202110854959 A CN202110854959 A CN 202110854959A CN 113485942 A CN113485942 A CN 113485942A
Authority
CN
China
Prior art keywords
test
automatic
response message
automatic test
script
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
CN202110854959.1A
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.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
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 Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202110854959.1A priority Critical patent/CN113485942A/en
Publication of CN113485942A publication Critical patent/CN113485942A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites

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 provides an automatic testing method and device based on an independent module, wherein the method comprises the following steps: generating a test transaction request message according to the obtained modified automatic test conditions and the corresponding test result target value, and sending the test transaction request message to a test end; analyzing the response message according to the basic definition of each field of a preset database table; and judging whether the execution result value in the analyzed response message is consistent with the target value of the test result, if so, converting the automatic test script into a functional test case and storing the functional test case. The method has the advantages that functional modules required by the automatic test script are disassembled, the script is focused on service implementation, and data preparation is focused on prepositive preparation, so that the problem that the automatic test script has too many bearing functions is solved. The automatic test method automatically converts the automatic script into the functional test case, and feeds back the result state of the functional test case in real time in the automatic test process, so that the problem of lack of linkage of the automatic test script and the functional test case library is solved.

Description

Automatic testing method and device based on independent module
Technical Field
The present application belongs to the field of automated testing technology, and in particular, to an automated testing method and apparatus based on an independent module.
Background
There are two problems in the current automated testing process: the first problem is that the automated test scripts carry too heavy functionality. And the script bears and couples functions of data preparation before transaction test, message packaging in the test process, request initiation, return analysis, assertion verification after transaction test and the like. Taking an assertion judgment of a transfer transaction as an example, the balance of a transfer account is checked before the transaction, the balance of the transfer account is checked after the transaction, information such as transfer amount, commission charge and the like of the transaction is obtained, then the correctness of the 'balance after the transaction, namely the balance before the transaction, the transfer amount and the commission charge' is asserted, and if the transfer transactions of different card types in different channels are to be verified, the complicated operation steps of the balance assertion are embedded into an automatic test script of each transaction. The second problem is that the design and execution process of the automatic test script lacks linkage with the function test case library, and the automatic test script cannot be upgraded into test assets for inheritance and reuse.
Disclosure of Invention
The application provides an automatic testing method and device based on an independent module, and aims to at least solve the problems that an existing automatic testing script bears too many functions, linkage with a function testing case library is lacked in the design and execution process of the automatic testing script, and the automatic testing script cannot be promoted to be a testing asset for inheritance and reuse.
According to a first aspect of the application, an automated testing method based on independent modules is provided, which comprises the following steps:
generating a test transaction request message according to the obtained modified automatic test conditions and the corresponding test result target value, and sending the test transaction request message to the test end, so that the test end executes the test according to the test transaction request message and returns a response message; the test transaction request message comprises an automatic test script;
analyzing the response message according to the basic definition of each field of a preset database table;
and judging whether the execution result value in the analyzed response message is consistent with the target value of the test result, if so, converting the automatic test script into a functional test case and storing the functional test case.
In an embodiment, generating a test transaction request message according to the obtained modified automated test condition and the test result target value includes:
acquiring the modified automatic test conditions and the test result target values;
converting the automatic test conditions and the test result target values into automatic test scripts according to the basic definition of the preset fields;
and packaging the automatic test script to generate a test transaction request message.
In an embodiment, parsing the response packet according to the basic definition of each field of the preset database table includes:
carrying out field splitting on the response message;
and obtaining the basic definition of each field in the response message through the preset basic definition of each field of the database table.
In an embodiment, the determining whether the execution result value in the analyzed response message is consistent with the test result target value includes:
inquiring a corresponding execution result value from the response message according to the acquired automatic test condition;
and comparing the execution result value with the test result target value originally corresponding to the automatic test condition to obtain a comparison result.
In one embodiment, the automated testing method based on independent modules further includes:
and updating the function test cases in the function test case library in real time according to the comparison result of the execution result value and the test result target value of the automatic test.
According to the second aspect of the present application, there is also provided an automated testing apparatus based on independent modules, comprising:
the transaction message generating unit is used for generating a test transaction request message according to the obtained modified automatic test condition and the corresponding test result target value and sending the test transaction request message to the test end so that the test end executes the test according to the test transaction request message and returns a response message; the test transaction request message comprises an automatic test script;
the response message analysis unit is used for analyzing the response message according to the basic definition of each field of the preset database table;
and the judging unit is used for judging whether the execution result value in the analyzed response message is consistent with the target value of the test result, and if so, converting the automatic test script into a functional test case and storing the functional test case.
In one embodiment, the transaction message generating unit includes:
the acquisition module is used for acquiring the modified automatic test conditions and the test result target value;
the automatic test script conversion module is used for converting the automatic test conditions and the test result target values into automatic test scripts according to the basic definition of the preset fields;
and the transaction request message generation module is used for packaging the automatic test script to generate a test transaction request message.
In an embodiment, the reply message parsing unit includes:
the field splitting module is used for splitting the field of the response message;
and the analysis module is used for obtaining the basic definition of each field in the response message through the preset basic definition of each field of the database table.
In one embodiment, the determining unit includes:
the query module is used for querying a corresponding execution result value from the response message according to the obtained automatic test condition;
and the comparison module is used for comparing the execution result value with the test result target value originally corresponding to the automatic test condition to obtain a comparison result.
In one embodiment, the automated testing device based on independent modules further comprises:
and the case base updating unit is used for updating the function test cases in the function test case base in real time according to the comparison result of the execution result value of the automatic test and the test result target value.
According to a third aspect of the present application, there is also provided an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the method for automated testing based on independent modules when executing the program.
According to a fourth aspect of the present application, there is also provided a computer-readable storage medium, on which a computer program is stored, which computer program, when being executed by a processor, carries out the steps of the independent module based automated testing method.
According to the technical scheme, the application provides an automatic testing method and device based on an independent module, and the method comprises the following steps: generating a test transaction request message according to the obtained modified automatic test conditions and the corresponding test result target value, and sending the test transaction request message to the test end, so that the test end executes the test according to the test transaction request message and returns a response message; the test transaction request message comprises an automatic test script; analyzing the response message according to the basic definition of each field of a preset database table; and judging whether the execution result value in the analyzed response message is consistent with the target value of the test result, if so, converting the automatic test script into a functional test case and storing the functional test case. The complex function is modularized, the automatic test script is independent of the automatic test script, the visual configuration mode is provided for association and combination, the modules such as data preparation, transaction test, assertion judgment and the like are standardized and independent by disassembling the functional modules required by the automatic test script, the script is focused on service realization, and the problem that the automatic test script has too many bearing functions is solved by focusing on preposed preparation of data preparation. The automatic test method automatically converts the automatic script into the functional test case, and feeds back the result state of the functional test case in real time in the automatic test process, so that the problem of lack of linkage of the automatic test script and the functional test case library is solved. When the automatic test script is compiled, only the data preparation and assertion judgment functions corresponding to the building blocks are needed, and the development cost of the automatic test script is effectively reduced.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a flowchart of an automated testing method based on an independent module according to the present application.
Fig. 2 is a flowchart of generating a test transaction request message in the embodiment of the present application.
Fig. 3 is a flowchart of parsing a response packet in this embodiment.
Fig. 4 is a flowchart illustrating a method for determining whether an execution result value in an analyzed response message is consistent with a test result target value in the embodiment of the present application.
Fig. 5 is a block diagram of an automated testing device based on independent modules according to the present application.
Fig. 6 is a block diagram of a structure of a transaction message generation unit in the embodiment of the present application.
Fig. 7 is a block diagram of a structure of a response packet parsing unit in the embodiment of the present application.
Fig. 8 is a block diagram of a determining unit in the embodiment of the present application.
Fig. 9 is a specific implementation of an electronic device in an embodiment of the present application.
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 only a part of the embodiments of the present invention, and not all of the 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 invention.
It should be noted that the automated testing method and apparatus based on the independent module disclosed in the present application can be used in the field of financial technology, and can also be used in any field except the field of financial technology.
Aiming at the problems in the background art, the automatic testing method based on the independent module solves the problems in the background art.
In order to avoid the problems, the application provides an automatic testing method based on an independent module, an automatic testing device based on the independent module, electronic equipment and a computer readable medium respectively, by modularizing complex functions, being independent of an automatic testing script and providing visual configuration mode association combination, by disassembling functional modules required by the automatic testing script, modules such as data preparation, transaction testing, assertion judgment and the like are standardized and independent, so that the script is focused on service realization, and the problem that the automatic testing script has too much bearing functions is solved by focusing on prepositive preparation. The automatic test method automatically converts the automatic script into the functional test case, and feeds back the result state of the functional test case in real time in the automatic test process, so that the problem of lack of linkage of the automatic test script and the functional test case library is solved. When the automatic test script is compiled, only the data preparation and assertion judgment functions corresponding to the building blocks are needed, and the development cost of the automatic test script is effectively reduced.
According to the above, the present application further provides an independent module-based automated testing apparatus for implementing the independent module-based automated testing method provided in one or more embodiments of the present application, where the independent module-based automated testing apparatus may be in communication connection with a client device by itself or through a third-party server, and return an execution result to a client.
It is understood that the client devices may include smart phones, tablet electronic devices, network set-top boxes, portable computers, desktop computers, Personal Digital Assistants (PDAs), in-vehicle devices, smart wearable devices, and the like. Wherein, intelligence wearing equipment can include intelligent glasses, intelligent wrist-watch, intelligent bracelet etc..
In another practical application scenario, the aforementioned portion of the automated testing apparatus based on independent modules performing the automated testing based on independent modules may be executed in the server as described above, or all operations may be completed in the client device. The selection may be specifically performed according to the processing capability of the client device, the limitation of the user usage scenario, and the like. This is not a limitation of the present application. If all operations are completed in the client device, the client device may further include a processor for detailed processing of the automated testing based on the independent module.
The client device may have a communication module (i.e., a communication unit), and may be communicatively connected to a remote server to implement data transmission with the server. The server may include a server on the task scheduling center side, and in other implementation scenarios, the server may also include a server on an intermediate platform, for example, a server on a third-party server platform that is communicatively linked to the task scheduling center server. The server may include a single computer device, or may include a server cluster formed by a plurality of servers, or a server structure of a distributed apparatus.
The server and the client device may communicate using any suitable network protocol, including network protocols not yet developed at the filing date of this application. The network protocol may include, for example, a TCP/IP protocol, a UDP/IP protocol, an HTTP protocol, an HTTPS protocol, or the like. Of course, the network Protocol may also include, for example, an RPC Protocol (Remote Procedure Call Protocol), a REST Protocol (Representational State Transfer Protocol), and the like used above the above Protocol.
The following embodiments and application examples are specifically and individually described in detail.
The application provides an automated testing method based on independent modules, as shown in fig. 1, including:
s101: generating a test transaction request message according to the obtained modified automatic test conditions and the corresponding test result target value, and sending the test transaction request message to the test end, so that the test end executes the test according to the test transaction request message and returns a response message; the test transaction request message includes an automated test script.
S102: and analyzing the response message according to the preset basic definition of each field of the database table.
S103: and judging whether the execution result value in the analyzed response message is consistent with the target value of the test result, if so, converting the automatic test script into a functional test case and storing the functional test case.
In an embodiment, retesting is performed on the modified automated test conditions, the modified conditions and expected test results (test result target values) are firstly acquired, then the modified conditions and the expected test results are packaged to generate a test transaction request message and sent to a test terminal, and the expected test results are used for verifying whether the results obtained by the final test execution meet expectations. And when the test end executes the test, returning a response message, wherein the response message comprises an execution result, analyzing the response message to obtain an execution result value, and comparing the execution result value with the target value of the test result to determine whether the execution result value is consistent with the target value of the test result.
In an embodiment, generating a test transaction request message according to the obtained modified automated test condition and the test result target value, as shown in fig. 2, includes:
s201: and acquiring the modified automatic test conditions and the test result target values.
S202: and converting the automatic test conditions and the test result target values into automatic test scripts according to the basic definition of the preset fields.
S203: and packaging the automatic test script to generate a test transaction request message.
In one embodiment, the base definition of each field of a database table is obtained by analyzing the metadata definition of the database table. Taking the account of the account table of the active passbook of the database as an example, the following is a partial fragment of the basic definition of the fields of table 1.
TABLE 1
Serial number Name of English Name of Chinese Allowing empty Type (B) Length of Decimal fraction Data standards Value dictionary
1 ACCNO Account number Whether or not VARchar 17 0 Account number (17 bit) 0
2 CASHEXF Money collection mark Whether or not NUMBER 1 0 Money sign (digital 1 bit) 0-banknote; 1-sink; 2-false sink
3 STATUS Account status Whether or not NUMBER 1 0 Account status (digital 1 bit) 0-normal; 1-Account freezing
First, conditions to be satisfied for data modification and modification target values thereof are defined, for example, data satisfying the account number ACCNO ═ 02000620019846766' for the account table of the account of the current passbook is defined, and the modified account status is 1. Then the operation for table 2 is defined as:
TABLE 2
Figure BDA0003183800410000071
This definition is actually parsed into SQL statements:
update table_acc set status=1where ACCNO=’02000620019846766’;
then, the SQL statement is executed after the target database is connected, and the data preparation required by the table can be completed.
In one embodiment, the actual test data of the test automation test script is packaged into a request message. The main flow is to store all input fields and their data into the request transaction message. Taking a request message in a commonly used Map format as an example, if the current message needs to include fields such as an event number event _ no, a card number medium _ no, and a card password, the following steps are required:
put(event_no,”040402001024901091919000008”);
put(medium_no,6222080200001137507);
put ("c 58a93dd34fe5f 13") mode assigns data for its fields and stores in the Input object.
And automatically sending a request message to a tested interface of the test environment to perform test calling. An example of an Input request message is as follows.
Figure BDA0003183800410000072
After the transaction request is called, the return information (response message) of the transaction can be obtained, the return information in the MAP format can be generally obtained through deserialization preprocessing, and the specific content of each field in the transaction return information can be obtained by combining the definition of the interface Output return field. An Output return message example is as follows.
Figure BDA0003183800410000073
Figure BDA0003183800410000081
After the processing, the transaction state shift field of the response message can be analyzed to be 0, the return code return _ code field is 0, and the other fields are similar.
In an embodiment, parsing the response packet according to the basic definition of each field of the preset database table, as shown in fig. 3, includes:
s301: and splitting fields of the response message.
S302: and obtaining the basic definition of each field in the response message through the preset basic definition of each field of the database table.
In one embodiment, the basic definition of each field in the response message is obtained by analyzing the response message and the metadata definition of the database table by using the basic definition of each field in the database table. Wherein, the basic definition of each field of the response message is the detailed definition of the Output of the interface to be tested; the base definition of the fields of the database table may use a preset database table definition.
In an embodiment, determining whether the execution result value in the analyzed response message is consistent with the test result target value, as shown in fig. 4, includes:
s401: and inquiring a corresponding execution result value from the response message according to the acquired automatic test condition.
S402: and comparing the execution result value with the test result target value originally corresponding to the automatic test condition to obtain a comparison result.
In one embodiment, the expected target value and the execution result value in the response message are obtained first, for example, the data satisfying the condition that the account number ACCNO is '02000620019846766' for the account number of the current passbook is inquired that the currency exchange flag cashiexf is 0. Then the operation for the assertion decision of table 3 below is defined as:
TABLE 3
Figure BDA0003183800410000082
The conditional query definition is parsed into actual SQL statements:
select CASHEXF from table_acc where ACCNO=’02000620019846766’;
and then, executing the SQL statement after connecting with a target database to obtain a TRUE value of a currency collection mark CASHEXF, judging whether the TRUE value is an expected 0, if the TRUE value is equal to the expected 0, returning to TRUE, namely, the assertion is successful, and otherwise, returning to FALSE, namely, the assertion is failed. For complex assertion judgment logic, for example, if an account balance needs to be obtained before a transaction, an account balance is obtained after the transaction, and the balance after the transaction is judged to be the balance before the transaction plus the transaction amount, the following table 4 may be defined:
TABLE 4
Figure BDA0003183800410000091
The operation flow for this is as follows: all use SQL statements
select BALANCE from table_acc where ACCNO=’02000620019846766’;
Firstly, before the transaction is called, the SQL statement is executed after the target database is connected, and the account balance before the transaction is obtained; then, after the transaction is started and finished, the SQL statement is executed after the target database is connected, and the account balance after the transaction is obtained; and then judging whether the account balance before the transaction is equal to the account balance after the transaction by adding the actual occurrence amount of the transaction, namely the value corresponding to the variable { transaction amount }, if so, returning to TRUE, namely, the assertion is successful, otherwise, returning to FALSE, namely, the assertion is failed.
In one embodiment, the automated testing method based on independent modules further includes:
and updating the function test cases in the function test case library in real time according to the comparison result of the execution result value and the test result target value of the automatic test.
In a specific embodiment, the automatic test script is automatically converted into a function test case library, the result state of the function test case is fed back in real time in the automatic test process, and meanwhile, the function of generating the automatic script through visual combination configuration is provided. And in the automatic case operation process, the actual test results of the corresponding cases in the functional test case library are updated in a linkage manner. If the automated testing script data of counter-personal deposit certification-commission of number D100010 is judged to be successful by executing the assertion, the testing result of the testing case corresponding to the functional testing case library is automatically set as testing success. And for the data preparation function control and the assertion judgment function control of the independent database table, screening and displaying on an interface for assembling and configuring into a required automatic test script. For example, an automated test script for a deposit transaction is written to complete the input and output and specific input data values of the deposit transaction to be tested, and then the data preparation function control for the parameter table AAA and the assertion judgment function control for the account table BBB can be pulled, thereby completing a complete automated test script.
Based on the same inventive concept, the embodiment of the present application further provides an automated testing apparatus based on an independent module, which can be used to implement the method described in the above embodiments, as described in the following embodiments. The principle of solving the problems of the automatic testing device based on the independent module is similar to the automatic testing method based on the independent module. As used hereinafter, the term "unit" or "module" may be a combination of software and/or hardware that implements a predetermined function. While the system described in the embodiments below is preferably implemented in software, implementations in hardware, or a combination of software and hardware are also possible and contemplated.
According to the second aspect of the present application, there is also provided an automated testing device based on independent modules, as shown in fig. 5, comprising:
a transaction message generating unit 501, configured to generate a test transaction request message according to the obtained modified automated test condition and the corresponding test result target value, and send the test transaction request message to the test end, so that the test end executes a test according to the test transaction request message and returns a response message; the test transaction request message comprises an automatic test script;
a response message parsing unit 502, configured to parse a response message according to a basic definition of each field of a preset database table;
the judging unit 503 is configured to judge whether an execution result value in the analyzed response message is consistent with a test result target value, and if so, convert the automated test script into a functional test case and store the functional test case.
In an embodiment, retesting is performed on the modified automated test conditions, the modified conditions and expected test results (test result target values) are firstly acquired, then the modified conditions and the expected test results are packaged to generate a test transaction request message and sent to a test terminal, and the expected test results are used for verifying whether the results obtained by the final test execution meet expectations. And when the test end executes the test, returning a response message, wherein the response message comprises an execution result, analyzing the response message to obtain an execution result value, and comparing the execution result value with the target value of the test result to determine whether the execution result value is consistent with the target value of the test result.
In an embodiment, as shown in fig. 6, the transaction message generating unit 501 includes:
an obtaining module 601, configured to obtain modified automatic test conditions and test result target values;
an automated test script conversion module 602, configured to convert the automated test conditions and the test result target values into automated test scripts according to the basic definition of the preset field;
the transaction request message generating module 603 is configured to package the automation test script to generate a test transaction request message.
In an embodiment, as shown in fig. 7, the response packet parsing unit 502 includes:
a field splitting module 701, configured to split a field of the response packet;
and the analysis module 702 is configured to obtain the basic definition of each field in the response message through the basic definition of each field in the preset database table.
In one embodiment, as shown in fig. 8, the determining unit 503 includes:
a query module 801, configured to query a corresponding execution result value from the response message according to the obtained automatic test condition;
the comparison module 802 is configured to compare the execution result value with a test result target value originally corresponding to the automatic test condition to obtain a comparison result.
In one embodiment, the automated testing device based on independent modules further comprises:
and the case base updating unit is used for updating the function test cases in the function test case base in real time according to the comparison result of the execution result value of the automatic test and the test result target value.
The method and the device provided by the application enable complex functions of data preparation, assertion judgment and the like to be independent of the automatic test script, and provide visual configuration mode association combination. The method and the device provided by the application have the following advantages:
1. the problem that the automatic test script has too many bearing functions is solved. The modules such as data preparation, transaction test, assertion judgment and the like are standardized and independent by disassembling the functional modules required by the automatic test script, so that the script is focused on business realization, the data preparation is focused on preposition preparation, the assertion is focused on business verification, and the functions of the modules are clear and exert the maximum effect.
2. The problem of the lack of linkage of automatic test script and functional test case base is solved. And automatically converting the automatic script into a function test case, and feeding back the result state of the function test case in real time in the automatic test process.
3. Functionality is provided for visualizing configuration generation automation scripts. When compiling the automatic test script, only the building blocks are needed, and the corresponding data preparation and assertion judgment functions are associated, so that the development cost of the automatic test script is effectively reduced.
4. Assets declared by automated testing are refined. The reusable assertions are all promoted to be public assertions, and the assertion functions originally scattered in each automatic test script are used as asset accumulation and are provided for all automatic test script writers to share and use, so that the reuse rate is improved, and the test efficiency is improved.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The principle and the implementation mode of the invention are explained by applying specific embodiments in the invention, and the description of the embodiments is only used for helping to understand the method and the core idea of the invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.
An embodiment of the present application further provides a specific implementation manner of an electronic device capable of implementing all steps in the method in the foregoing embodiment, and referring to fig. 9, the electronic device specifically includes the following contents:
a processor (processor)901, a memory 902, a communication Interface (Communications Interface)903, a bus 904, and a nonvolatile memory 905;
the processor 901, the memory 902 and the communication interface 903 complete mutual communication through the bus 904;
the processor 901 is configured to call the computer programs in the memory 902 and the nonvolatile memory 905, and when the processor executes the computer programs, the processor implements all the steps in the method in the foregoing embodiments, for example, when the processor executes the computer programs, the processor implements the following steps:
s101: generating a test transaction request message according to the obtained modified automatic test conditions and the corresponding test result target value, and sending the test transaction request message to the test end, so that the test end executes the test according to the test transaction request message and returns a response message; the test transaction request message includes an automated test script.
S102: and analyzing the response message according to the preset basic definition of each field of the database table.
S103: and judging whether the execution result value in the analyzed response message is consistent with the target value of the test result, if so, converting the automatic test script into a functional test case and storing the functional test case.
Embodiments of the present application also provide a computer-readable storage medium capable of implementing all the steps of the method in the above embodiments, where the computer-readable storage medium stores thereon a computer program, and the computer program when executed by a processor implements all the steps of the method in the above embodiments, for example, the processor implements the following steps when executing the computer program:
s101: generating a test transaction request message according to the obtained modified automatic test conditions and the corresponding test result target value, and sending the test transaction request message to the test end, so that the test end executes the test according to the test transaction request message and returns a response message; the test transaction request message includes an automated test script.
S102: and analyzing the response message according to the preset basic definition of each field of the database table.
S103: and judging whether the execution result value in the analyzed response message is consistent with the target value of the test result, if so, converting the automatic test script into a functional test case and storing the functional test case.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the hardware + program class embodiment, since it is substantially similar to the method embodiment, the description is simple, and the relevant points can be referred to the partial description of the method embodiment. Although embodiments of the present description provide method steps as described in embodiments or flowcharts, more or fewer steps may be included based on conventional or non-inventive means. The order of steps recited in the embodiments is merely one manner of performing the steps in a multitude of orders and does not represent the only order of execution. When an actual apparatus or end product executes, it may execute sequentially or in parallel (e.g., parallel processors or multi-threaded environments, or even distributed data processing environments) according to the method shown in the embodiment or the figures. The terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, the presence of additional identical or equivalent elements in a process, method, article, or apparatus that comprises the recited elements is not excluded. For convenience of description, the above devices are described as being divided into various modules by functions, and are described separately. Of course, in implementing the embodiments of the present description, the functions of each module may be implemented in one or more software and/or hardware, or a module implementing the same function may be implemented by a combination of multiple sub-modules or sub-units, and the like. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, 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. The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks. As will be appreciated by one skilled in the art, embodiments of the present description may be provided as a method, system, or computer program product. Accordingly, embodiments of the present description may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present description may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and so forth) having computer-usable program code embodied therein. The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment. In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of an embodiment of the specification. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction. The above description is only an example of the embodiments of the present disclosure, and is not intended to limit the embodiments of the present disclosure. Various modifications and variations to the embodiments described herein will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the embodiments of the present specification should be included in the scope of the claims of the embodiments of the present specification.

Claims (12)

1. An automated testing method based on an independent module is characterized by comprising the following steps:
generating a test transaction request message according to the obtained modified automatic test conditions and the corresponding test result target value, and sending the test transaction request message to the test end, so that the test end executes the test according to the test transaction request message and returns a response message; the test transaction request message comprises an automatic test script;
analyzing the response message according to the basic definition of each field of a preset database table;
and judging whether the execution result value in the analyzed response message is consistent with the test result target value, if so, converting the automatic test script into a functional test case and storing the functional test case.
2. The automated testing method based on independent modules according to claim 1, wherein the generating of the test transaction request message according to the obtained modified automated testing conditions and the test result target value comprises:
acquiring the modified automatic test conditions and the test result target values;
converting the automatic test conditions and the test result target values into automatic test scripts according to the basic definition of the preset fields;
and packaging the automatic test script to generate the test transaction request message.
3. The automated testing method based on independent modules according to claim 2, wherein the parsing the response message according to the basic definition of each field of the preset database table comprises:
splitting fields of the response message;
and obtaining the basic definition of each field in the response message through the basic definition of each field of a preset database table.
4. The automated testing method based on independent modules according to claim 3, wherein the determining whether the execution result value in the analyzed response message is consistent with the test result target value comprises:
inquiring a corresponding execution result value from the response message according to the acquired automatic test condition;
and comparing the execution result value with the test result target value originally corresponding to the automatic test condition to obtain a comparison result.
5. The automated independent module-based testing method of claim 4, further comprising:
and updating the function test cases in the function test case library in real time according to the comparison result of the execution result value of the automatic test and the test result target value.
6. An automated testing apparatus based on independent modules, comprising:
the transaction message generating unit is used for generating a test transaction request message according to the obtained modified automatic test condition and the corresponding test result target value and sending the test transaction request message to the test end so that the test end executes the test according to the test transaction request message and returns a response message; the test transaction request message comprises an automatic test script;
the response message analysis unit is used for analyzing the response message according to the basic definition of each field of a preset database table;
and the judging unit is used for judging whether the execution result value in the analyzed response message is consistent with the test result target value, and if so, converting the automatic test script into a functional test case and storing the functional test case.
7. The automated testing device based on independent modules according to claim 6, wherein the transaction message generating unit comprises:
the acquisition module is used for acquiring the modified automatic test conditions and the test result target value;
the automatic test script conversion module is used for converting the automatic test conditions and the test result target values into automatic test scripts according to the basic definition of the preset fields;
and the transaction request message generation module is used for packaging the automatic test script to generate the test transaction request message.
8. The automated testing device based on independent modules according to claim 7, wherein the response message parsing unit comprises:
the field splitting module is used for carrying out field splitting on the response message;
and the analysis module is used for obtaining the basic definition of each field in the response message through the basic definition of each field in a preset database table.
9. The standalone module-based automated testing apparatus of claim 8, wherein the determining unit comprises:
the query module is used for querying a corresponding execution result value from the response message according to the obtained automatic test condition;
and the comparison module is used for comparing the execution result value with the test result target value originally corresponding to the automatic test condition to obtain a comparison result.
10. The standalone module-based automated testing apparatus of claim 9, further comprising:
and the case base updating unit is used for updating the function test cases in the function test case base in real time according to the comparison result of the execution result value of the automatic test and the test result target value.
11. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the steps of the method of automated testing based on independent modules according to any of claims 1 to 5 are implemented when the program is executed by the processor.
12. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the standalone module-based automated testing method of any of claims 1 to 5.
CN202110854959.1A 2021-07-28 2021-07-28 Automatic testing method and device based on independent module Pending CN113485942A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110854959.1A CN113485942A (en) 2021-07-28 2021-07-28 Automatic testing method and device based on independent module

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110854959.1A CN113485942A (en) 2021-07-28 2021-07-28 Automatic testing method and device based on independent module

Publications (1)

Publication Number Publication Date
CN113485942A true CN113485942A (en) 2021-10-08

Family

ID=77943151

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110854959.1A Pending CN113485942A (en) 2021-07-28 2021-07-28 Automatic testing method and device based on independent module

Country Status (1)

Country Link
CN (1) CN113485942A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023116031A1 (en) * 2021-12-24 2023-06-29 百富计算机技术(深圳)有限公司 Message checking method and apparatus, and terminal device and computer-readable storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110941563A (en) * 2019-12-31 2020-03-31 中国银行股份有限公司 Automatic script testing method and device
CN111177005A (en) * 2019-12-31 2020-05-19 中国银行股份有限公司 Service application testing method, device, server and storage medium
CN112988601A (en) * 2021-04-29 2021-06-18 中国工商银行股份有限公司 Test script development method and device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110941563A (en) * 2019-12-31 2020-03-31 中国银行股份有限公司 Automatic script testing method and device
CN111177005A (en) * 2019-12-31 2020-05-19 中国银行股份有限公司 Service application testing method, device, server and storage medium
CN112988601A (en) * 2021-04-29 2021-06-18 中国工商银行股份有限公司 Test script development method and device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023116031A1 (en) * 2021-12-24 2023-06-29 百富计算机技术(深圳)有限公司 Message checking method and apparatus, and terminal device and computer-readable storage medium

Similar Documents

Publication Publication Date Title
CN112800095A (en) Data processing method, device, equipment and storage medium
CN113900958A (en) Test case script generation method, system, medium and electronic device
CN110688828A (en) File processing method and device, file processing system and computer equipment
CN112241360A (en) Test case generation method, device, equipment and storage medium
CN110795697A (en) Logic expression obtaining method and device, storage medium and electronic device
CN107133233B (en) Processing method and device for configuration data query
CN113485942A (en) Automatic testing method and device based on independent module
CN112395182A (en) Automatic testing method, device, equipment and computer readable storage medium
CN111752820A (en) Pressure testing method of gPC interface, computer equipment and storage medium
CN112926008A (en) Method and device for generating form page, electronic equipment and storage medium
CN111506305A (en) Tool kit generation method and device, computer equipment and readable storage medium
CN111414154A (en) Method and device for front-end development, electronic equipment and storage medium
CN112990937B (en) Resource data acquisition method and device, computer equipment and storage medium
CN113157586B (en) Financial market unit test case generation method and device
CN113867700B (en) Model construction method, display platform, server and storage medium
CN106528718B (en) Method and apparatus for processing data from third party
CN115526587A (en) Method and device for generating customs message
CN112131257B (en) Data query method and device
EP4359932A1 (en) In-app failure intelligent data collection and analysis
CN114116509A (en) Program analysis method, program analysis device, electronic device, and storage medium
CN113742235A (en) Method and device for checking codes
CN112597036A (en) Universal baffle testing method and device
CN111400623A (en) Method and apparatus for searching information
CN111142859A (en) Script generation method and device, electronic equipment and storage medium
CN114115833B (en) Automatic protocol audit code generation 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