CN109408370A - Interface testing document generating method, device, computer equipment and storage medium - Google Patents

Interface testing document generating method, device, computer equipment and storage medium Download PDF

Info

Publication number
CN109408370A
CN109408370A CN201811086933.1A CN201811086933A CN109408370A CN 109408370 A CN109408370 A CN 109408370A CN 201811086933 A CN201811086933 A CN 201811086933A CN 109408370 A CN109408370 A CN 109408370A
Authority
CN
China
Prior art keywords
file
interface
parameter information
modified
testing
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
CN201811086933.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.)
OneConnect Smart Technology Co Ltd
Original Assignee
OneConnect Smart Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by OneConnect Smart Technology Co Ltd filed Critical OneConnect Smart Technology Co Ltd
Priority to CN201811086933.1A priority Critical patent/CN109408370A/en
Publication of CN109408370A publication Critical patent/CN109408370A/en
Pending legal-status Critical Current

Links

Classifications

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

Abstract

This application involves a kind of interface testing document generating method, device, computer equipment and storage mediums.The described method includes: obtaining the parameter information of position to be modified corresponding with the parameter information in the testing scheme in the initial Json file;According to the parameter information of parameter information and the position to be modified in the testing scheme, Data Matching file corresponding with the parameter information of the position to be modified is generated;It is modified respectively according to parameter information of the Data Matching file to corresponding position to be modified in the initial Json file, generates multiple target Json files;It is stored using the multiple target Json file as interface testing file.This method is based on artificial intelligence technology, simplifies the generating process of interface testing file, to simplify interface testing process, improves interface testing efficiency, saved human cost.Meanwhile the defect that the process that overcomes traditional artificial manual modification file is comparatively laborious.

Description

Interface testing document generating method, device, computer equipment and storage medium
Technical field
This application involves field of computer technology, more particularly to a kind of interface testing document generating method, device, calculating Machine equipment and storage medium.
Background technique
Interface testing refers to according to test document, writes test case, carrys out a kind of test of test system components interface. With the fast development of computer technology, system becomes increasingly complex, and can no longer meet demand by traditional head end test, is Meets the needs of intervening test as early as possible, interface testing comes into being.
However, most of interface testings at present, generally use JSON data format file as test case, to interface into Row test.After writing JSON data format file, in order to verify the various situations mentioned in interface specification document, need pair JSON data format file is modified, and is usually manually checked the place for needing to modify in file, is modified manually one by one, Each modified file is preserved, as interface testing file, then is submitted in interface testing tool and is tested, with Whether normal verify interface.It is comparatively laborious with the process for generating interface testing file but by manually modifying file, Lead to interface testing low efficiency.
Summary of the invention
Based on this, it is necessary in view of the above technical problems, provide a kind of interface testing that can be improved interface testing efficiency Document generating method, device, computer equipment and storage medium.
A kind of interface testing document generating method, which comprises
The interface specification file and initial Json file of interface to be measured are obtained, includes a variety of surveys in the interface specification file Examination scheme;
Obtain the ginseng of position to be modified corresponding with the parameter information in the testing scheme in the initial Json file Number information;
According to the parameter information of parameter information and the position to be modified in the testing scheme, generate with it is described to be repaired Change the corresponding Data Matching file of parameter information of position;
Believed respectively according to parameter of the Data Matching file to corresponding position to be modified in the initial Json file Breath is modified, and multiple target Json files are generated;
It is stored using the multiple target Json file as interface testing file.
Described obtain in the initial Json file is believed with the parameter in the testing scheme in one of the embodiments, Cease the parameter information of corresponding position to be modified, comprising:
Extract the parameter information in the testing scheme;
Obtain the location tags of the parameter information;
It determines position to be modified corresponding with the location tags in the initial Json file, and obtains described to be repaired Change the parameter information of position.
The parameter information according in the testing scheme and the position to be modified in one of the embodiments, Parameter information generates Data Matching file corresponding with the parameter information of the position to be modified, comprising:
Using the parameter information in the testing scheme as Template Information;
Establish the pass between the parameter information of the position to be modified of the Template Information and the initial Json file Connection relationship;
Data Matching file corresponding with the parameter information of the position to be modified is generated according to the incidence relation.
It is described respectively according to the Data Matching file to right in the initial Json file in one of the embodiments, The parameter information for the position to be modified answered is modified, and multiple target Json files are generated, comprising:
Respectively according to the incidence relation, the parameter information of corresponding position to be modified in the initial Json file is repaired It is changed to the Template Information, generates multiple target Json files.
In one of the embodiments, the method also includes:
Multiple interface testing files of storage are submitted to respectively in interface testing tool, to be surveyed according to the multiple interface Examination file tests the interface to be measured.
It is submitted in interface testing tool respectively by multiple interface testing files of storage in one of the embodiments, Later, further includes:
Obtain the various test results of the interface testing tool output;
By the interface specification file of the interface to be measured and the various test results, it is loaded into according to preset order default Performance test report template in, generate the performance test report of the interface to be measured, and saved.
In one of the embodiments, in the performance test report for generating the interface to be measured, and after being saved, also Include:
It is reported according to the performance test of the interface to be measured, is to have surveyed interface by the interface flag to be measured;
The expected results for obtaining a variety of testing schemes that the interface specification file includes, by the expected results respectively with Corresponding test result is matched, and matching result is obtained;
The exception level for having surveyed interface is determined according to matching result;
Security maintenance instruction corresponding with the exception level is obtained, is instructed according to the security maintenance, has been surveyed to described Interface is safeguarded.
A kind of interface test device, described device include:
Original document obtains module, described to connect for obtaining the interface specification file and initial Json file of interface to be measured Mouth supporting paper includes a variety of testing schemes;
Parameter information obtain module, for obtain in the initial Json file with the parameter information in the testing scheme The parameter information of corresponding position to be modified;
Matching files generation module, for the ginseng according to parameter information and the position to be modified in the testing scheme Number information, generates Data Matching file corresponding with the parameter information of the position to be modified;
File destination generation module, for respectively according to the Data Matching file to corresponding in the initial Json file The parameter information of position to be modified modify, generate multiple target Json files;
Test file memory module, for being deposited using the multiple target Json file as interface testing file Storage.
A kind of computer equipment, including memory and processor, the memory are stored with computer program, the processing Device performs the steps of when executing the computer program
The interface specification file and initial Json file of interface to be measured are obtained, includes a variety of surveys in the interface specification file Examination scheme;
Obtain the ginseng of position to be modified corresponding with the parameter information in the testing scheme in the initial Json file Number information;
According to the parameter information of parameter information and the position to be modified in the testing scheme, generate with it is described to be repaired Change the corresponding Data Matching file of parameter information of position;
Believed respectively according to parameter of the Data Matching file to corresponding position to be modified in the initial Json file Breath is modified, and multiple target Json files are generated;
It is stored using the multiple target Json file as interface testing file.
A kind of computer readable storage medium, is stored thereon with computer program, and the computer program is held by processor It is performed the steps of when row
The interface specification file and initial Json file of interface to be measured are obtained, includes a variety of surveys in the interface specification file Examination scheme;
Obtain the ginseng of position to be modified corresponding with the parameter information in the testing scheme in the initial Json file Number information;
According to the parameter information of parameter information and the position to be modified in the testing scheme, generate with it is described to be repaired Change the corresponding Data Matching file of parameter information of position;
Believed respectively according to parameter of the Data Matching file to corresponding position to be modified in the initial Json file Breath is modified, and multiple target Json files are generated;
It is stored using the multiple target Json file as interface testing file.
Above-mentioned interface testing document generating method, device, computer equipment and storage medium are obtained initial by server The parameter information of position to be modified corresponding with the parameter information in testing scheme in Json file, and the ginseng of binding test scheme Number information, generates Data Matching file corresponding with the parameter information of position to be modified;Respectively according to Data Matching file, to first The parameter information of corresponding position to be modified is modified in beginning Json file, generates multiple target Json files;And it will be multiple Target Json file is stored respectively as interface testing file;It in initial Json file needs to modify without manually checking Place, and modify manually one by one;The generating process of interface testing file is simplified, so that interface testing process is simplified, Interface testing efficiency is improved, human cost has been saved.Meanwhile it avoiding and manually modifying file and be easy lacking for error It falls into, and overcomes the comparatively laborious defect of process of traditional artificial manual modification file.
Detailed description of the invention
Fig. 1 is the application scenario diagram of interface testing document generating method in one embodiment;
Fig. 2 is the flow diagram of interface testing document generating method in one embodiment;
Fig. 3 is corresponding with the parameter information in testing scheme to be modified in initial Json file to obtain in one embodiment The flow diagram of the step of parameter information of position;
Fig. 4 is the flow diagram of interface testing document generating method in another embodiment;
Fig. 5 is the structural block diagram of interface testing file creating apparatus in one embodiment;
Fig. 6 is the internal structure chart of computer equipment in one embodiment.
Specific embodiment
It is with reference to the accompanying drawings and embodiments, right in order to which the objects, technical solutions and advantages of the application are more clearly understood The application is further elaborated.It should be appreciated that specific embodiment described herein is only used to explain the application, not For limiting the application.
Interface testing document generating method provided by the present application, can be applied in application environment as shown in Figure 1.Its In, terminal 110 is communicated with server 120 by network.Terminal 110 is mounted with interface testing tool;Terminal 110 passes through knowledge Other tester chooses operation to interface testing tool, generates the test instruction of interface to be measured, and test instruction is sent to clothes Business device 120.Server 120 is instructed according to test, and the interface specification file and initial Json file, interface for obtaining interface to be measured are said It include a variety of testing schemes in prescribed paper;It obtains corresponding with the parameter information in testing scheme to be modified in initial Json file The parameter information of position, the parameter information in binding test scheme generate data corresponding with the parameter information of position to be modified Matching files;It is repaired respectively according to parameter information of the Data Matching file to corresponding position to be modified in initial Json file Change, obtains multiple target Json files, and store using multiple target Json files as interface testing file.Service Device 120 is also used to for the interface testing file of storage being respectively sent in terminal 110.Interface testing tool root in terminal 110 According to received multiple interface testing files, interface to be measured is tested respectively.Wherein, terminal 110 can be, but not limited to be each Kind personal computer, laptop, smart phone, tablet computer and portable wearable device, server 120 can be with solely The server clusters of the either multiple servers compositions of vertical server is realized.
In one embodiment, it as shown in Fig. 2, providing a kind of interface testing document generating method, applies in this way It is illustrated for server in Fig. 1, comprising the following steps:
Step S201 obtains the interface specification file and initial Json file of interface to be measured, includes in interface specification file A variety of testing schemes.
Interface specification file is a kind of interface testing document, includes a variety of testing schemes, and every kind of testing scheme includes multiple Parameter information and corresponding expected results.Initial Json file is a kind of interface testing use-case template, can be according to testing scheme Initial Json file is accordingly modified.
Terminal is mounted with interface testing tool, by identification tester to the corresponding test interface of interface testing tool Operation is chosen, the test instruction of interface to be measured is generated, test instruction is sent to server.Server is instructed according to test, is obtained The interface specification file and initial Json file for taking interface to be measured, facilitate the subsequent test side for including according to interface specification file Case modifies to initial Json file.
Step S202 obtains the ginseng of position to be modified corresponding with the parameter information in testing scheme in initial Json file Number information.
Server determines corresponding position to be modified in initial Json file according to the parameter information in testing scheme, and Obtain the parameter information of position to be modified.It is corresponding in the initial Json file of automatic identification by the parameter information in testing scheme Position to be modified parameter information, facilitate it is subsequent in initial Json file corresponding position to be modified parameter information carry out Modification, further simplifies interface testing process, improves interface testing efficiency.
Step S203, according to the parameter information of parameter information and position to be modified in testing scheme, generate with it is to be modified The corresponding Data Matching file of the parameter information of position.
Data Matching file is that one kind can replace the parameter information of position to be modified corresponding in initial Json file For the file of the parameter information in testing scheme.Server is according to the parameter of parameter information and position to be modified in testing scheme Information generates corresponding with the parameter information of position to be modified Data Matching file, facilitate it is subsequent according to Data Matching file, it is right The parameter information of corresponding position to be modified is modified in initial Json file, without manually modifying file, to mention High interface testing efficiency.
Step S204 believes according to parameter of the Data Matching file to corresponding position to be modified in initial Json file respectively Breath is modified, and multiple target Json files are obtained.
Target Json file is a kind of test result for being able to verify that interface to be measured, if with the survey in interface specification file The expected results accordant interface test case that examination scheme is mentioned.Server based on data matching files determine initial Json text The parameter information of corresponding position to be modified in part, and the parameter information of position to be modified is replaced with to the parameter in testing scheme Information, to simplify interface testing process, improves interface testing effect without manually individually modifying to file one by one Rate, while having saved human cost.
Step S205 is stored using multiple target Json files as interface testing file.
Server is packaged into corresponding with interface to be measured using multiple target Json files as interface testing file File is stored into local data base, and tester is facilitated to transfer interface testing file, is tested interface to be measured.
In above-mentioned interface testing document generating method, obtained in initial Json file and in testing scheme by server The parameter information of the corresponding position to be modified of parameter information, and the parameter information of binding test scheme generate and position to be modified The corresponding Data Matching file of parameter information;Respectively according to Data Matching file, to corresponding to be repaired in initial Json file The parameter information for changing position is modified, and multiple target Json files are generated;And using multiple target Json files as connecing Mouth test file is stored;Without manually checking the place for needing to modify in initial Json file, and repaired manually one by one Change;The generating process of interface testing file is simplified, to simplify interface testing process, improves interface testing efficiency, is saved About human cost.Meanwhile the defect manually modified file and be easy error is avoided, and overcome traditional artificial hand The comparatively laborious defect of the process of dynamic modification file.
After obtaining initial Json file, in order to verify the test result of interface to be measured, if with interface specification file In the expected results mentioned of testing scheme it is consistent, need to modify to initial Json file.In order to initial Json file It modifies, needs to obtain the parameter information of the corresponding position to be modified of initial Json file.
In one embodiment, as shown in figure 3, obtaining corresponding with the parameter information in testing scheme in initial Json file Position to be modified parameter information the step of include:
Step S301 extracts the parameter information in testing scheme.
Step S302, the location tags for the information that gets parms.
Step S303 determines position to be modified corresponding with location tags in initial Json file, and obtains to be modified The parameter information of position.
Server by the location tags of the parameter information in testing scheme, determine in initial Json file with location tags Corresponding position to be modified, and the parameter information of position to be modified is obtained, facilitate the subsequent parameter according in testing scheme to believe Breath, automatically modifies to the parameter information of corresponding position to be modified in initial Json file, further simplifies interface survey The generating process of examination file improves interface testing efficiency to simplify interface testing process.
It modifies for convenience to the parameter information of the position to be modified of initial Json file, it can be raw by server At Data Matching file corresponding with the parameter information of position to be modified.In one embodiment, above-mentioned steps S203, according to survey The parameter information of parameter information and position to be modified in examination scheme generates data corresponding with the parameter information of position to be modified Matching files, comprising: using the parameter information in testing scheme as Template Information;Establish Template Information and initial Json file Incidence relation between the parameter information of position to be modified;It is generated according to incidence relation corresponding with the parameter information of position to be modified Data Matching file.
Using the parameter information of the position to be modified of initial Json file as information to be modified, by Template Information with it is to be modified Information is associated, and establishes the incidence relation between Template Information and information to be modified.According to incidence relation generate with it is to be repaired Change the corresponding Data Matching file of parameter information of position, it is therefore an objective to, according to the incidence relation in Data Matching file, Ji Keshi The replacement object of the information to be modified and information to be modified that are clipped in initial Json file, i.e. Template Information, and can will be to Modification information replaces with Template Information.
For example, the parameter information of testing scheme is parameter A and parameter B, using parameter A and parameter B as Template Information;Identification Parameter information to the position to be modified of initial Json file is that parameter A1 and parameter B1 (are not required to elsewhere in default document Modify), using parameter A1 and parameter B1 as information to be modified;" parameter A and parameter B " and " parameter A1 and parameter B1 " is carried out Association, and the incidence relation between " parameter A and parameter B " and " parameter A1 and parameter B1 " is established, facilitate subsequent according to association pass System, replaces with " parameter A and parameter B " for " parameter A1 and parameter B1 " in initial Json file automatically.By the Data Matching of generation File is corresponding with the parameter information of corresponding position to be modified in initial Json file, facilitates subsequent according to Data Matching text Part automatically modifies to the parameter information of corresponding position to be modified in initial Json file;Without manually checking in file The parameter information for needing to modify, and modify manually one by one, the generating process of interface testing file is enormously simplified, thus simple Interface testing process is changed, has further improved interface testing efficiency, simultaneously effective reduce human cost.
In one embodiment, above-mentioned steps S204, respectively according to Data Matching file to corresponding in initial Json file The parameter information of position to be modified modify, generate multiple target Json files, comprising:, will respectively according to incidence relation The parameter information of corresponding position to be modified is revised as Template Information in initial Json file, generates multiple target Json files.
Even, multiple Data Matching files can also be ranked up, and obtained in the Data Matching file after sequence Incidence relation;According to the incidence relation in the Data Matching file after sequence, successively to corresponding to be repaired in initial Json file The parameter information for changing position is revised as Template Information, generates multiple target Json files.
Server is according to the Data Matching file of generation, automatically to the ginseng of corresponding position to be modified in initial Json file Number information is modified, and is generated multiple target Json files, is simplified the generating process of interface testing file, facilitates subsequent basis Interface testing file tests interface to be measured, to simplify interface testing process, improves interface testing efficiency, keeps away Manpower-free's manual modification file and be easy error defect.
Multiple target Json files are being obtained, and are being deposited using multiple target Json files as interface testing file After storage, interface testing file can be submitted in interface testing tool, to test interface to be measured.Implement at one In example, interface testing document generating method, further includes: multiple interface testing files of storage are submitted to interface testing work respectively In tool, to be tested according to multiple interface testing files interface to be measured.Interface testing tool is that one kind can be according to interface Test file, whether function or the index for verifying interface to be measured are normal, and export the application program of corresponding test result.Each Interface testing file corresponds to a kind of test result.
For example, extracting the interface IP address to be measured in the interface testing file of storage;Obtain the communication protocol class of interface to be measured Type and communication pattern generate the test request of interface to be measured according to communication protocol type, communication pattern and interface testing file; Test request is sent to interface testing tool, the test request is asked for triggering interface testing tool according to interface testing It asks, interface to be measured corresponding to interface IP address to be measured is tested.
Multiple interface testing files are submitted in interface testing tool by server one by one, convenient to pass through interface testing tool To in interface to be measured function or index test, and export corresponding test result, tester facilitated to be tied according to test Fruit checks whether interface to be measured is normal, further simplifies interface testing process, improves interface testing efficiency.
The various test results of interface to be measured are checked in order to facilitate tester, it can be by server by interface testing work Have the various test results of output, is converted to the performance test report of interface to be measured.In one embodiment, will store it is more After a interface testing file is submitted to respectively in interface testing tool, further includes: obtain the various of interface testing tool output Test result;By the interface specification file of interface to be measured and various test results, preset performance is loaded into according to preset order In test report template, the performance test report of interface to be measured is generated, and is saved.Tester is facilitated to pass through interface to be measured Performance test report, the normal condition of interface to be measured is assessed, to take corresponding maintenance measure in time.
For example, the various testing schemes in interface specification file are combined with corresponding test result, formed multiple Subfile;Multiple subfiles are numbered respectively, and the sequence by multiple subfiles according to number from small to large, are successively loaded Into preset performance test report template, the performance test report of interface to be measured is generated;By the performance test report of interface to be measured It accuses, according to the identification number classification storage of interface to be measured into local data base.Even, timely in order to further facilitate tester The relevant information of interface to be measured is monitored, mobile terminal identification can be obtained by server, according to mobile terminal identification, Performance test report is sent to corresponding mobile terminal, tester is facilitated to check the performance of interface to be measured by mobile terminal Test report meets the demand that tester is whenever and wherever possible monitored the relevant information of interface to be measured.
In one embodiment, as shown in figure 4, providing another interface testing document generating method, including following step It is rapid:
Step S401 obtains the interface specification file and initial Json file of interface to be measured, includes in interface specification file A variety of testing schemes.
Step S402 obtains the ginseng of position to be modified corresponding with the parameter information in testing scheme in initial Json file Number information.
Step S403, according to the parameter information of parameter information and position to be modified in testing scheme, generate with it is to be modified The corresponding Data Matching file of the parameter information of position.
Step S404 believes according to parameter of the Data Matching file to corresponding position to be modified in initial Json file respectively Breath is modified, and multiple target Json files are generated.
Step S405 is stored using multiple target Json files as interface testing file.
Multiple interface testing files of storage are submitted in interface testing tool, according to multiple by step S406 respectively Interface testing file tests interface to be measured.
Step S407 obtains the various test results of interface testing tool output;By the interface specification file of interface to be measured With various test results, it is loaded into preset performance test report template according to preset order, generates the performance of interface to be measured Test report, and saved.
Above-mentioned interface testing document generating method modifies to initial Json file according to Data Matching file, generates Multiple target Json files, store target Json file as interface testing file, and multiple interfaces of storage are surveyed Examination file is submitted to respectively in interface testing tool, to be tested according to multiple interface testing files interface to be measured, is not necessarily to It manually checks the place for needing to modify in initial Json file, and modifies manually one by one;Simplify interface testing file Generating process improves interface testing efficiency, has saved human cost to simplify interface testing process, avoids artificial Manual modification file and be easy error defect.Meanwhile it is defeated according to the interface specification file and interface testing tool of interface to be measured Various test results out, generate the performance test report of interface to be measured, and are saved, and facilitate tester to interface to be measured Performance test report checked, assessed with the performance to interface to be measured.
In one embodiment, in the performance test report for generating interface to be measured, and after being saved, further includes: root It is reported according to the performance test of interface to be measured, is to have surveyed interface by interface flag to be measured;Obtain interface specification file include it is a variety of Expected results are matched with corresponding test result respectively, obtain matching result by the expected results of testing scheme;According to The exception level for having surveyed interface is determined with result;Security maintenance instruction corresponding with exception level is obtained, is referred to according to security maintenance It enables, is safeguarded to interface has been surveyed.For example, the expected results of testing scheme are matched with corresponding test result respectively; If mismatching, test result is analyzed, according to the corresponding relationship of test result and exception level, determines and has surveyed exception of interface etc. Grade.
Import to be measured is marked, facilitates the interface that will have obtained performance test report and performance test has not been obtained and report Interface distinguish, avoid repeat interface to be measured is tested.Meanwhile by the performance test for having surveyed interface report into Row analysis, can determine the test result for having surveyed interface, if the expected knot mentioned with the testing scheme in interface specification file Fruit is consistent, so that it is determined that having surveyed the exception level of interface, and corresponding security maintenance is taken to instruct, security maintenance is instructed and is sent To having surveyed interface, to safeguard to having surveyed interface, unnecessary consequence is avoided the occurrence of.
It should be understood that although each step in the flow chart of Fig. 2-4 is successively shown according to the instruction of arrow, These steps are not that the inevitable sequence according to arrow instruction successively executes.Unless expressly stating otherwise herein, these steps Execution there is no stringent sequences to limit, these steps can execute in other order.Moreover, at least one in Fig. 2-4 Part steps may include that perhaps these sub-steps of multiple stages or stage are not necessarily in synchronization to multiple sub-steps Completion is executed, but can be executed at different times, the execution sequence in these sub-steps or stage is also not necessarily successively It carries out, but can be at least part of the sub-step or stage of other steps or other steps in turn or alternately It executes.
In one embodiment, as shown in figure 5, providing a kind of interface testing file creating apparatus, comprising: original document Obtain module 510, parameter information acquisition module 520, matching files generation module 530, file destination generation module 540 and test File storage module 550, in which:
Original document obtains module 510, for obtaining the interface specification file and initial Json file of interface to be measured, interface Supporting paper includes a variety of testing schemes.
Parameter information obtains module 520, corresponding with the parameter information in testing scheme in initial Json file for obtaining Position to be modified parameter information.
Matching files generation module 530, for being believed according to the parameter of parameter information and position to be modified in testing scheme Breath generates Data Matching file corresponding with the parameter information of position to be modified.
File destination generation module 540, for respectively according to Data Matching file in initial Json file it is corresponding to The parameter information of location revision is modified, and multiple target Json files are generated.
Test file memory module 550, for being deposited using multiple target Json files as interface testing file Storage.
In one embodiment, parameter information obtains module and is also used to extract the parameter information in testing scheme;Obtain ginseng The location tags of number information;It determines position to be modified corresponding with location tags in initial Json file, and obtains to be modified The parameter information of position.
In one embodiment, matching files generation module is also used to believe the parameter information in testing scheme as template Breath;Establish the incidence relation between the parameter information of the position to be modified of Template Information and initial Json file;It is closed according to association System generates Data Matching file corresponding with the parameter information of position to be modified.
In one embodiment, file destination generation module is also used to respectively according to incidence relation, by initial Json file In the parameter information of corresponding position to be modified be revised as Template Information, generate multiple target Json files.
In one embodiment, interface testing file creating apparatus further includes that test file submits module, for that will store Multiple interface testing files be submitted in interface testing tool respectively, with according to multiple interface testing files to interface to be measured into Row test.
In one embodiment, interface testing file creating apparatus further includes report generation module, is mentioned for test file After handing over module that multiple interface testing files of storage are submitted to respectively in interface testing tool, it is defeated to obtain interface testing tool Various test results out;By the interface specification file of interface to be measured and various test results, it is loaded into according to preset order pre- If performance test report template in, generate the performance test report of interface to be measured, and saved.
In one embodiment, interface testing file creating apparatus further includes interface maintenance module, is used for report generation mould Block generates the performance test report of interface to be measured, and after being saved, is reported according to the performance test of interface to be measured, will be to be measured Interface flag is to have surveyed interface;The expected results for obtaining a variety of testing schemes that interface specification file includes, by expected results point It is not matched with corresponding test result, obtains matching result;The exception level for having surveyed interface is determined according to matching result;It obtains It takes security maintenance corresponding with exception level to instruct, is instructed according to security maintenance, safeguarded to interface has been surveyed.
Above-mentioned each embodiment, interface test device are believed by obtaining in initial Json file with the parameter in testing scheme The parameter information of corresponding position to be modified, and the parameter information of binding test scheme are ceased, the parameter with position to be modified is generated The corresponding Data Matching file of information;Respectively according to Data Matching file, to corresponding position to be modified in initial Json file Parameter information modify, generate multiple target Json files;And using multiple target Json files as interface testing File is stored;Without manually checking the place for needing to modify in initial Json file, and modify manually one by one;Simplify The generating process of interface testing file to simplify interface testing process improves interface testing efficiency, has saved manpower Cost.Meanwhile the defect manually modified file and be easy error is avoided, and overcome traditional artificial manual modification text The comparatively laborious defect of the process of part.
Specific restriction about interface testing file creating apparatus may refer to above for interface testing file generated The restriction of method, details are not described herein.Modules in above-mentioned interface testing file creating apparatus can be fully or partially through Software, hardware and combinations thereof are realized.Above-mentioned each module can be embedded in the form of hardware or independently of the place in computer equipment It manages in device, can also be stored in a software form in the memory in computer equipment, in order to which processor calls execution or more The corresponding operation of modules.
In one embodiment, a kind of computer equipment is provided, which can be server, internal junction Composition can be as shown in Figure 6.The computer equipment include by system bus connect processor, memory, network interface and Database.Wherein, the processor of the computer equipment is for providing calculating and control ability.The memory packet of the computer equipment Include non-volatile memory medium, built-in storage.The non-volatile memory medium is stored with operating system, computer program and data Library.The built-in storage provides environment for the operation of operating system and computer program in non-volatile memory medium.The calculating The database of machine equipment is used for memory interface test file.The network interface of the computer equipment is used to pass through with external terminal Network connection communication.To realize a kind of interface testing document generating method when the computer program is executed by processor.
It will be understood by those skilled in the art that structure shown in Fig. 6, only part relevant to application scheme is tied The block diagram of structure does not constitute the restriction for the computer equipment being applied thereon to application scheme, specific computer equipment It may include perhaps combining certain components or with different component layouts than more or fewer components as shown in the figure.
In one embodiment, a kind of computer equipment, including memory and processor are provided, which is stored with Computer program, the processor perform the steps of when executing computer program
The interface specification file and initial Json file of interface to be measured are obtained, includes a variety of test sides in interface specification file Case;
Obtain the parameter information of position to be modified corresponding with the parameter information in testing scheme in initial Json file;
According to the parameter information of parameter information and position to be modified in testing scheme, the parameter with position to be modified is generated The corresponding Data Matching file of information;
It is repaired respectively according to parameter information of the Data Matching file to corresponding position to be modified in initial Json file Change, generates multiple target Json files;
It is stored using multiple target Json files as interface testing file.
In one embodiment, it also performs the steps of and is extracted in testing scheme when processor executes computer program Parameter information;The location tags for the information that gets parms;Determine position to be modified corresponding with location tags in initial Json file It sets, and obtains the parameter information of position to be modified.
In one embodiment, it also performs the steps of when processor executes computer program by the ginseng in testing scheme Number information is as Template Information;Establish the association between the parameter information of the position to be modified of Template Information and initial Json file Relationship;Data Matching file corresponding with the parameter information of position to be modified is generated according to incidence relation.
In one embodiment, it is also performed the steps of when processor executes computer program respectively according to incidence relation, The parameter information of position to be modified corresponding in initial Json file is revised as Template Information, generates multiple target Json texts Part.
In one embodiment, it also performs the steps of when processor executes computer program by multiple interfaces of storage Test file is submitted to respectively in interface testing tool, to be tested according to multiple interface testing files interface to be measured.
In one embodiment, it also performs the steps of when processor executes computer program and is connect by the multiple of storage After mouth test file is submitted to respectively in interface testing tool, the various test results of interface testing tool output are obtained;It will The interface specification file of interface to be measured and various test results are loaded into preset performance test report template according to preset order In, the performance test report of interface to be measured is generated, and saved.
In one embodiment, it is also performed the steps of when processor executes computer program and is generating interface to be measured Performance test report, and after being saved, it is reported according to the performance test of interface to be measured, is to have surveyed to connect by interface flag to be measured Mouthful;The expected results for obtaining a variety of testing schemes that interface specification file includes tie expected results with corresponding test respectively Fruit is matched, and matching result is obtained;The exception level for having surveyed interface is determined according to matching result;It obtains corresponding with exception level Security maintenance instruction, instructed according to security maintenance, safeguarded to interface has been surveyed.
Above-mentioned each embodiment, computer equipment simplify interface testing by the computer program run on processor The generating process of file improves interface testing efficiency, has saved human cost to simplify interface testing process.Meanwhile The defect manually modified file and be easy error is avoided, and overcomes the process ratio of traditional artificial manual modification file Cumbersome defect.
In one embodiment, a kind of computer readable storage medium is provided, computer program is stored thereon with, is calculated Machine program performs the steps of when being executed by processor
The interface specification file and initial Json file of interface to be measured are obtained, includes a variety of test sides in interface specification file Case;
Obtain the parameter information of position to be modified corresponding with the parameter information in testing scheme in initial Json file;
According to the parameter information of parameter information and position to be modified in testing scheme, the parameter with position to be modified is generated The corresponding Data Matching file of information;
It is repaired respectively according to parameter information of the Data Matching file to corresponding position to be modified in initial Json file Change, generates multiple target Json files;
It is stored using multiple target Json files as interface testing file.
In one embodiment, it also performs the steps of and is extracted in testing scheme when computer program is executed by processor Parameter information;The location tags for the information that gets parms;It determines corresponding with location tags to be modified in initial Json file Position, and obtain the parameter information of position to be modified.
In one embodiment, also performing the steps of when computer program is executed by processor will be in testing scheme Parameter information is as Template Information;Establish the pass between the parameter information of the position to be modified of Template Information and initial Json file Connection relationship;Data Matching file corresponding with the parameter information of position to be modified is generated according to incidence relation.
In one embodiment, it also performs the steps of when computer program is executed by processor and is closed respectively according to association System, is revised as Template Information for the parameter information of position to be modified corresponding in initial Json file, generates multiple target Json File.
In one embodiment, it is also performed the steps of when computer program is executed by processor and meets the multiple of storage Mouth test file is submitted to respectively in interface testing tool, to be tested according to multiple interface testing files interface to be measured.
In one embodiment, also performed the steps of when computer program is executed by processor will store it is multiple After interface testing file is submitted to respectively in interface testing tool, the various test results of interface testing tool output are obtained; By the interface specification file of interface to be measured and various test results, preset performance test is loaded into according to preset order and reports mould In plate, the performance test report of interface to be measured is generated, and is saved.
In one embodiment, it is also performed the steps of when computer program is executed by processor and is generating interface to be measured Performance test report, and after being saved, reported according to the performance test of interface to be measured, be to have surveyed by interface flag to be measured Interface;The expected results for obtaining interface specification file a variety of testing schemes for including, by expected results respectively with corresponding test As a result it is matched, obtains matching result;The exception level for having surveyed interface is determined according to matching result;It obtains and exception level pair The security maintenance instruction answered, instructs according to security maintenance, safeguards to interface has been surveyed.
Above-mentioned each embodiment, the computer program that computer readable storage medium is stored by it simplify interface survey The generating process of examination file improves interface testing efficiency, has saved human cost to simplify interface testing process.Together When, the defect manually modified file and be easy error is avoided, and overcome the mistake of traditional artificial manual modification file The comparatively laborious defect of journey.
Those of ordinary skill in the art will appreciate that realizing all or part of the process in above-described embodiment method, being can be with Relevant hardware is instructed to complete by computer program, the computer program can be stored in a non-volatile computer In read/write memory medium, the computer program is when being executed, it may include such as the process of the embodiment of above-mentioned each method.Wherein, To any reference of memory, storage, database or other media used in each embodiment provided herein, Including non-volatile and/or volatile memory.Nonvolatile memory may include read-only memory (ROM), programming ROM (PROM), electrically programmable ROM (EPROM), electrically erasable ROM (EEPROM) or flash memory.Volatile memory may include Random access memory (RAM) or external cache.By way of illustration and not limitation, RAM is available in many forms, Such as static state RAM (SRAM), dynamic ram (DRAM), synchronous dram (SDRAM), double data rate sdram (DDRSDRAM), enhancing Type SDRAM (ESDRAM), synchronization link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic ram (DRDRAM) and memory bus dynamic ram (RDRAM) etc..
Each technical characteristic of above embodiments can be combined arbitrarily, for simplicity of description, not to above-described embodiment In each technical characteristic it is all possible combination be all described, as long as however, the combination of these technical characteristics be not present lance Shield all should be considered as described in this specification.
The several embodiments of the application above described embodiment only expresses, the description thereof is more specific and detailed, but simultaneously It cannot therefore be construed as limiting the scope of the patent.It should be pointed out that coming for those of ordinary skill in the art It says, without departing from the concept of this application, various modifications and improvements can be made, these belong to the protection of the application Range.Therefore, the scope of protection shall be subject to the appended claims for the application patent.

