CN106815106B - Host interface test method, device, test terminal and system - Google Patents
Host interface test method, device, test terminal and system Download PDFInfo
- Publication number
- CN106815106B CN106815106B CN201710024235.8A CN201710024235A CN106815106B CN 106815106 B CN106815106 B CN 106815106B CN 201710024235 A CN201710024235 A CN 201710024235A CN 106815106 B CN106815106 B CN 106815106B
- Authority
- CN
- China
- Prior art keywords
- interface
- host
- test
- communication area
- length
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/22—Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
- G06F11/2273—Test methods
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/22—Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
- G06F11/2205—Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested
Landscapes
- Engineering & Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer And Data Communications (AREA)
- Debugging And Monitoring (AREA)
Abstract
The invention provides a method, a device, a test terminal and a system for testing a host interface, wherein the method for testing the host interface comprises the following steps: receiving test related information of a test terminal, wherein the test related information comprises test data, an interface name, an interface length and a host interface communication area, and the interface name, the interface length and the host interface communication area are obtained by the test terminal according to interface source code analysis; performing interface test according to the test data and the interface name, the interface length and the host interface communication area in the test related information to generate a host interface output field communication area return result; and storing the returned result of the host interface output field communication area to the host interface output field communication area of the host file. The invention can directly input fields aiming at the interface communication area without the help of special processing flows of other special host programs, and in addition, because the test data of the host interface is that the input fields are completely matched with the interface communication area, the input fields can be randomly set, thereby realizing the comprehensive test of the test scene.
Description
Technical Field
The invention relates to the technical field of computer testing, in particular to a method, a device, a testing terminal and a system for testing a host interface.
Background
In the prior art, a test of a general large host interface needs to run a specific host job, the specific host job recalls a specific host program, the specific host program recalls a specific host interface, and the prepared test data needs to call a special processing branch of the specific host interface in the specific host program to test the specific host interface.
The above test method has the following disadvantages:
the testing method is essentially to indirectly test the host interface through a host program calling the interface. Before testing, a host program for specifically calling the host interface must be developed in advance and called to the host interface through some kind of branch processing. For different host interfaces, different programs and jobs for calling the host interfaces must be developed, and the universality is poor. The test process has difficulty preparing test data, and the prepared test data must call a processing branch to the host interface for a particular host program. The test host interface scenes are incomplete, the input field for calling the host interface by the host program is fixed, and the change test of different input fields in the host interface communication area is very difficult, so the test method can not completely test all scenes called by the host interface.
The prior art can not test different host interfaces in a universal way, and how to test by using a universal method without developing a calling program aiming at a specific host interface is an urgent problem to be solved.
Disclosure of Invention
The embodiment of the invention provides a method, a device, a test terminal and a system for testing a host interface, which are used for omitting a specific processing flow of a specific host program and realizing comprehensive test on a test scene.
The embodiment of the invention provides a host interface test method, which comprises the following steps:
analyzing an interface source code of the interface according to an interface test request to generate an interface name, an interface length and a host interface communication area, wherein the host interface communication area comprises a host interface input field communication area and a host interface output field communication area;
receiving interface test data of the interface, and uploading test related information including the test data, the interface name, the interface length and a host interface communication area to a host through the host interface input field communication area for interface test;
and acquiring a test result of a host interface output field communication area, wherein the host interface output field communication area is obtained by intercepting the host according to the length of the host interface communication area in the host interface communication area.
An embodiment of the present invention provides a test terminal, including:
the source code analysis unit is used for analyzing the interface source code of the interface according to the interface test request to generate an interface name, an interface length and a host interface communication area, wherein the host interface communication area comprises a host interface input field communication area and a host interface output field communication area;
the information uploading unit is used for receiving the interface test data of the interface and uploading test related information comprising the test data, the interface name, the interface length and the host interface communication area to the host through the host interface input field communication area for interface test;
and the result acquisition unit is used for acquiring the test result of the host interface output field communication area, wherein the host interface output field communication area is obtained by intercepting the host according to the host interface communication area.
The embodiment of the invention provides a host interface test method, which comprises the following steps:
receiving test related information uploaded by a test terminal through a host interface input field communication area, wherein the test related information comprises test data, an interface name, an interface length and a host interface communication area, and the interface name, the interface length and the host interface communication area are obtained by the test terminal according to interface source code analysis;
performing interface test according to the test data and the interface name, the interface length and the host interface communication area in the test related information to generate a host interface output field communication area return result;
and storing the returned result of the host interface output field communication area to the host interface output field communication area of the host file.
The embodiment of the invention provides a host interface testing device, which comprises:
the system comprises an information receiving unit, a field communication area and a host interface, wherein the information receiving unit is used for receiving test related information uploaded by a test terminal through a host interface input field communication area, and the test related information comprises test data, an interface name, an interface length and a host interface communication area which are obtained by the test terminal according to interface source code analysis;
the test unit is used for carrying out interface test according to the test data and the interface name, the interface length and the host interface communication area in the test related information to generate a host interface output field communication area return result;
and the result storage unit is used for storing the returned result of the host interface output field communication area to the host interface output field communication area of the host file for the test terminal to obtain.
The embodiment of the invention provides a host interface test system, which comprises:
the test terminal and the test host; the test terminal is connected with the test host;
the test terminal analyzes the interface source code of the interface according to the interface test request to generate an interface name, an interface length and a host interface communication area; receiving interface test data of the interface, and uploading test related information including the test data, the interface name, the interface length and a host interface communication area to a host through a host interface input field communication area for interface test;
the test host comprises: a host data storage device and a host data processing device;
the host data storage device stores the test related information into a fixed-length host file, and the fixed-length host file is created by the test terminal according to the test related information;
the host data processing device reads the fixed-length host file, and obtains the test data and the interface name and the host interface communication area in the test related information; performing interface test according to the test data and the interface name, the interface length and the host interface communication area in the test related information to generate a host interface output field communication area return result; storing a return result of the host interface output field communication area to a host interface output field communication area of the host file for the test terminal to obtain;
the test terminal obtains a test result of a host interface output field communication area, wherein the host interface output field communication area is obtained by the host according to the host interface communication area.
The embodiment of the invention has the following beneficial technical effects:
testing the substantivity: the test data of the host interface can be directly input into the field aiming at the interface communication area without the help of the specific processing flow of other specific host programs, and the preparation of the test data is convenient and direct.
Testing the comprehensiveness of the scene: because the test data of the host interface is that the input field completely matches the interface communication area, the input field can be set arbitrarily, and the test scene can be comprehensively tested.
Universality: the method realizes data input of any host interface through a universal host fixed-length file, analyzes any host interface name and input communication area by utilizing a universal host program, dynamically calls the host interface to obtain an interface output result, and has the universality of calling any interface.
Multi-host interface parallelism: the test data of a plurality of host interfaces can be simultaneously input, the output results of the host interfaces can be dynamically called, and the test of the host interfaces can be realized through one-time test.
Multi-scenario test parallelism: the parallel test of multiple test scenes of the same host interface can be realized through one-time test aiming at multiple test input scenes of the same host interface.
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 a method for testing a host interface according to an embodiment of the present invention;
FIG. 2 is a schematic structural diagram of a test terminal according to an embodiment of the present invention;
FIG. 3 is a schematic structural diagram of a test terminal according to another embodiment of the present invention;
FIG. 4 is a flowchart of a method for testing a host interface according to an embodiment of the present invention;
FIG. 5 is a block diagram of a host interface testing apparatus according to an embodiment of the present invention;
FIG. 6 is a block diagram of a host interface testing apparatus according to an embodiment of the present invention;
FIG. 7 is a block diagram of a test information storage unit according to an embodiment of the present invention;
FIG. 8 is a block diagram of a test information reading unit according to an embodiment of the present invention;
FIG. 9 is a schematic structural diagram of a host interface testing apparatus according to an embodiment of the present invention;
FIG. 10 is a schematic view of a user interface of a test terminal according to an embodiment of the present invention;
fig. 11 is a schematic view of a test result display interface of the test terminal according to the embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are 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.
Fig. 1 is a flowchart of a host interface testing method according to an embodiment of the present invention, and as shown in fig. 1, the host interface testing method includes:
s101: analyzing an interface source code of the interface according to the interface test request to generate an interface name, an interface length and a host interface communication area;
s102: receiving interface test data of the interface, and uploading test related information including the test data, the interface name, the interface length and a host interface communication area to a host for interface test;
s103: and obtaining a test result of a host interface output field communication area, wherein the host interface output field communication area is obtained by intercepting the host according to the host interface communication area.
The main execution body of the host interface test method shown in fig. 1 may be a test terminal, where the test terminal obtains an interface name, an interface length, and a host interface communication area by parsing an interface source code, uploads test related information including the test data, the interface name, the interface length, and the host interface communication area to a host for interface test, and finally obtains a test result returned by a host interface output field communication area. By the method, the test data of the host interface can be directly input into the field aiming at the interface communication area without the help of the specific processing flow of other specific host programs, and the test data is convenient and direct to prepare. In addition, because the test data of the host interface is that the input field completely matches the interface communication area, the input field can be set arbitrarily, and the test scene can be comprehensively tested.
During specific implementation, a tester can input a host interface test request through the test terminal, and according to the host interface test request, the test terminal can analyze the interface source code of the corresponding host interface to obtain the name and the length of the host interface, the name of each element in a host interface communication area, the type of the element data, the length of the host interface communication area and the like, so as to generate a test data input carrier. According to the carrier, the test terminal can receive host interface test data input by a user.
The host interface communication area comprises information such as a host interface input field communication area, a host interface output field communication area and corresponding length, the host interface input field communication area is a unique channel for the test terminal to input test data to the host, and the host interface output field communication area is a unique channel for the test terminal to obtain data (test result) from the host.
In an embodiment, the host interface test data and the information such as the host interface name, the interface length, the element names of the host interface communication areas, the element data types, the host interface communication area length, and the like may be stored in a host file (for short, a fixed-length host file) of a general fixed length of the host, after the host interface test data is received, if the host does not have the fixed-length host file corresponding to the interface, the test terminal may create the fixed-length host file in the host, the test related information is stored in the fixed-length host file, the fixed-length host file corresponds to the interface name, and the host interface name may be specified on the fixed-length host file.
When the S103 is implemented specifically, after the host interface test is completed, the test terminal may obtain the test result through the host interface output field communication area, and the host interface output field communication area may be obtained by the host according to the length of the host interface communication area. The test terminal can analyze the test result and display the test result in various carrier forms such as excel, word, text files and the like.
In S102, the test terminal may receive test data of a plurality of interfaces (A, B, c.. X, Y, Z interfaces, etc.) input by the tester, or may receive a plurality of test data of one interface. The test data can be completely matched with the input field communication area of the host interface, and the data input by the input field communication area can be set by a tester at will so as to meet the requirement of carrying out comprehensive test on all test scenes of the host interface.
The test data of a plurality of host interfaces, corresponding interface names of the interfaces, the length of a host interface input field communication area, a host interface output field communication area and other information can be taken as a whole, a test terminal uploads the information to a host through a host interface input field communication area, the host stores a universal fixed-length host file (for example, the length is set to 10000 bytes, namely, each line of the file records at most not more than 10000 bytes) created by the test terminal as an input file of the interface data, and a position filling space which is not longer than the fixed length is reserved. For example, the first 8 bits of the fixed-length host file may be set as the host interface name, the 9 th to 12 th bits may be set as the host interface communication area length, the rest other positions may be used as the space for storing the host interface communication area, and after the storage of the host interface communication area is completed, the rest space may be assigned with spaces.
Based on the same inventive concept as the host interface test method, the present application provides a test terminal, as described in the following embodiments. Because the principle of solving the problem of the test terminal is similar to the host interface test method, the implementation of the test terminal can refer to the implementation of the host interface test method, and repeated parts are not described again.
Fig. 2 is a schematic structural diagram of a test terminal according to an embodiment of the present invention, and as shown in fig. 2, the test terminal includes: a source code analysis unit 2011, an information uploading unit 2021, and a result obtaining unit 203.
The source code analyzing unit 2011 analyzes the interface source code of the interface according to the interface test request, and generates an interface name, an interface length and a host interface communication area;
the information uploading unit 2021 is configured to receive the interface test data of the interface, and upload test related information including the test data, the interface name, the interface length, and the host interface communication area to the host for interface test;
the result obtaining unit 203 is configured to obtain a test result of a host interface output field communication area, where the host interface output field communication area is obtained by the host according to the host interface communication area.
In one embodiment, as shown in fig. 3, the test terminal further includes: a file creating unit 301, configured to create a fixed-length host file in the host, where the test related information is stored in the fixed-length host file, and the fixed-length host file corresponds to an interface name.
Fig. 4 is a flowchart of a host interface testing method according to an embodiment of the present invention, and as shown in fig. 4, the host interface testing method includes:
s401: receiving test related information uploaded by a test terminal through a host interface input field communication area, wherein the test related information comprises test data, an interface name, an interface length and a host interface communication area, and the interface name, the interface length and the host interface communication area are obtained by the test terminal according to interface source code analysis;
s402: performing interface test according to the test data and the interface name, the interface length and the host interface communication area in the test related information to generate a host interface output field communication area return result;
s403: and storing the returned result of the host interface output field communication area to the host interface output field communication area of the host file.
In this embodiment, the host receives test related information uploaded by the test terminal, performs an interface test according to an interface name, an interface length, and a host interface communication area in the test related information, generates a return result of a host interface output field communication area, and stores the return result in the host interface output field communication area of the host file for the test terminal to obtain. The method can directly aim at the input field of the interface communication area without the help of the specific processing flow of other specific host programs, and in addition, because the test data of the host interface is that the input field is completely matched with the interface communication area, the input field can be set randomly, thereby realizing the comprehensive test of the test scene.
In an embodiment, after the host receives the test related information uploaded by the test terminal through the host interface input field communication area, the test related information can be stored in the fixed-length host file, and the fixed-length host file is created by the test terminal according to the test related information.
If the fixed-length host file corresponding to the interface does not exist in the host, the test terminal can create the fixed-length host file in the host, the test related information is stored in the fixed-length host file, the fixed-length host file corresponds to the interface name, and the host interface name can be appointed on the fixed-length host file. If the fixed-length host file of the corresponding interface does not exist in the host, the test related information can be directly stored in the fixed-length host file without creating a new fixed-length host file.
When storing the test related information to a fixed-length host file, the interface name and the host interface communication area may be allocated to the fixed-length host file according to the interface length and the length of the host interface communication area; according to the position distribution result, the interface name and the host interface communication area can be respectively stored in the fixed-length host file.
A fixed-length host file in a host may store multiple pieces of test data (e.g., test record 1 of host interface a, test record 2 of host interface a, etc.) of the same host interface (e.g., the same host interface a) or multiple pieces of test data of different host interfaces (e.g., host interfaces A, B, c.. X, Y, Z) at the same time. Therefore, the condition of multiple input and output of one interface can be tested at the same time through one test, the condition of multiple input and output of multiple interfaces can also be tested, and the method has great universality.
The length of the general fixed-length host file stored in the host 2 needs to be greater than the maximum value of the general host interface (for example, 10000 bytes is defined, and the host interface with the length of the input/output communication area exceeding 10000 bytes is relatively few and almost none), and the length can store the data of the communication area, the host interface name, the communication area length and the like of the whole input field and output field of the host interface. For the condition of short fixed length of host file, space can be filled, and this method can realize that the input and output communication area can be placed in the general host file as a record for almost all host interfaces. In this way, the purpose of commonly storing almost all host interface test data can be achieved.
In this embodiment, before performing the interface test, the fixed-length host file may be read and analyzed to obtain the test data and the information such as the interface name and the host interface communication area in the test-related information. According to the host interface name, the interface length, the host interface input field communication area and other information, common host operation can be dynamically called to call a general host program to carry out operation test on the specified host interface, the return result of the host interface output field communication area is received, and then the host interface output field communication area to the return result is stored in the fixed-length host file.
In an embodiment, the test data and the interface name and the host interface communication area in the test related information may be obtained from the fixed-length host file according to the distribution result. In specific implementation, the interface name may be obtained according to the distribution position of the interface name, and the length of the host interface communication area may be obtained according to the length of the host interface communication area, and further, the host interface input field communication area and the host interface output field communication area may be intercepted according to the length of the host interface communication area.
For example, the host may call a general host program to read a fixed-length host file, intercept the first 8 bits in the file record as the host interface name, intercept bits 9 to 12 to convert into numbers as the length of the host interface communication area, and intercept the input field communication area and the output field communication area of the subsequent host interface according to the length of the host interface communication area.
After the host interface name and the host interface communication area are obtained, the general host program can dynamically call the host interface (such as the host interface A, B, c.. X, Y, Z) to perform interface test, and write back the result returned by the dynamic host interface to the position of the fixed-length host file output field communication area as the output field communication area for the test terminal to obtain.
With the present embodiment, the following beneficial technical effects can be achieved:
testing the substantivity: the test data of the host interface can be directly input into the field aiming at the interface communication area without the help of the specific processing flow of other specific host programs, and the preparation of the test data is convenient and direct.
Testing the comprehensiveness of the scene: because the test data of the host interface is that the input field completely matches the interface communication area, the input field can be set arbitrarily, and the test scene can be comprehensively tested.
Universality: the method realizes data input of any host interface through a universal host fixed-length file, analyzes any host interface name and input communication area by utilizing a universal host program, dynamically calls the host interface to obtain an interface output result, and has the universality of calling any interface.
Multi-host interface parallelism: the test data of a plurality of host interfaces can be simultaneously input, the output results of the host interfaces can be dynamically called, and the test of the host interfaces can be realized through one-time test.
Multi-scenario test parallelism: the parallel test of multiple test scenes of the same host interface can be realized through one-time test aiming at multiple test input scenes of the same host interface.
Based on the same inventive concept as the above-mentioned host interface testing method, the present application provides a host interface testing apparatus, as described in the following embodiments. Because the principle of the host interface testing device for solving the problems is similar to the host interface testing method, the implementation of the host interface testing device can refer to the implementation of the host interface testing method, and repeated parts are not described again.
Fig. 5 is a block diagram of a host interface testing apparatus according to an embodiment of the present invention, and as shown in fig. 5, the host interface testing apparatus includes: an information receiving unit 501, a test unit 502, and a result storage unit 503.
The information receiving unit 501 is configured to receive test related information uploaded by a test terminal through a host interface input field communication area, where the test related information includes test data, and an interface name, an interface length, and a host interface communication area obtained by the test terminal through interface source code parsing;
the test unit 502 is configured to perform an interface test according to the test data and the interface name, the interface length, and the host interface communication area in the test related information, and generate a host interface output field communication area return result;
the result storage unit 503 is configured to store a result returned by the host interface output field communication area to the host interface output field communication area of the host file, where the result is obtained by the test terminal.
In one embodiment, as shown in fig. 6, the host interface testing apparatus further includes:
a test information storage unit 601, configured to store the test related information into a fixed-length host file, where the fixed-length host file is created by the test terminal according to the test related information;
a test information reading unit 602, configured to read the fixed-length host file, and obtain the test data and the interface name and the host interface communication area in the test related information.
In one embodiment, as shown in fig. 7, the test information storage unit 601 includes:
a position allocation module 701, configured to allocate, according to the interface length and the length of the host interface communication area, the interface name and the host interface communication area at a position of a fixed-length host file respectively;
the test information storage module 702 stores the interface name and the host interface communication area to the fixed-length host file according to the location allocation result.
The test information reading unit 602 may obtain the test data and the interface name and the host interface communication area in the test related information from the fixed-length host file according to the distribution result. In one embodiment, as shown in fig. 8, the test information reading unit 602 includes:
an interface name obtaining module 801, configured to obtain an interface name according to an allocation position of the interface name;
a communication area length obtaining module 802, configured to obtain a length of the host interface communication area according to the host interface communication area;
and a communication area intercepting module 803, configured to intercept a host interface input field communication area and a host interface output field communication area according to the length of the host interface communication area.
With reference to the host interface testing method shown in fig. 4, the following advantageous technical effects can also be achieved by using the present embodiment:
testing the substantivity: the test data of the host interface can be directly input into the field aiming at the interface communication area without the help of the specific processing flow of other specific host programs, and the preparation of the test data is convenient and direct.
Testing the comprehensiveness of the scene: because the test data of the host interface is that the input field completely matches the interface communication area, the input field can be set arbitrarily, and the test scene can be comprehensively tested.
Universality: the method realizes data input of any host interface through a universal host fixed-length file, analyzes any host interface name and input communication area by utilizing a universal host program, dynamically calls the host interface to obtain an interface output result, and has the universality of calling any interface.
Multi-host interface parallelism: the test data of a plurality of host interfaces can be simultaneously input, the output results of the host interfaces can be dynamically called, and the test of the host interfaces can be realized through one-time test.
Multi-scenario test parallelism: the parallel test of multiple test scenes of the same host interface can be realized through one-time test aiming at multiple test input scenes of the same host interface.
Based on the same inventive concept as the host interface testing method of fig. 1 and fig. 4, the present application provides a host interface testing system, as described in the following embodiments. Because the principle of the host interface test system for solving the problems is similar to the host interface test method, the implementation of the host interface test system can refer to the implementation of the host interface test method, and repeated parts are not described again.
Fig. 9 is a schematic structural diagram of a host interface test system according to an embodiment of the present invention, and as shown in fig. 9, the host interface test system includes: the test terminal 100 is connected with the test host 200, and the test terminal 100 is connected with the test host 200.
The test terminal 100 can analyze the interface source code of the interface according to the interface test request to generate an interface name, an interface length and a host interface communication area as a data carrier; and then receiving the interface test data of the interface, and uploading test related information including the test data, the interface name, the interface length and the host interface communication area to the host through the host interface input field communication area for interface test.
As shown in fig. 9, the test host includes: host data storage device 201 and host data processing device 202.
The host data storage device 201 may directly store the test-related information, or may store the test-related information to a fixed-length host file, which is created by the test terminal according to the test-related information.
The host data processing device 202 may read a fixed-length host file, and obtain an interface name and a host interface communication area in the test data and the test related information; calling a general host test program according to the test data and the interface name, the interface length and the host interface communication area in the test related information to perform interface test, and generating a host interface output field communication area return result; finally, the returned result of the host interface output field communication area is stored in the host interface output field communication area of the host file for the test terminal to obtain;
the test terminal 100 may obtain a test result of a host interface output field communication area intercepted by the host according to the host interface communication area.
The present invention will be described with reference to specific examples. The following is an embodiment of a host interface testing method, device, testing terminal and system according to the present invention, and the testing is for testing an interface for calculating a check digit of an account.
Introduction of interface: the PBAPI09 interface is an interface for outputting account check bits by inputting account numbers. The input is a 17-bit long digital bank account, and the output is a 19-bit long character bank account added with 2-bit check bits.
Step 1: the test terminal receives the related test data of the PBAPI09 interface communication area input field input by the user; in this embodiment, the test terminal is named FILE-AID (FILE handling assistant), and the interface provided to the user is as shown in fig. 10.
Step 2: the test terminal automatically analyzes the PBAPI09 interface source code, acquires the interface communication area of PBAPI09, displays the interface communication area into an EXCEL table of interface input test data, inputs the interface name in the EXCEL table ION column, and generates the length and the structure of the interface communication area in the column of 'this kind of request fixed writing comment default value' in a default way without filling. Filling out a bank account 2000100019123456 in a USER-ACCNO column as interface input data; clicking a button of 'uploading to a host in an FTP mode' above an EXCEL table to generate a general host file NGFNASE.C.CBBSC.B001.NBTEST with a fixed length, wherein the length of the general host file NGFNASE.C.CBBSC.B001.NBTEST is 10000 bytes. And can automatically upload the EXCEL filled data to the host file.
And step 3: the host (which may be the host data processing device 202) invokes a general host program through a normal host job to perform an operation test on the designated host interface, the host program being capable of reading the general host file ngfnase.c.cbbsc.b001.nbtest of a fixed length. Intercepting the 1 st to 8 th bits in the file record as the host interface name, wherein the intercepting result is PBAPI09, and then converting the 9 th to 12 th bits of the file record into numbers as the interface length, and the result is 40. And then according to the length of 40, intercepting the 40-bit length from the 13 th subsequent bit in the file record as the input/output communication area space of the interface, and acquiring the input communication area content. According to the host interface PBAPI09 and the interface input/output communication area, the host interface PBAPI09 can be directly called, and the result of interface output can be obtained and stored in the relevant space of the output communication area. And then the communication area containing the output content of the calling interface is written back to the general host fixed-length file in the host (which may be the host data storage device 201).
And 4, step 4: clicking a "start export to EXCEL" button of the test terminal, the generic host fixed-length file in the host (e.g., the host data storage device 201) may be converted into an EXCEL table format to show the output result of the interface call, and the test result is shown in fig. 11: the bank account 2000100019123456 has completed the addition of the account check digit, which becomes 0200010001912345604.
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.
Claims (11)
1. A method for testing a host interface, comprising:
analyzing an interface source code of the interface according to an interface test request to obtain an interface name, an interface length and a host interface communication area, wherein the host interface communication area comprises a host interface input field communication area and a host interface output field communication area;
receiving interface test data of the interface, and uploading test related information including the test data, the interface name, the interface length and a host interface communication area to a host through the host interface input field communication area for interface test;
obtaining a test result of a host interface output field communication area, wherein the host interface output field communication area is obtained by intercepting the host according to the host interface communication area;
creating a fixed-length host file in the host, wherein the test related information is stored in the fixed-length host file, the fixed-length host file corresponds to an interface name, and the length of the fixed-length host file is greater than the maximum value of a general host interface; the fixed-length host file stores a plurality of pieces of test data of the same host interface or a plurality of pieces of test data of different host interfaces at the same time.
2. A test terminal, comprising:
the source code analysis unit is used for analyzing the interface source code of the interface according to the interface test request to obtain an interface name, an interface length and a host interface communication area, wherein the host interface communication area comprises a host interface input field communication area and a host interface output field communication area;
the information uploading unit is used for receiving the interface test data of the interface and uploading test related information comprising the test data, the interface name, the interface length and the host interface communication area to the host through the host interface input field communication area for interface test;
the device comprises a result acquisition unit, a test unit and a test unit, wherein the result acquisition unit is used for acquiring a test result of a host interface output field communication area, and the host interface output field communication area is obtained by intercepting a host according to the host interface communication area;
the file creating unit is used for creating a fixed-length host file in the host, the test related information is stored in the fixed-length host file, the fixed-length host file corresponds to an interface name, and the length of the fixed-length host file is greater than the maximum value of a general host interface; the host file stores a plurality of test data of the same host interface or a plurality of test data of different host interfaces at the same time.
3. A method for testing a host interface, comprising:
receiving test related information uploaded by a test terminal through a host interface input field communication area, wherein the test related information comprises test data, an interface name, an interface length and a host interface communication area, and the interface name, the interface length and the host interface communication area are obtained by the test terminal according to interface source code analysis;
performing interface test according to the test data and the interface name, the interface length and the host interface communication area in the test related information to generate a host interface output field communication area return result;
the host interface output field communication area returns the result to be stored in the host interface output field communication area of the host file;
before the interface test is performed according to the interface name, the interface length and the host interface communication area in the test data and the test related information, the method further comprises the following steps:
storing the test related information to a fixed-length host file, wherein the fixed-length host file is created by the test terminal according to the test related information, and the length of the fixed-length host file is greater than the maximum value of a general host interface; the host file simultaneously stores a plurality of test data of the same host interface or a plurality of test data of different host interfaces;
and reading the fixed-length host file, and acquiring the test data, the interface name in the test related information and a host interface communication area.
4. The host interface test method of claim 3, wherein storing the test-related information to a fixed-length host file comprises:
according to the length of the interface and the length of the host interface communication area, distributing the interface name and the host interface communication area to the position of a fixed-length host file respectively;
and respectively storing the interface name and the host interface communication area to the fixed-length host file according to the position distribution result.
5. The method according to claim 4, wherein the reading the fixed-length host file to obtain the test data and the interface name and the host interface communication area in the test-related information comprises: and acquiring the test data and the interface name and the host interface communication area in the test related information from the fixed-length host file according to the distribution result.
6. The method according to claim 5, wherein the obtaining the test data and the interface name and the host interface communication area in the test related information from the fixed-length host file according to the allocation result comprises:
acquiring the interface name according to the distribution position of the interface name;
acquiring the length of the host interface communication area according to the distribution position of the host interface communication area;
and intercepting a host interface input field communication area and a host interface output field communication area according to the length of the host interface communication area.
7. A host interface test apparatus, comprising:
the system comprises an information receiving unit, a field communication area and a host interface, wherein the information receiving unit is used for receiving test related information uploaded by a test terminal through a host interface input field communication area, and the test related information comprises test data, an interface name, an interface length and a host interface communication area which are obtained by the test terminal according to interface source code analysis;
the test unit is used for carrying out interface test according to the test data and the interface name, the interface length and the host interface communication area in the test related information to obtain a return result of the host interface output field communication area;
the result storage unit is used for storing the returned result of the host interface output field communication area to the host interface output field communication area of the host file for the test terminal to obtain;
the test information storage unit is used for storing the test related information to a fixed-length host file, the fixed-length host file is created by the test terminal according to the test related information, and the length of the fixed-length host file is greater than the maximum value of a general host interface; the host file simultaneously stores a plurality of test data of the same host interface or a plurality of test data of different host interfaces;
and the test information reading unit is used for reading the fixed-length host file and acquiring the test data, the interface name in the test related information and the host interface communication area.
8. The host interface test apparatus of claim 7, wherein the test information storage unit comprises:
the position distribution module is used for respectively distributing the interface name and the host interface communication area to the position of the fixed-length host file according to the interface length and the length of the host interface communication area;
and the test information storage module is used for respectively storing the interface name and the host interface communication area to the fixed-length host file according to the position distribution result.
9. The device according to claim 8, wherein the test information reading unit is specifically configured to: and acquiring the test data and the interface name and the host interface communication area in the test related information from the fixed-length host file according to the distribution result.
10. The host interface test apparatus of claim 9, wherein the test information reading unit comprises:
the interface name acquisition module is used for acquiring the interface name according to the distribution position of the interface name;
a communication area length obtaining module, configured to obtain a length of the host interface communication area according to a distribution position of the host interface communication area;
and the communication area intercepting module is used for intercepting a host interface input field communication area and a host interface output field communication area according to the length of the host interface communication area.
11. A host interface test system, comprising: the test terminal and the test host; the test terminal is connected with the test host;
the test terminal analyzes the interface source code of the interface according to the interface test request to obtain an interface name, an interface length and a host interface communication area; receiving interface test data of the interface, and uploading test related information including the test data, the interface name, the interface length and a host interface communication area to a host through a host interface input field communication area for interface test;
the test host comprises: a host data storage device and a host data processing device;
the host data storage device stores the test related information into a fixed-length host file, and the fixed-length host file is created by the test terminal according to the test related information;
the host data processing device reads the fixed-length host file, and obtains the test data and the interface name and the host interface communication area in the test related information; performing interface test according to the test data and the interface name, the interface length and the host interface communication area in the test related information to generate a host interface output field communication area return result; storing a return result of the host interface output field communication area to a host interface output field communication area of the host file for the test terminal to obtain;
the test terminal acquires a return result of a host interface output field communication area, wherein the host interface output field communication area is obtained by intercepting the host according to the host interface communication area;
creating a fixed-length host file in the host, wherein the test related information is stored in the fixed-length host file, the fixed-length host file corresponds to an interface name, and the length of the fixed-length host file is greater than the maximum value of a general host interface; the fixed-length host file stores a plurality of pieces of test data of the same host interface or a plurality of pieces of test data of different host interfaces at the same time.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710024235.8A CN106815106B (en) | 2017-01-13 | 2017-01-13 | Host interface test method, device, test terminal and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710024235.8A CN106815106B (en) | 2017-01-13 | 2017-01-13 | Host interface test method, device, test terminal and system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106815106A CN106815106A (en) | 2017-06-09 |
CN106815106B true CN106815106B (en) | 2020-12-18 |
Family
ID=59109477
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710024235.8A Active CN106815106B (en) | 2017-01-13 | 2017-01-13 | Host interface test method, device, test terminal and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106815106B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109992521A (en) * | 2019-04-19 | 2019-07-09 | 北京金山云网络技术有限公司 | A kind of test result notification method, device, electronic equipment and storage medium |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN100514994C (en) * | 2005-07-19 | 2009-07-15 | 上海华为技术有限公司 | Communication host computer testing system and method thereof |
CN102479134B (en) * | 2010-11-25 | 2014-03-19 | 上海华虹集成电路有限责任公司 | Method for testing universal interface test system |
CN103136095A (en) * | 2011-11-28 | 2013-06-05 | 阿里巴巴集团控股有限公司 | Method, device and system of test application program interface |
CN103997641A (en) * | 2014-05-23 | 2014-08-20 | 深圳创维数字技术股份有限公司 | Interface detection device and method |
-
2017
- 2017-01-13 CN CN201710024235.8A patent/CN106815106B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN106815106A (en) | 2017-06-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111400387B (en) | Conversion method and device for import and export data, terminal equipment and storage medium | |
CN109117209B (en) | Serialization and deserialization method and device | |
CN109558525B (en) | Test data set generation method, device, equipment and storage medium | |
JP5939123B2 (en) | Execution control program, execution control method, and information processing apparatus | |
US20160283357A1 (en) | Call stack relationship acquiring method and apparatus | |
CN106933835A (en) | The data lead-in method and system of a kind of compatibility parsing Excel file | |
CN111352935B (en) | Index creating method, device and equipment in block chain type account book | |
CN111367976A (en) | Method and device for exporting EXCEL file data based on JAVA reflection mechanism | |
CN109522208B (en) | Page fluency testing method and device, computer device and storage medium | |
CN114546738B (en) | Universal test method, system, terminal and storage medium for server | |
CN107451112B (en) | Form tool data checking method, device, terminal equipment and storage medium | |
CN108460161B (en) | Hierarchical sampling method and device and computer equipment | |
CN106201850A (en) | A kind of compatibility test method and device | |
CN111666201A (en) | Regression testing method, device, medium and electronic equipment | |
CN114357943A (en) | Universal efficient Excel reading processing method, tool, medium and equipment | |
CN109062906B (en) | Translation method and device for program language resources | |
CN114610286A (en) | Development document generation method and device, computer equipment and storage medium | |
CN106815106B (en) | Host interface test method, device, test terminal and system | |
CN110597728A (en) | Method, device and system for constructing test data | |
CN110647371A (en) | Multi-language resource file analysis method and system based on service configuration | |
CN107766519B (en) | Method for visually configuring data structure | |
CN117743145A (en) | Test script generation method and device based on coding template and processing equipment | |
CN112564996B (en) | Pressure test flow scheduling, control method, equipment and computer readable medium | |
CN111143092B (en) | Fault recording data processing method, system and terminal equipment | |
CN115967604A (en) | Message transmission method and device, electronic equipment and computer readable storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |