CN109783350A - Interface test method, device and computer readable storage medium - Google Patents

Interface test method, device and computer readable storage medium Download PDF

Info

Publication number
CN109783350A
CN109783350A CN201811524799.9A CN201811524799A CN109783350A CN 109783350 A CN109783350 A CN 109783350A CN 201811524799 A CN201811524799 A CN 201811524799A CN 109783350 A CN109783350 A CN 109783350A
Authority
CN
China
Prior art keywords
interface
test
user
measured
user terminal
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
CN201811524799.9A
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.)
Chongqing Financial Assets Exchange LLC
Original Assignee
Chongqing Financial Assets Exchange LLC
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 Chongqing Financial Assets Exchange LLC filed Critical Chongqing Financial Assets Exchange LLC
Priority to CN201811524799.9A priority Critical patent/CN109783350A/en
Publication of CN109783350A publication Critical patent/CN109783350A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The present invention relates to functional tests, disclose a kind of interface test method, this method comprises: generating test component configuration interface when receiving the test case creation instruction of user terminal transmission and being sent to the user terminal display;Determine one or more default class that user is selected based on test component configuration interface, and test input parameters, expected results data and the execution condition of setting;The default class that user's selection is called from default class libraries according to one or more default class of calling, test input parameters, expected results data and executes condition generation test suite;It repeats the above steps, until receiving configuration completes instruction, multiple test suites of generation is assembled into test case;The interface to be measured for determining user's selection, tests interface to be measured according to test case and generates test report.The present invention also proposes a kind of interface test device and a kind of computer readable storage medium.The present invention improves the efficiency of interface testing.

Description

Interface test method, device and computer readable storage medium
Technical field
The present invention relates to meter functional test field more particularly to a kind of interface test method, device and computer-readable deposit Storage media.
Background technique
With the development of internet technology, computer software is widely used, and the quality of software is increasingly by enterprise Pay attention to, therefore nowadays software frequently involves various tests.Interface testing is an important branch in software test, and interface is one A little functions predetermined, it is therefore an objective to application program be provided and developer is based on certain software or hardware is able to one group of routine of access Ability.Interface testing is that input data is submitted to interface, and acquisition returns the result and analyzes whether result meets expected test. Therefore, interface testing needs to test user and writes test code, if test case has several hundred even thousands of, needs It takes considerable time and writes test code, once moreover, interface changes, it is also very big to the change amount of test case, it leads Cause the low efficiency of interface testing.
Summary of the invention
The present invention provides a kind of interface test method, device and computer readable storage medium, main purpose and is to mention The efficiency of high interface testing.
To achieve the above object, the present invention also provides a kind of interface test methods, this method comprises:
When receiving the test case creation instruction of user terminal transmission, test component configuration interface is generated, and by institute It states test component configuration interface and is sent to the user terminal and show, wherein the test component configuration interface and default class libraries Association;
One or more for determining that user selected from the default class libraries based on the test component configuration interface is default Class, and the test input parameters based on test suite interface setting, expected results data and execution condition;
One or more default class of user's selection is called from the default class libraries, it is according to the one of calling or more A default class, the test input parameters, expected results data and execution condition generate test suite;
Above-mentioned steps are repeated, until receiving what the user terminal was sent based on the test component configuration interface Instruction is completed in configuration, and multiple test suites of generation are assembled into test case;
The interface to be measured for determining user's selection, tests the interface to be measured according to the test case and generates survey Examination report.
Optionally, the user terminal that ought receive is referred to based on the configuration completion that the test component configuration interface is sent It enables, the step of multiple test suites of generation are assembled into test case includes:
According to the dependence between multiple interfaces to be measured, the transitive relation of the result data between interface to be measured is determined;
According to the transitive relation of the result data, the sequence that executes of multiple test suites is determined, and according to execution sequence The multiple test suite is assembled into the test case.
Optionally, the user terminal that ought receive is referred to based on the configuration completion that the test component configuration interface is sent It enables, the step of multiple test suites of generation are assembled into test case includes:
According to the dependence between multiple interfaces to be measured, the transitive relation of the result data between interface to be measured is determined;
According to the transitive relation of the result data, the sequence that executes of multiple test suites is determined, and according to execution sequence The multiple test suite is assembled into the test case.
Optionally, the described the step of interface to be measured is tested and generates test report according to the test case Include:
The interface to be measured is tested according to the test case, to obtain the reality output number of the test interface According to;
The reality output data and the expected results data are compared, and is generated and is surveyed according to comparing result Examination report.
Optionally, the method also includes steps:
When receiving the use-case modification instruction of user terminal transmission, determine that the use-case modification instructs corresponding test to use Example, and the editing interface for generating the test case is sent to the user terminal;
When receiving the modified survey use-case of user terminal transmission, the test case is updated storage.
In addition, to achieve the above object, the present invention also provides a kind of interface test device, which includes memory and place Device is managed, is stored with the interface testing program that can be run on the processor, the interface testing program quilt in the memory The processor realizes following steps when executing:
When receiving the test case creation instruction of user terminal transmission, test component configuration interface is generated, and by institute It states test component configuration interface and is sent to the user terminal and show, wherein the test component configuration interface and default class libraries Association;
One or more for determining that user selected from the default class libraries based on the test component configuration interface is default Class, and the test input parameters based on test suite interface setting, expected results data and execution condition;
One or more default class of user's selection is called from the default class libraries, it is according to the one of calling or more A default class, the test input parameters, expected results data and execution condition generate test suite;
Above-mentioned steps are repeated, until receiving what the user terminal was sent based on the test component configuration interface Instruction is completed in configuration, and multiple test suites of generation are assembled into test case;
The interface to be measured for determining user's selection, tests the interface to be measured according to the test case and generates survey Examination report.
Optionally, the user terminal that ought receive is referred to based on the configuration completion that the test component configuration interface is sent It enables, the step of multiple test suites of generation are assembled into test case includes:
According to the dependence between multiple interfaces to be measured, the transitive relation of the result data between interface to be measured is determined;
According to the transitive relation of the result data, the sequence that executes of multiple test suites is determined, and according to execution sequence The multiple test suite is assembled into the test case.
Optionally, the step of interface to be measured of determining user's selection includes:
It receives the interface that user sends and selects request, determine whole interfaces of target software, and generate interface selection interface After be sent to the user terminal;
When receiving the interface selection instruction that user is sent based on the interface selection interface, the interface selection is determined One or more corresponding interface is instructed, using one or more of interfaces as interface to be measured.
Optionally, the described the step of interface to be measured is tested and generates test report according to the test case Include:
The interface to be measured is tested according to the test case, to obtain the reality output number of the test interface According to;
The reality output data and the expected results data are compared, and is generated and is surveyed according to comparing result Examination report.
In addition, to achieve the above object, it is described computer-readable the present invention also provides a kind of computer readable storage medium Interface testing program is stored on storage medium, the interface testing program can be executed by one or more processor, with reality Now the step of interface test method as described above.
Interface test method, device and computer readable storage medium proposed by the present invention are sent out when receiving user terminal When the test case creation instruction sent, test component configuration interface is generated, and test component configuration interface is sent to user's end End display, wherein test component configuration interface is associated with default class libraries;Determine that user is based on test component configuration interface, from pre- If one or more default class of class libraries selection, and the test input parameters based on the setting of test suite interface, expected knot Fruit data and execution condition;One or more default class that user's selection is called from default class libraries, according to the one of calling Or multiple default classes, test input parameters, expected results data and execution condition generate test suite;Repeat above-mentioned step Suddenly, instruction is completed based on the configuration that test component configuration interface is sent until receiving user terminal, by multiple tests of generation Component is assembled into test case;The interface to be measured for determining user's selection, is tested and is given birth to interface to be measured according to test case At test report.Interface testing scheme of the invention, user compile when writing test case for interface to be measured without tester Code is write, corresponding self defined class can be selected according to the function of interface to be tested, and sets test input parameters, pre- Phase result data and execution condition generate test suite, and generate a test case, such case by multiple test suites Under, it is also smaller to the change amount of test case even if interface changes, and this scheme is spent greatly without tester The realization for measuring time study correlation function, improves testing efficiency.
Detailed description of the invention
Fig. 1 is the flow diagram for the interface test method that one embodiment of the invention provides;
Fig. 2 is the schematic diagram of internal structure for the interface test device that one embodiment of the invention provides;
The module diagram of interface testing program in the interface test device that Fig. 3 provides for one embodiment of the invention.
The embodiments will be further described with reference to the accompanying drawings for the realization, the function and the advantages of the object of the present invention.
Specific embodiment
It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not intended to limit the present invention.
The present invention provides a kind of interface test method.It is the interface testing that one embodiment of the invention provides shown in referring to Fig.1 The flow diagram of method.This method can be executed by a device, which can be by software and or hardware realization.
In the present embodiment, interface test method includes:
Step S10 generates test component configuration circle when receiving the test case creation instruction of user terminal transmission Face, and the test component configuration interface is sent to the user terminal and is shown, wherein the test component configuration interface with Default class libraries association.
Step S20 determines that user is based on the test component configuration interface, selected from the default class libraries one or Multiple default classes, and the test input parameters based on test suite interface setting, expected results data and execution condition.
Step S30 calls one or more default class of user's selection, according to the one of calling from the default class libraries A or multiple default classes, the test input parameters, expected results data and execution condition generate test suite.
Application program is needed to carry out functional test to its interface, be held by the test case write after the completion of exploitation Row, in implementation of test cases, can call corresponding interface to be measured and run, to realize corresponding function.Therefore, it is necessary to roots According to the function of interface to be tested, test case is targetedly write.The program proposes a kind of interface test method, compiles in advance It finishes writing and presets class required for constituting test case, and establish default class libraries in the server.
Step S40, repeats above-mentioned steps, until receiving the user terminal is based on test component configuration circle Instruction is completed in the configuration that face is sent, and multiple test suites of generation are assembled into test case.
When testing target interface, the default class that can be called directly in default class libraries uses user, without compiling Write code.After receiving the test case creation instruction that user is sent by user terminal, test component configuration interface is generated And be sent to the user terminal display, and the test component configuration interface is associated with above-mentioned default class libraries, user can directly from The default class of needs is called in default class libraries, and test input parameters, expected results data are set on the configuration interface and are held Row condition.After configuration is complete, instruction is completed in triggering test suite creation to user, and the default category information of selection, test are inputted Parameter, expected results data and execution condition are sent to server, and server is according to said one or multiple default classes, test It inputs parameter, expected results data and executes condition and generate test suite.User can establish multiple surveys in this way Component is tried, and is arranged between multiple test suites and executes sequence.For server, institute is based on when receiving user terminal When stating the configuration completion instruction of test component configuration interface transmission, the sequence that executes between the multiple test suite is determined, and The multiple test suite is assembled into test case according to the execution sequence.
In addition, above-mentioned test case is stored into code library, if there is one or more interface to change, Yong Huke To be modified by user terminal to test case, specifically, when receiving the use-case modification instruction of user terminal transmission, Determine that the use-case modification instructs corresponding test case, and the editing interface for generating the test case is sent to the user Terminal;When receiving the modified survey use-case of user terminal transmission, the test case is updated storage.
Step S50 determines the interface to be measured of user's selection, is tested according to the test case the interface to be measured And generate test report.
It being can wrap in one test case containing multiple test suites, a test suite corresponds to an interface to be measured, The test of multiple interfaces to be measured to a software may be implemented in one test case.For example, certain software has login interface and shape State interface, whether the account number cipher that login interface is used to verify user's input is correct, and state interface is for checking that login account is worked as Preceding service condition.Write include test suite A and test suite B test case, setting test suite A for test step on The function of interface is recorded, test suite B is used for the function of test mode interface.Due to the relationship of login account and inquiry business state It can be first to log in and inquire again, therefore, the execution of script sequence can be set to first running test suite A, test of reruning Component B.When running test suite A, login interface is called, and the correct account prestored in test suite A, password transmission are stepped on Interface is recorded, if logging in success, login interface being capable of normal logging program.Meanwhile the login result of the account being sent To test suite B, the service condition in the account is inquired in test suite B request, if it is possible to completely inquire above-mentioned business State, then the function of state interface is intact.
Further, since there are dependences between some interfaces, the output result data of an interface may be another The input data of interface, therefore, when multiple test suite groups are combined into a complete test case, need to consider it is multiple to The dependence between interface is surveyed, specifically, the user terminal that ought receive is sent based on the test component configuration interface Configuration complete instruction, the step of multiple test suites of generation are assembled into test case includes following refinement step:
According to the dependence between multiple interfaces to be measured, the transitive relation of the result data between interface to be measured is determined; According to the transitive relation of the result data, the sequence that executes of multiple test suites is determined, and will be described more according to execution sequence A test suite is assembled into the test case.
Further, the step of interface to be measured of determining user's selection includes following refinement step:
It receives the interface that user sends and selects request, determine whole interfaces of target software, and generate interface selection interface After be sent to the user terminal;
When receiving the interface selection instruction that user is sent based on the interface selection interface, the interface selection is determined One or more corresponding interface is instructed, using one or more of interfaces as interface to be measured.
Further, in one embodiment, described that the interface to be measured is tested simultaneously according to the test case The step of generating test report includes following refinement step:
The interface to be measured is tested according to the test case, to obtain the reality output number of the test interface According to;
The reality output data and the expected results data are compared, and is generated and is surveyed according to comparing result Examination report.
It, can be by a variety of different data comparison sides when comparing reality output data and expected results data Formula.For example, by taking json data key value and value value as an example, including but not limited to following several data comparison situations:
1), type of data structure compares: this mode is suitable for there are certain requirements expected results data value value precision The case where, when the type of the data value value of reality output is identical as the class of expected results data value value, just it is considered as ratio To success, for example, it is contemplated that result data value value is Int type, reality output result is String type, then returns to comparison Failure.
2), data result compares entirely: this mode is suitable for the simple situation of data structure, by expected results data and Key value and value value are compared with the key value and value value of reality output result, if exact matching, returns and compare successfully.
3), data structure compares: if data structure is extremely complex, data are nested more, can be with recursive fashion through row recurrence Key value is found, and every layer of data value value is ignored, and is only carried out the comparison of key value result level and is returned if key value exactly matches It returns and compares successfully.
4), data result sampling fraction pair: this mode is suitable for the case where high-volume data return, and is carried out by sample mode The comparison of data key value and value value is returned and is compared successfully if meeting desired value.
The interface test method that the present embodiment proposes, when receiving the test case creation instruction of user terminal transmission, Test component configuration interface is generated, and test component configuration interface is sent to the user terminal display, wherein test component configuration Interface is associated with default class libraries;Determine that user is based on test component configuration interface, from one or more of default class libraries selection Default class, and the test input parameters based on the setting of test suite interface, expected results data and execution condition;From default class One or more default class that user's selection is called in library, according to one or more default class of calling, test input ginseng Number, expected results data and execution condition generate test suite;Above-mentioned steps are repeated, are based on until receiving user terminal Instruction is completed in the configuration that test component configuration interface is sent, and multiple test suites of generation are assembled into test case;It determines and uses The interface to be measured of family selection, tests interface to be measured according to test case and generates test report.Interface of the invention is surveyed Examination scheme, user write code when writing test case for interface to be measured, without tester, can be connect according to be tested The function of mouth, selects corresponding self defined class, and sets test input parameters, expected results data and execute condition, generates Test suite, and a test case is generated by multiple test suites, in this case, even if interface changes, to test The change amount of use-case is also smaller, and this scheme takes a significant amount of time the realization of study correlation function without tester, Improve testing efficiency.
The present invention also provides a kind of interface test devices.Referring to shown in Fig. 2, surveyed for the interface that one embodiment of the invention provides The schematic diagram of internal structure that trial assembly is set.
In the present embodiment, interface test device 1 can be PC (Personal Computer, PC), can also be with It is the terminal devices such as smart phone, tablet computer, portable computer.The interface test device 1 includes at least memory 11, processing Device 12, network interface 13 and communication bus.
Wherein, memory 11 include at least a type of readable storage medium storing program for executing, the readable storage medium storing program for executing include flash memory, Hard disk, multimedia card, card-type memory (for example, SD or DX memory etc.), magnetic storage, disk, CD etc..Memory 11 It can be the internal storage unit of interface test device 1, such as the hard disk of the interface test device 1 in some embodiments.It deposits Reservoir 11 is also possible in further embodiments on the External memory equipment of interface test device 1, such as interface test device 1 The plug-in type hard disk of outfit, intelligent memory card (Smart Media Card, SMC), secure digital (Secure Digital, SD) Card, flash card (Flash Card) etc..Further, memory 11 can also both include the storage inside of interface test device 1 Unit also includes External memory equipment.Memory 11 can be not only used for the application software that storage is installed on interface test device 1 And Various types of data, such as the code of interface testing program 01 etc., it can be also used for temporarily storing and exported or will be defeated Data out.
Processor 12 can be in some embodiments a central processing unit (Central Processing Unit, CPU), controller, microcontroller, microprocessor or other data processing chips, the program for being stored in run memory 11 Code or processing data, such as execute interface testing program 01 etc..
Network interface 13 optionally may include standard wireline interface and wireless interface (such as WI-FI interface), be commonly used in Communication connection is established between the device 1 and other electronic equipments.
Communication bus is for realizing the connection communication between these components.
Optionally, which can also include user interface, and user interface may include display (Display), input Unit such as keyboard (Keyboard), optional user interface can also include standard wireline interface and wireless interface.It is optional Ground, in some embodiments, display can be light-emitting diode display, liquid crystal display, touch-control liquid crystal display and OLED (Organic Light-Emitting Diode, Organic Light Emitting Diode) touches device etc..Wherein, display can also be appropriate Referred to as display screen or display unit, for being shown in the information handled in interface test device 1 and for showing visually User interface.
Fig. 2 is illustrated only with component 11-13 and the interface test device of interface testing program 01 1, art technology Personnel may include than illustrating more it is understood that structure shown in fig. 1 does not constitute the restriction to interface test device 1 Perhaps more component perhaps combines certain components or different component layouts less.
Optionally, which can also include touch sensor.It is touched provided by the touch sensor for user The region for touching operation is known as touch area.In addition, touch sensor described here can be resistive touch sensor, capacitor Formula touch sensor etc..Moreover, the touch sensor not only includes the touch sensor of contact, proximity may also comprise Touch sensor etc..In addition, the touch sensor can be single sensor, or multiple sensings of array arrangement Device.The area of the display of the device 1 can be identical as the area of the touch sensor, can also be different.Optionally, it will show Show that device and touch sensor stacking are arranged, to form touch display screen.The device 1 is based on touch display screen detecting user's touching The touch control operation of hair.
Optionally, which can also include camera, RF (Radio Frequency, radio frequency) circuit, sensor, sound Frequency circuit, WiFi module etc..Wherein, sensor such as optical sensor, motion sensor and other sensors.Specifically, light Sensor may include ambient light sensor and proximity sensor, wherein if the device 1 is mobile terminal, ambient light sensor can The brightness of display screen is adjusted according to the light and shade of ambient light, proximity sensor can be closed when mobile terminal is moved in one's ear Display screen and/or backlight.As a kind of motion sensor, gravity accelerometer can detect in all directions (generally Three axis) acceleration size, can detect that size and the direction of gravity when static, can be used to identify the application of mobile terminal posture (such as horizontal/vertical screen switching, dependent game, magnetometer pose calibrating), Vibration identification correlation function (such as pedometer, percussion) etc.; Certainly, mobile terminal can also configure the other sensors such as gyroscope, barometer, hygrometer, thermometer, infrared sensor, This is repeated no more.
In 1 embodiment of device shown in Fig. 2, interface testing program 01 is stored in memory 11;Processor 12 executes Following steps are realized when the interface testing program 01 stored in memory 11:
When receiving the test case creation instruction of user terminal transmission, test component configuration interface is generated, and by institute It states test component configuration interface and is sent to the user terminal and show, wherein the test component configuration interface and default class libraries Association.
Determine that user is based on the test component configuration interface, one or more selected from the default class libraries is default Class, and the test input parameters based on test suite interface setting, expected results data and execution condition.
One or more default class of user's selection is called from the default class libraries, it is according to the one of calling or more A default class, the test input parameters, expected results data and execution condition generate test suite.
Application program is needed to carry out functional test to its interface, be held by the test case write after the completion of exploitation Row, in implementation of test cases, can call corresponding interface to be measured and run, to realize corresponding function.Therefore, it is necessary to roots According to the function of interface to be tested, test case is targetedly write.The program proposes a kind of interface test method, compiles in advance It finishes writing and presets class required for constituting test case, and establish default class libraries in the server.
Above-mentioned steps are repeated, until receiving what the user terminal was sent based on the test component configuration interface Instruction is completed in configuration, and multiple test suites of generation are assembled into test case.
When testing target interface, the default class that can be called directly in default class libraries uses user, without compiling Write code.After receiving the test case creation instruction that user is sent by user terminal, test component configuration interface is generated And be sent to the user terminal display, and the test component configuration interface is associated with above-mentioned default class libraries, user can directly from The default class of needs is called in default class libraries, and test input parameters, expected results data are set on the configuration interface and are held Row condition.After configuration is complete, instruction is completed in triggering test suite creation to user, and the default category information of selection, test are inputted Parameter, expected results data and execution condition are sent to server, and server is according to said one or multiple default classes, test It inputs parameter, expected results data and executes condition and generate test suite.User can establish multiple surveys in this way Component is tried, and is arranged between multiple test suites and executes sequence.For server, institute is based on when receiving user terminal When stating the configuration completion instruction of test component configuration interface transmission, the sequence that executes between the multiple test suite is determined, and The multiple test suite is assembled into test case according to the execution sequence.
In addition, above-mentioned test case is stored into code library, if there is one or more interface to change, Yong Huke To be modified by user terminal to test case, specifically, when receiving the use-case modification instruction of user terminal transmission, Determine that the use-case modification instructs corresponding test case, and the editing interface for generating the test case is sent to the user Terminal;When receiving the modified survey use-case of user terminal transmission, the test case is updated storage.
The interface to be measured for determining user's selection, tests the interface to be measured according to the test case and generates survey Examination report.
It being can wrap in one test case containing multiple test suites, a test suite corresponds to an interface to be measured, The test of multiple interfaces to be measured to a software may be implemented in one test case.For example, certain software has login interface and shape State interface, whether the account number cipher that login interface is used to verify user's input is correct, and state interface is for checking that login account is worked as Preceding service condition.Write include test suite A and test suite B test case, setting test suite A for test step on The function of interface is recorded, test suite B is used for the function of test mode interface.Due to the relationship of login account and inquiry business state It can be first to log in and inquire again, therefore, the execution of script sequence can be set to first running test suite A, test of reruning Component B.When running test suite A, login interface is called, and the correct account prestored in test suite A, password transmission are stepped on Interface is recorded, if logging in success, login interface being capable of normal logging program.Meanwhile the login result of the account being sent To test suite B, the service condition in the account is inquired in test suite B request, if it is possible to completely inquire above-mentioned business State, then the function of state interface is intact.
Further, since there are dependences between some interfaces, the output result data of an interface may be another The input data of interface, therefore, when multiple test suite groups are combined into a complete test case, need to consider it is multiple to The dependence between interface is surveyed, specifically, the user terminal that ought receive is sent based on the test component configuration interface Configuration complete instruction, the step of multiple test suites of generation are assembled into test case includes following refinement step:
According to the dependence between multiple interfaces to be measured, the transitive relation of the result data between interface to be measured is determined; According to the transitive relation of the result data, the sequence that executes of multiple test suites is determined, and will be described more according to execution sequence A test suite is assembled into the test case.
Further, the step of interface to be measured of determining user's selection includes following refinement step:
It receives the interface that user sends and selects request, determine whole interfaces of target software, and generate interface selection interface After be sent to the user terminal;
When receiving the interface selection instruction that user is sent based on the interface selection interface, the interface selection is determined One or more corresponding interface is instructed, using one or more of interfaces as interface to be measured.
Further, in one embodiment, described that the interface to be measured is tested simultaneously according to the test case The step of generating test report includes following refinement step:
The interface to be measured is tested according to the test case, to obtain the reality output number of the test interface According to;
The reality output data and the expected results data are compared, and is generated and is surveyed according to comparing result Examination report.
It, can be by a variety of different data comparison sides when comparing reality output data and expected results data Formula.For example, by taking json data key value and value value as an example, including but not limited to following several data comparison situations:
1), type of data structure compares: this mode is suitable for there are certain requirements expected results data value value precision The case where, when the type of the data value value of reality output is identical as the class of expected results data value value, just it is considered as ratio To success, for example, it is contemplated that result data value value is Int type, reality output result is String type, then returns to comparison Failure.
2), data result compares entirely: this mode is suitable for the simple situation of data structure, by expected results data and Key value and value value are compared with the key value and value value of reality output result, if exact matching, returns and compare successfully.
3), data structure compares: if data structure is extremely complex, data are nested more, can be with recursive fashion through row recurrence Key value is found, and every layer of data value value is ignored, and is only carried out the comparison of key value result level and is returned if key value exactly matches It returns and compares successfully.
4), data result sampling fraction pair: this mode is suitable for the case where high-volume data return, and is carried out by sample mode The comparison of data key value and value value is returned and is compared successfully if meeting desired value.
The interface test device that the present embodiment proposes, user are not necessarily to tester when writing test case for interface to be measured Member writes code, can select corresponding self defined class according to the function of interface to be tested, and sets test input ginseng Number, expected results data and execution condition generate test suite, and generate a test case by multiple test suites, this In the case of, it is also smaller to the change amount of test case even if interface changes, and this scheme is spent without tester The realization for taking plenty of time study correlation function, improves testing efficiency.
Optionally, in other examples, interface testing program can also be divided into one or more module, and one A or multiple modules are stored in memory 11, and are held by one or more processors (the present embodiment is by processor 12) For row to complete the present invention, the so-called module of the present invention is the series of computation machine program instruction section for referring to complete specific function, For describing implementation procedure of the interface testing program in interface test device.
It is the program mould of the interface testing program in one embodiment of interface test device of the present invention for example, referring to shown in Fig. 3 Block schematic diagram, in the embodiment, interface testing program can be divided into interface generation module 10, data acquisition module 20, group Part generation module 30, use-case assembling module 40 and interface testing module 50, illustratively:
Interface generation module 10 is used for: when receiving the test case creation instruction of user terminal transmission, generating test Component Configuration interface, and the test component configuration interface is sent to the user terminal and is shown, wherein the test suite Configuration interface is associated with default class libraries;
Data acquisition module 20 is used for: determining that user is based on the test component configuration interface and selects from the default class libraries One or more default class, and the test input parameters based on test suite interface setting, expected results data With the condition of execution;
Component generation module 30 is used for: one or more default class of user's selection is called from the default class libraries, According to one or more default class of calling, the test input parameters, expected results data and execute condition generation test Component;
Use-case assembling module 40 is used for: above-mentioned steps is repeated, until receiving the user terminal is based on the survey It tries the configuration that component Configuration interface is sent and completes instruction, multiple test suites of generation are assembled into test case;
Interface testing module 50 is used for: the interface to be measured of user's selection is determined, according to the test case to described to be measured Interface is tested and generates test report.
Above-mentioned interface generation module 10, data acquisition module 20, component generation module 30, use-case assembling module 40 and interface The program modules such as test module 50 are performed realized functions or operations step and are substantially the same with above-described embodiment, herein not It repeats again.
In addition, the embodiment of the present invention also proposes a kind of computer readable storage medium, the computer readable storage medium On be stored with interface testing program, the interface testing program can be executed by one or more processors, to realize following operation:
When receiving the test case creation instruction of user terminal transmission, test component configuration interface is generated, and by institute It states test component configuration interface and is sent to the user terminal and show, wherein the test component configuration interface and default class libraries Association;
One or more for determining that user selected from the default class libraries based on the test component configuration interface is default Class, and the test input parameters based on test suite interface setting, expected results data and execution condition;
One or more default class of user's selection is called from the default class libraries, it is according to the one of calling or more A default class, the test input parameters, expected results data and execution condition generate test suite;
Above-mentioned steps are repeated, until receiving what the user terminal was sent based on the test component configuration interface Instruction is completed in configuration, and multiple test suites of generation are assembled into test case;
The interface to be measured for determining user's selection, tests the interface to be measured according to the test case and generates survey Examination report.
Computer readable storage medium specific embodiment of the present invention and above-mentioned interface test device and each embodiment of method It is essentially identical, do not make tired state herein.
It should be noted that the serial number of the above embodiments of the invention is only for description, do not represent the advantages or disadvantages of the embodiments.And The terms "include", "comprise" herein or any other variant thereof is intended to cover non-exclusive inclusion, so that packet Process, device, article or the method for including a series of elements not only include those elements, but also including being not explicitly listed Other element, or further include for this process, device, article or the intrinsic element of method.Do not limiting more In the case where, the element that is limited by sentence "including a ...", it is not excluded that including process, device, the article of the element Or there is also other identical elements in method.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side Method can be realized by means of software and necessary general hardware platform, naturally it is also possible to by hardware, but in many cases The former is more preferably embodiment.Based on this understanding, technical solution of the present invention substantially in other words does the prior art The part contributed out can be embodied in the form of software products, which is stored in one as described above In storage medium (such as ROM/RAM, magnetic disk, CD), including some instructions are used so that terminal device (it can be mobile phone, Computer, server or network equipment etc.) execute method described in each embodiment of the present invention.
The above is only a preferred embodiment of the present invention, is not intended to limit the scope of the invention, all to utilize this hair Equivalent structure or equivalent flow shift made by bright specification and accompanying drawing content is applied directly or indirectly in other relevant skills Art field, is included within the scope of the present invention.

Claims (10)

1. a kind of interface test method, which is characterized in that the described method includes:
When receiving the test case creation instruction of user terminal transmission, test component configuration interface is generated, and by the survey Examination component Configuration interface is sent to the user terminal and shows, wherein the test component configuration interface is associated with default class libraries;
Determine one or more default class that user is selected based on the test component configuration interface from the default class libraries, with And test input parameters, expected results data and execution condition based on test suite interface setting;
One or more default class of user's selection is called from the default class libraries, it is pre- according to one or more of calling If class, the test input parameters, expected results data and execution condition generate test suite;
Above-mentioned steps are repeated, until receiving the configuration that the user terminal is sent based on the test component configuration interface Instruction is completed, multiple test suites of generation are assembled into test case;
The interface to be measured for determining user's selection tests the interface to be measured according to the test case and generates test report It accuses.
2. interface test method as described in claim 1, which is characterized in that the user terminal that ought receive is based on the survey Try the step of configuration that component Configuration interface is sent completes instruction, multiple test suites of generation are assembled into test case packet It includes:
According to the dependence between multiple interfaces to be measured, the transitive relation of the result data between interface to be measured is determined;
According to the transitive relation of the result data, the sequence that executes of multiple test suites is determined, and according to execution sequence by institute It states multiple test suites and is assembled into the test case.
3. interface test method as described in claim 1, which is characterized in that the step of the interface to be measured of determining user's selection Suddenly include:
It receives the interface that user sends and selects request, determine whole interfaces of target software, and send out after generating interface selection interface It send to user terminal;
When receiving the interface selection instruction that user is sent based on the interface selection interface, the interface selection instruction is determined One or more corresponding interface, using one or more of interfaces as interface to be measured.
4. interface test method as claimed any one in claims 1 to 3, which is characterized in that described to be used according to the test Example tests the interface to be measured and includes: the step of generating test report
The interface to be measured is tested according to the test case, to obtain the reality output data of the test interface;
The reality output data and the expected results data are compared, and test report is generated according to comparing result It accuses.
5. interface test method as claimed any one in claims 1 to 3, which is characterized in that the method also includes steps:
When receiving the use-case modification instruction of user terminal transmission, determine that the use-case modification instructs corresponding test case, And the editing interface for generating the test case is sent to the user terminal;
When receiving the modified survey use-case of user terminal transmission, the test case is updated storage.
6. a kind of interface test device, which is characterized in that described device includes memory and processor, is stored on the memory There is the interface testing program that can be run on the processor, is realized such as when the interface testing program is executed by the processor Lower step:
When receiving the test case creation instruction of user terminal transmission, test component configuration interface is generated, and by the survey Examination component Configuration interface is sent to the user terminal and shows, wherein the test component configuration interface is associated with default class libraries;
Determine one or more default class that user is selected based on the test component configuration interface from the default class libraries, with And test input parameters, expected results data and execution condition based on test suite interface setting;
One or more default class of user's selection is called from the default class libraries, it is pre- according to one or more of calling If class, the test input parameters, expected results data and execution condition generate test suite;
Above-mentioned steps are repeated, until receiving the configuration that the user terminal is sent based on the test component configuration interface Instruction is completed, multiple test suites of generation are assembled into test case;
The interface to be measured for determining user's selection tests the interface to be measured according to the test case and generates test report It accuses.
7. interface test device as claimed in claim 6, which is characterized in that the user terminal that ought receive is based on the survey Try the step of configuration that component Configuration interface is sent completes instruction, multiple test suites of generation are assembled into test case packet It includes:
According to the dependence between multiple interfaces to be measured, the transitive relation of the result data between interface to be measured is determined;
According to the transitive relation of the result data, the sequence that executes of multiple test suites is determined, and according to execution sequence by institute It states multiple test suites and is assembled into the test case.
8. interface test device as claimed in claim 6, which is characterized in that the step of the interface to be measured of determining user's selection Suddenly include:
It receives the interface that user sends and selects request, determine whole interfaces of target software, and send out after generating interface selection interface It send to user terminal;
When receiving the interface selection instruction that user is sent based on the interface selection interface, the interface selection instruction is determined One or more corresponding interface, using one or more of interfaces as interface to be measured.
9. the interface test device as described in any one of claim 6 to 8, which is characterized in that described to be used according to the test Example tests the interface to be measured and includes: the step of generating test report
The interface to be measured is tested according to the test case, to obtain the reality output data of the test interface;
The reality output data and the expected results data are compared, and test report is generated according to comparing result It accuses.
10. a kind of computer readable storage medium, which is characterized in that be stored with interface survey on the computer readable storage medium Program is tried, the interface testing program can be executed by one or more processor, to realize as any in claim 1 to 5 The step of interface test method described in item.
CN201811524799.9A 2018-12-13 2018-12-13 Interface test method, device and computer readable storage medium Pending CN109783350A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811524799.9A CN109783350A (en) 2018-12-13 2018-12-13 Interface test method, device and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811524799.9A CN109783350A (en) 2018-12-13 2018-12-13 Interface test method, device and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN109783350A true CN109783350A (en) 2019-05-21

Family

ID=66496912

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811524799.9A Pending CN109783350A (en) 2018-12-13 2018-12-13 Interface test method, device and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN109783350A (en)

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110309062A (en) * 2019-05-24 2019-10-08 平安银行股份有限公司 Case generation method, device, electronic equipment and storage medium
CN110609791A (en) * 2019-09-03 2019-12-24 深圳证券交易所 Interface test method, interface test device and storage medium for bidding system
CN110647462A (en) * 2019-08-29 2020-01-03 凡普数字技术有限公司 Interface test method, device and storage medium
CN110825646A (en) * 2019-11-11 2020-02-21 拉扎斯网络科技(上海)有限公司 Test case generation method, interface test method, device and electronic equipment
CN110825618A (en) * 2019-10-10 2020-02-21 重庆金融资产交易所有限责任公司 Method and related device for generating test case
CN111045921A (en) * 2019-10-12 2020-04-21 平安普惠企业管理有限公司 Automatic interface testing method and device, computer equipment and storage medium
CN111242445A (en) * 2020-01-06 2020-06-05 广州熔科机电技术有限公司 Method, device and readable storage medium for testing products based on configuration production line
CN112256595A (en) * 2020-12-22 2021-01-22 成都新希望金融信息有限公司 Heterogeneous system testing method and device and electronic equipment
CN112256572A (en) * 2020-10-21 2021-01-22 海光信息技术股份有限公司 Random test case generation method and device, electronic equipment and storage medium
CN112416746A (en) * 2020-01-21 2021-02-26 上海哔哩哔哩科技有限公司 Test case generation method, device, equipment and medium
CN113282476A (en) * 2021-06-24 2021-08-20 深圳市商汤科技有限公司 Interface performance testing method and device and electronic equipment
CN113360363A (en) * 2020-03-04 2021-09-07 腾讯科技(深圳)有限公司 Test method, device, equipment and computer storage medium for micro service system
WO2022095518A1 (en) * 2020-11-06 2022-05-12 深圳壹账通智能科技有限公司 Automatic interface test method and apparatus, and computer device and storage medium
CN115407184A (en) * 2021-05-28 2022-11-29 合肥本源量子计算科技有限责任公司 Quantum chip testing device and method and quantum computer
CN110309062B (en) * 2019-05-24 2024-05-10 平安银行股份有限公司 Use case generation method, device, electronic equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103559134A (en) * 2013-11-11 2014-02-05 曙光信息产业(北京)有限公司 Configuration method and device for benchmark test component
US20160179659A1 (en) * 2014-12-17 2016-06-23 International Business Machines Corporation Techniques for automatically generating testcases
CN106844187A (en) * 2015-12-04 2017-06-13 北京奇虎科技有限公司 A kind of method for realizing assembly type test system and assembly type test system
CN107766190A (en) * 2017-10-31 2018-03-06 平安科技(深圳)有限公司 Interface test method, device, computer equipment and storage medium
CN107908541A (en) * 2017-07-26 2018-04-13 平安壹钱包电子商务有限公司 Interface test method, device, computer equipment and storage medium
CN107908542A (en) * 2017-07-26 2018-04-13 平安壹钱包电子商务有限公司 Test case creation method, apparatus, computer equipment and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103559134A (en) * 2013-11-11 2014-02-05 曙光信息产业(北京)有限公司 Configuration method and device for benchmark test component
US20160179659A1 (en) * 2014-12-17 2016-06-23 International Business Machines Corporation Techniques for automatically generating testcases
CN106844187A (en) * 2015-12-04 2017-06-13 北京奇虎科技有限公司 A kind of method for realizing assembly type test system and assembly type test system
CN107908541A (en) * 2017-07-26 2018-04-13 平安壹钱包电子商务有限公司 Interface test method, device, computer equipment and storage medium
CN107908542A (en) * 2017-07-26 2018-04-13 平安壹钱包电子商务有限公司 Test case creation method, apparatus, computer equipment and storage medium
CN107766190A (en) * 2017-10-31 2018-03-06 平安科技(深圳)有限公司 Interface test method, device, computer equipment and storage medium

Cited By (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110309062B (en) * 2019-05-24 2024-05-10 平安银行股份有限公司 Use case generation method, device, electronic equipment and storage medium
CN110309062A (en) * 2019-05-24 2019-10-08 平安银行股份有限公司 Case generation method, device, electronic equipment and storage medium
CN110647462A (en) * 2019-08-29 2020-01-03 凡普数字技术有限公司 Interface test method, device and storage medium
CN110609791A (en) * 2019-09-03 2019-12-24 深圳证券交易所 Interface test method, interface test device and storage medium for bidding system
CN110825618A (en) * 2019-10-10 2020-02-21 重庆金融资产交易所有限责任公司 Method and related device for generating test case
CN111045921A (en) * 2019-10-12 2020-04-21 平安普惠企业管理有限公司 Automatic interface testing method and device, computer equipment and storage medium
CN110825646A (en) * 2019-11-11 2020-02-21 拉扎斯网络科技(上海)有限公司 Test case generation method, interface test method, device and electronic equipment
CN111242445A (en) * 2020-01-06 2020-06-05 广州熔科机电技术有限公司 Method, device and readable storage medium for testing products based on configuration production line
CN112416746A (en) * 2020-01-21 2021-02-26 上海哔哩哔哩科技有限公司 Test case generation method, device, equipment and medium
CN113360363A (en) * 2020-03-04 2021-09-07 腾讯科技(深圳)有限公司 Test method, device, equipment and computer storage medium for micro service system
CN113360363B (en) * 2020-03-04 2024-04-02 腾讯科技(深圳)有限公司 Method, device, equipment and computer storage medium for testing micro service system
CN112256572A (en) * 2020-10-21 2021-01-22 海光信息技术股份有限公司 Random test case generation method and device, electronic equipment and storage medium
CN112256572B (en) * 2020-10-21 2023-11-24 海光信息技术股份有限公司 Random test case generation method and device, electronic equipment and storage medium
WO2022095518A1 (en) * 2020-11-06 2022-05-12 深圳壹账通智能科技有限公司 Automatic interface test method and apparatus, and computer device and storage medium
CN112256595A (en) * 2020-12-22 2021-01-22 成都新希望金融信息有限公司 Heterogeneous system testing method and device and electronic equipment
CN115407184A (en) * 2021-05-28 2022-11-29 合肥本源量子计算科技有限责任公司 Quantum chip testing device and method and quantum computer
CN115407184B (en) * 2021-05-28 2024-04-05 本源量子计算科技(合肥)股份有限公司 Quantum chip testing device and method and quantum computer
CN113282476B (en) * 2021-06-24 2023-01-20 深圳市商汤科技有限公司 Interface performance testing method and device and electronic equipment
CN113282476A (en) * 2021-06-24 2021-08-20 深圳市商汤科技有限公司 Interface performance testing method and device and electronic equipment

Similar Documents

Publication Publication Date Title
CN109783350A (en) Interface test method, device and computer readable storage medium
US11500762B2 (en) System and method for automated intelligent mobile application testing
Wei et al. Taming android fragmentation: Characterizing and detecting compatibility issues for android apps
US8271950B2 (en) Test generation from captured user interface status
US20200034281A1 (en) System and method for automated intelligent mobile application testing
CN106649084A (en) Function call information obtaining method and apparatus, and test device
WO2017165071A1 (en) Visual regression analysis
CN111124919A (en) User interface testing method, device, equipment and storage medium
CN103678115B (en) The apparatus and method of the position of source code mistake are detected in mixed mode program
US20140173564A1 (en) Test scope determination based on code change(s)
CN111309620B (en) Game protocol testing method and device, electronic equipment and storage medium
CN110149363A (en) A kind of information push method, device and storage medium
CN110320378B (en) Method, apparatus, device and computer readable storage medium for applying for a quality control test
CN108959067A (en) Test method, device and the computer readable storage medium of search engine
US20160098256A1 (en) Visual tool and architecting logical layers of software components
CN109885480A (en) A kind of automatic interface compatibility test method and device based on debugging bridge
CN109614322A (en) Unit test method, device, equipment and readable storage medium storing program for executing based on Mock
CN111104123A (en) Automatic deployment of applications
US10295596B1 (en) Method and system for generating validation tests
CN111385661B (en) Method, device, terminal and storage medium for voice control of full screen playing
CN109086198B (en) Database test method and device and storage medium
CN110377514A (en) Management method, device, electronic equipment and the storage medium of software component
CN113051153B (en) Application software vulnerability scanning method and related equipment
CN113986768A (en) Application stability testing method, device, equipment and medium
CN107957954A (en) The method and system of test data security is improved under a kind of linux system

Legal Events

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