Claims (10)

1. a kind of interface testing document generating method, which comprises
The interface specification file and initial Json file of interface to be measured are obtained, includes a variety of test sides in the interface specification file Case;
Obtain the parameter letter of position to be modified corresponding with the parameter information in the testing scheme in the initial Json file Breath;
According to the parameter information of parameter information and the position to be modified in the testing scheme, generate and the position to be modified The corresponding Data Matching file of the parameter information set;
Respectively according to the Data Matching file to the parameter information of corresponding position to be modified in the initial Json file into Row modification, generates multiple target Json files;
It is stored using the multiple target Json file as interface testing file.
2. the method according to claim 1, wherein it is described obtain in the initial Json file with the test The parameter information of the corresponding position to be modified of parameter information in scheme, comprising:
Extract the parameter information in the testing scheme;
Obtain the location tags of the parameter information;
It determines position to be modified corresponding with the location tags in the initial Json file, and obtains the position to be modified The parameter information set.
3. according to the method described in claim 2, it is characterized in that, the parameter information and institute according in the testing scheme The parameter information of position to be modified is stated, Data Matching file corresponding with the parameter information of the position to be modified is generated, comprising:
Using the parameter information in the testing scheme as Template Information;
The association established between the parameter information of the position to be modified of the Template Information and the initial Json file is closed System;
Data Matching file corresponding with the parameter information of the position to be modified is generated according to the incidence relation.
4. according to the method described in claim 3, it is characterized in that, described respectively according to the Data Matching file to described first The parameter information of corresponding position to be modified is modified in beginning Json file, generates multiple target Json files, comprising:
Respectively according to the incidence relation, the parameter information of corresponding position to be modified in the initial Json file is revised as The Template Information generates multiple target Json files.
5. the method according to claim 1, which is characterized in that the method also includes:
Multiple interface testing files of storage are submitted to respectively in interface testing tool, according to the multiple interface testing text Part tests the interface to be measured.
6. according to the method described in claim 5, it is characterized in that, being submitted to respectively by multiple interface testing files of storage After in interface testing tool, further includes:
Obtain the various test results of the interface testing tool output;
By the interface specification file of the interface to be measured and the various test results, preset property is loaded into according to preset order In energy test report template, the performance test report of the interface to be measured is generated, and is saved.
7. according to the method described in claim 6, it is characterized in that, in the performance test report for generating the interface to be measured, and After being saved, further includes:
It is reported according to the performance test of the interface to be measured, is to have surveyed interface by the interface flag to be measured;
The expected results for obtaining a variety of testing schemes that the interface specification file includes, by the expected results respectively with it is corresponding Test result matched, obtain matching result;
The exception level for having surveyed interface is determined according to matching result;
Security maintenance instruction corresponding with the exception level is obtained, is instructed according to the security maintenance, has surveyed interface to described It is safeguarded.
8. a kind of interface testing file creating apparatus, which is characterized in that described device includes:
Original document obtains module, and interface specification file and initial Json file, the interface for obtaining interface to be measured are said Prescribed paper includes a variety of testing schemes;
Parameter information obtains module, corresponding with the parameter information in the testing scheme in the initial Json file for obtaining Position to be modified parameter information;
Matching files generation module, for being believed according to the parameter of parameter information and the position to be modified in the testing scheme Breath generates Data Matching file corresponding with the parameter information of the position to be modified;
File destination generation module, for respectively according to the Data Matching file in the initial Json file it is corresponding to The parameter information of location revision is modified, and multiple target Json files are generated;
Test file memory module, for being stored using the multiple target Json file as interface testing file.
9. a kind of computer equipment, including memory and processor, the memory are stored with computer program, feature exists In the processor realizes method described in any one of claims 1 to 7 when executing computer program the step of.
10. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the computer program The step of method described in any one of claims 1 to 7 is realized when being executed by processor.
CN201811086933.1A 2018-09-18 2018-09-18 Interface testing document generating method, device, computer equipment and storage medium Pending CN109408370A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811086933.1A CN109408370A (en) 2018-09-18 2018-09-18 Interface testing document generating method, device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811086933.1A CN109408370A (en) 2018-09-18 2018-09-18 Interface testing document generating method, device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN109408370A true CN109408370A (en) 2019-03-01

Family

ID=65464948

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811086933.1A Pending CN109408370A (en) 2018-09-18 2018-09-18 Interface testing document generating method, device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN109408370A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110008204A (en) * 2019-03-12 2019-07-12 平安信托有限责任公司 Detection method, device, computer equipment and the storage medium of the quality of data
CN110083524A (en) * 2019-03-15 2019-08-02 深圳壹账通智能科技有限公司 Upload data test method, apparatus, computer equipment and storage medium
CN110287109A (en) * 2019-06-18 2019-09-27 广州华多网络科技有限公司 Test method, device, computer equipment and its storage medium of protocol interface
CN112069068A (en) * 2020-09-03 2020-12-11 中国平安财产保险股份有限公司 Automatic test data processing method, device, equipment and readable storage medium
CN112100058A (en) * 2020-08-19 2020-12-18 展讯半导体(南京)有限公司 Interface specification detection method and device
CN112565003A (en) * 2020-11-24 2021-03-26 西安四叶草信息技术有限公司 Communication data testing method and device, storage medium and electronic equipment
WO2023000359A1 (en) * 2021-07-19 2023-01-26 长鑫存储技术有限公司 Method and apparatus for configuring test flow, and storage medium and device

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103812726A (en) * 2014-01-26 2014-05-21 烽火通信科技股份有限公司 Automated testing method and device for data communication equipment
US9268672B1 (en) * 2014-05-27 2016-02-23 Amazon Technologies, Inc. Automated test case generation for applications
CN105490881A (en) * 2015-12-09 2016-04-13 北京交控科技股份有限公司 Configurable data interface test method and system
CN106354634A (en) * 2016-08-25 2017-01-25 青岛海信传媒网络技术有限公司 Interface testing method and device
CN106951364A (en) * 2017-02-08 2017-07-14 深圳国泰安教育技术股份有限公司 Method of testing and device
CN107391379A (en) * 2017-07-28 2017-11-24 武汉斗鱼网络科技有限公司 Interface automatic test approach and device
CN107592238A (en) * 2017-08-07 2018-01-16 千寻位置网络有限公司 Automatic test approach and system, service terminal, the memory of interface
CN107656874A (en) * 2017-11-07 2018-02-02 中国银行股份有限公司 A kind of interface test method, device, simulation baffle plate and system
CN107748717A (en) * 2017-09-26 2018-03-02 深圳市牛鼎丰科技有限公司 Automatic interface testing method, device, storage medium and computer equipment
CN108241576A (en) * 2016-12-26 2018-07-03 航天信息股份有限公司 A kind of interface test method and system
CN108415832A (en) * 2018-02-07 2018-08-17 平安科技(深圳)有限公司 Automatic interface testing method, device, equipment and storage medium
CN108509337A (en) * 2018-03-15 2018-09-07 链家网(北京)科技有限公司 The dynamic testing method and device called based on interface

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103812726A (en) * 2014-01-26 2014-05-21 烽火通信科技股份有限公司 Automated testing method and device for data communication equipment
US9268672B1 (en) * 2014-05-27 2016-02-23 Amazon Technologies, Inc. Automated test case generation for applications
CN105490881A (en) * 2015-12-09 2016-04-13 北京交控科技股份有限公司 Configurable data interface test method and system
CN106354634A (en) * 2016-08-25 2017-01-25 青岛海信传媒网络技术有限公司 Interface testing method and device
CN108241576A (en) * 2016-12-26 2018-07-03 航天信息股份有限公司 A kind of interface test method and system
CN106951364A (en) * 2017-02-08 2017-07-14 深圳国泰安教育技术股份有限公司 Method of testing and device
CN107391379A (en) * 2017-07-28 2017-11-24 武汉斗鱼网络科技有限公司 Interface automatic test approach and device
CN107592238A (en) * 2017-08-07 2018-01-16 千寻位置网络有限公司 Automatic test approach and system, service terminal, the memory of interface
CN107748717A (en) * 2017-09-26 2018-03-02 深圳市牛鼎丰科技有限公司 Automatic interface testing method, device, storage medium and computer equipment
CN107656874A (en) * 2017-11-07 2018-02-02 中国银行股份有限公司 A kind of interface test method, device, simulation baffle plate and system
CN108415832A (en) * 2018-02-07 2018-08-17 平安科技(深圳)有限公司 Automatic interface testing method, device, equipment and storage medium
CN108509337A (en) * 2018-03-15 2018-09-07 链家网(北京)科技有限公司 The dynamic testing method and device called based on interface

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
刘汉烨: "面向C/S结构的软件自动化测试工具的设计与实现", 中国优秀硕士学位论文全文数据库信息科技辑 *
叶波;孙俊若;林洁;: "软件接口自动化测试技术研究与实现", 信息化研究, no. 04 *

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110008204A (en) * 2019-03-12 2019-07-12 平安信托有限责任公司 Detection method, device, computer equipment and the storage medium of the quality of data
CN110083524A (en) * 2019-03-15 2019-08-02 深圳壹账通智能科技有限公司 Upload data test method, apparatus, computer equipment and storage medium
CN110287109A (en) * 2019-06-18 2019-09-27 广州华多网络科技有限公司 Test method, device, computer equipment and its storage medium of protocol interface
CN110287109B (en) * 2019-06-18 2023-09-19 广州华多网络科技有限公司 Protocol interface testing method and device, computer equipment and storage medium thereof
CN112100058A (en) * 2020-08-19 2020-12-18 展讯半导体(南京)有限公司 Interface specification detection method and device
CN112069068A (en) * 2020-09-03 2020-12-11 中国平安财产保险股份有限公司 Automatic test data processing method, device, equipment and readable storage medium
CN112565003A (en) * 2020-11-24 2021-03-26 西安四叶草信息技术有限公司 Communication data testing method and device, storage medium and electronic equipment
WO2023000359A1 (en) * 2021-07-19 2023-01-26 长鑫存储技术有限公司 Method and apparatus for configuring test flow, and storage medium and device

Similar Documents

Publication Publication Date Title
CN109408370A (en) Interface testing document generating method, device, computer equipment and storage medium
CN108377240A (en) Exceptional interface detection method, device, computer equipment and storage medium
CN109474578A (en) Message method of calibration, device, computer equipment and storage medium
CN109542712B (en) Server pressure testing method and device, computer equipment and storage medium
CN110134795A (en) Generate method, apparatus, computer equipment and the storage medium of validation problem group
CN110109897A (en) Database script generation method, device, computer equipment and storage medium
CN105068909B (en) A kind of simulation test development platform of embedded memory
US11145386B2 (en) Chip testing method, device, electronic apparatus and computer readable medium
CN109710520A (en) Using the time-consuming test method of starting, device, computer equipment and storage medium
CN110008204A (en) Detection method, device, computer equipment and the storage medium of the quality of data
CN108427613A (en) Exceptional interface localization method, device, computer equipment and storage medium
CN110377454A (en) Data verification method, device, computer equipment and storage medium
CN108400978A (en) Leak detection method, device, computer equipment and storage medium
CN109726134A (en) Interface test method and system
CN110221967A (en) Test data building method, device, computer equipment and storage medium
CN109271987A (en) A kind of digital electric meter number reading method, device, system, computer equipment and storage medium
CN110413512A (en) AB test method, device, computer equipment and storage medium
CN109543073A (en) Enterprise's supply and marketing relation map generation method, device and computer equipment
CN110069364A (en) Spare part data error-correcting method, device, computer equipment and storage medium
CN110377470A (en) IO performance test methods, device and computer equipment based on solid state hard disk
CN107832176A (en) Hard disk pressure automatic test approach and system under a kind of Windows
CN109299009A (en) Data test method, apparatus, computer equipment and storage medium
CN109656817A (en) A kind of automation interface test device and equipment
CN109240856A (en) A kind of storage metadata damage analogy method, device, terminal and storage medium
CN111459796B (en) Automated testing method, apparatus, computer device and 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