CN110287093A - Mobile terminal, data-interface test method and storage medium - Google Patents
Mobile terminal, data-interface test method and storage medium Download PDFInfo
- Publication number
- CN110287093A CN110287093A CN201910419504.XA CN201910419504A CN110287093A CN 110287093 A CN110287093 A CN 110287093A CN 201910419504 A CN201910419504 A CN 201910419504A CN 110287093 A CN110287093 A CN 110287093A
- Authority
- CN
- China
- Prior art keywords
- interface
- test
- data
- boundary value
- value
- 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
Links
- 238000010998 test method Methods 0.000 title claims abstract description 17
- 238000012360 testing method Methods 0.000 claims abstract description 266
- 238000000034 method Methods 0.000 claims description 15
- 230000008569 process Effects 0.000 claims description 9
- 230000004044 response Effects 0.000 claims description 7
- 230000002452 interceptive effect Effects 0.000 claims description 5
- 238000012545 processing Methods 0.000 claims description 5
- 238000005516 engineering process Methods 0.000 abstract 1
- 230000006870 function Effects 0.000 description 9
- 230000004048 modification Effects 0.000 description 6
- 238000012986 modification Methods 0.000 description 6
- 238000004891 communication Methods 0.000 description 5
- 238000010586 diagram Methods 0.000 description 4
- 230000003993 interaction Effects 0.000 description 3
- 238000011161 development Methods 0.000 description 2
- 230000005236 sound signal Effects 0.000 description 2
- 230000000694 effects Effects 0.000 description 1
- 238000009434 installation Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 230000009466 transformation Effects 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
- 239000002699 waste material Substances 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3684—Test management for test design, e.g. generating new test cases
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3688—Test management for test execution, e.g. scheduling of test suites
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/50—Testing arrangements
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Mobile Radio Communication Systems (AREA)
- Telephone Function (AREA)
Abstract
The present invention relates to Test cases technologies, propose a kind of data-interface test method, comprising: after detecting interface packets, the interface packets are carried out packet capturing and are loaded into local, obtain analogue data file;After receiving data-interface test request, test request interface packets described in local parsing are based on, generate interface testing use-case;The interface testing use-case is executed, data-interface test is completed.Test can be completed, the testing efficiency of data-interface is improved, saves human resources and time cost in the raw batches of interface testing use-case in mobile terminal local.The present invention also proposes a kind of mobile terminal and storage medium.
Description
Technical field
The present invention relates to interface testing fields more particularly to a kind of mobile terminal, data-interface test method and storage to be situated between
Matter.
Background technique
Currently, the application program of most of mobile terminal installation can carry out data friendship by data-interface and server-side
Mutually, it is a large amount of to occupy development process with the interface joint debugging of server-side in development process or test phase for corresponding data-interface
Time, and data modification slightly requires server-side developer modification or carries out the number of data-interface by packet capturing software
It according to modification, needs to operate between multiple softwares, causes test process cumbersome, waste a large amount of human resources and time, test effect
Rate is low.
Summary of the invention
In view of this, the present invention proposes a kind of mobile terminal, data-interface test method and storage medium, it can be quickly quasi-
True ground fault point, and it is easy to operate to tracing to the source for the event of breaking down.
Firstly, to achieve the above object, the present invention proposes a kind of mobile terminal, the mobile terminal include memory and
The processor connecting with the memory, the processor are used to execute the data-interface test journey stored on the memory
Sequence, the data-interface test program realize following steps when being executed by the processor:
The interface packets are carried out packet capturing and are loaded into local, obtained by A1, mobile terminal after detecting interface packets
Analogue data file;
A2, after receiving data-interface test request, be based on test request interface packets described in local parsing, generate
Interface testing use-case;
A3, the interface testing use-case is executed, completes data-interface test.
Preferably, the interface packets include that the application program of mobile terminal was interacted with server-side progress data-interface
Cheng Zhong, the request message and server-side that send to server-side are back to the response message of the mobile terminal.
Preferably, the test request includes first boundary value, described to be based on test request interface described in local parsing
The step of message, generation interface testing use-case, comprising:
The interface packets are parsed, one or more interface parameters are obtained, the interface parameters includes the second boundary value;
If there is the second boundary value to match with the first boundary value in the second boundary value, it is determined that second side
Dividing value is test boundary value;
Test data is obtained from the test boundary value;
Generate the corresponding expected result of the test data;
Based on the test data and the expected result, interface testing use-case is generated.
Preferably, the first boundary value and the second boundary value are the Minimum Threshold that data-interface limits input value
Value and max-thresholds.
Preferably, described the step of obtaining test data from test boundary, comprising:
According to test boundary value, determine test boundary value within can value and determine test boundary value except can
Value;
Respectively several values can be chosen in value within test boundary value and except the test boundary value;
Value selected within boundary value and except test boundary value will be tested as the second test data obtained.
In addition, to achieve the goals above, the present invention also proposes a kind of data-interface test method, and the method includes such as
Lower step:
The interface packets are carried out packet capturing and are loaded into local, obtained by S1, mobile terminal after detecting interface packets
Analogue data file;
S2, after receiving data-interface test request, be based on test request interface packets described in local parsing, generate
Interface testing use-case;
S3, the interface testing use-case is executed, completes data-interface test.
Preferably, the interface packets include that the application program of mobile terminal was interacted with server-side progress data-interface
Cheng Zhong, the request message and server-side that send to server-side are back to the response message of the mobile terminal.
Preferably, the test request includes first boundary value, described to be based on test request interface described in local parsing
The step of message, generation interface testing use-case, comprising:
The interface packets are parsed, one or more interface parameters are obtained, the interface parameters includes the second boundary value;
If there is the second boundary value to match with the first boundary value in the second boundary value, it is determined that second side
Dividing value is test boundary value;
Test data is obtained from the test boundary value;
Generate the corresponding expected result of the test data;
Based on the test data and the expected result, interface testing use-case is generated.
Preferably, the first boundary value and the second boundary value are the Minimum Threshold that data-interface limits input value
Value and max-thresholds.
In addition, to achieve the above object, the present invention also proposes a kind of computer readable storage medium, described computer-readable
Storage medium is stored with data-interface test program, and the data-interface test program can be executed by least one processor, with
The step of making at least one described processor execute data-interface test method as described above.
Mobile terminal, data-interface test method and storage medium proposed by the invention, by detecting interface report
The interface packets are carried out packet capturing and are loaded into local, obtain analogue data file by Wen Hou;Receiving data-interface test
After request, test request interface packets described in local parsing are based on, generate interface testing use-case;The interface testing is executed to use
Example completes data-interface test.Test can be completed, is improved in the raw batches of interface testing use-case in mobile terminal local
The testing efficiency of data-interface saves human resources and time cost.
Detailed description of the invention
Fig. 1 is the schematic diagram of the optional hardware structure of mobile terminal one proposed by the present invention;
Fig. 2 is the program module schematic diagram of data-interface test program in one embodiment of mobile terminal of the present invention;
Fig. 3 is the implementation flow chart of data-interface test method preferred embodiment of the present 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
In order to make the objectives, technical solutions, and advantages of the present invention clearer, with reference to the accompanying drawings and embodiments, right
The present invention is further elaborated.It should be appreciated that described herein, specific examples are only used to explain the present invention, not
For limiting the present invention.Based on the embodiments of the present invention, those of ordinary skill in the art are not before making creative work
Every other embodiment obtained is put, shall fall within the protection scope of the present invention.
It should be noted that the description for being related to " first ", " second " etc. in the present invention is used for description purposes only, and cannot
It is interpreted as its relative importance of indication or suggestion or implicitly indicates the quantity of indicated technical characteristic.Define as a result, " the
One ", the feature of " second " can explicitly or implicitly include at least one of the features.In addition, the skill between each embodiment
Art scheme can be combined with each other, but must be based on can be realized by those of ordinary skill in the art, when technical solution
Will be understood that the combination of this technical solution is not present in conjunction with there is conflicting or cannot achieve when, also not the present invention claims
Protection scope within.
As shown in fig.1, being the optional hardware structure schematic diagram of mobile terminal one proposed by the present invention.In the present embodiment,
Mobile terminal 10 may include, but be not limited only to, and connection memory 11, processor 12, net can be in communication with each other by communication bus 14
Network interface 13.It should be pointed out that Fig. 1 illustrates only the mobile terminal 10 with component 11-14, it should be understood that simultaneously
All components shown realistic are not applied, the implementation that can be substituted is more or less component.
Wherein, memory 11 includes at least a type of computer readable storage medium, computer readable storage medium
Including flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory etc.), random access storage device (RAM), quiet
State random access storage device (SRAM), electrically erasable programmable read-only memory (EEPROM), can be compiled read-only memory (ROM)
Journey read-only memory (PROM), magnetic storage, disk, CD etc..In some embodiments, memory 11 can be mobile whole
The internal storage unit at end 10, such as the hard disk or memory of mobile terminal 10.In further embodiments, memory 11 can also be with
It is the outer packet storage device of mobile terminal 10, such as the plug-in type hard disk being equipped on mobile terminal 10, intelligent memory card (Smart
Media Card, SMC), secure digital (Secure Digital, SD) card, flash card (Flash Card) etc..Certainly, it stores
Device 11 can also both including mobile terminal 10 internal storage unit and also including its outer packet storage device.In the present embodiment, storage
Device 11 is installed on the operating system and types of applications software of mobile terminal 10, such as data-interface test program commonly used in storage
Deng.In addition, memory 11 can be also used for temporarily storing the Various types of data that has exported or will export.
Processor 12 can be in some embodiments central processing unit (Central Processing Unit, CPU),
Controller, microcontroller, microprocessor or other data processing chips.Processor 12 is commonly used in control mobile terminal 10
Overall operation.In the present embodiment, program code or processing data of the processor 12 for being stored in run memory 11, such as
Data-interface test program of operation etc..
Network interface 13 may include radio network interface or wired network interface, and network interface 13 is commonly used in mobile whole
It establishes and communicates to connect between end 10 and other electronic equipments.
Communication bus 14 is for realizing the communication connection between component 11-13.
Fig. 1 illustrates only the mobile terminal 10 with component 11-14 and data-interface test program, it should be understood that
It is, it is not required that implement all components shown, the implementation that can be substituted is more or less component.
Optionally, mobile terminal 10 can also include user interface (not shown in figure 1), and user interface may include display
Device, input unit such as keyboard, wherein user interface can also be including standard wireline interface and wireless interface etc..
Optionally, in some embodiments, display can be light-emitting diode display, liquid crystal display, touch control type LCD and show
Device and OLED touch device etc..Further, display is alternatively referred to as display screen or display unit, for being shown in mobile terminal
Information is handled in 10 and for showing visual user interface.
Optionally, in some embodiments, mobile terminal 10 can also include that audio unit (does not show in audio unit Fig. 1
Out), audio unit can be in call signal reception pattern, call mode, logging mode, speech recognition mould in mobile terminal 10
When under the isotypes such as formula, broadcast reception mode, received or storage audio data is converted into audio signal;Further
Ground, mobile terminal 10 can also include audio output unit, and the audio signal that audio output unit converts audio unit exports,
And audio output unit can also provide the relevant audio output of specific function that executes to mobile terminal 10 (such as calling is believed
Number receive sound, message sink sound etc.), audio output unit may include loudspeaker, buzzer etc..
Optionally, in some embodiments, mobile terminal 10 can also include alarm unit (not shown), alarm list
Member can provide output and notify event to mobile terminal 10.Typical event may include calling reception, message
Reception, key signals input, touch input etc..Other than audio or video export, alarm unit can be with different sides
Formula provides output with the generation of notification event.For example, alarm unit can provide output in the form of vibration, exhaled when receiving
Cry, message or it is some other can make mobile terminal 10 enter communication pattern when, alarm unit can provide tactile output (that is,
Vibration) to notify to user.
In one embodiment, it when the data-interface test program stored in memory 11 is executed by processor 12, realizes such as
Lower operation:
After A1, mobile terminal detect interface packets, the interface packets are subjected to packet capturing and are loaded into local, obtain mould
Quasi- data file;
Specifically, the application program in mobile terminal needs to carry out data-interface with server-side in exploitation or test phase
Interaction, in the present embodiment, the interface packets refer to that application program carries out in data-interface interactive process with server-side,
The request message and server-side that send to server-side are back to the response message of the application program.It is mobile in the present embodiment
The interface packets are carried out packet capturing and the local file for being attached to mobile terminal delay by terminal after detecting interface packets
It deposits, obtains analogue data file, tester can carry out phase to local analogue data file is loaded onto according to test condition
The test of data-interface is realized in the modification for answering interface packets.
Further, the interface packets can be the message with standard message format, for example, JSON
The message of (JavaScript Object Notation, JS object numbered musical notation) format.
A2, after receiving data-interface test request, be based on test request interface packets described in local parsing, generate
Interface testing use-case;
In the present embodiment, tester can send test request by predetermined user interface.In general, in advance
Determining user interface can provide web page as user interface for tester, and tester can pass through user circle
Face carries out the configuration of test condition, and clicks the test condition of configuration, generates test request.Specifically, the test request packet
Include first boundary value, described to be based on test request interface packets described in local parsing, the step of generating interface testing use-case, packet
It includes:
The interface packets are parsed, one or more interface parameters are obtained, the interface parameters includes the second boundary value;Tool
Body, the first boundary value and the second boundary value are the minimum threshold and maximum threshold that data-interface limits input value
Value.For example, the minimum of registration interface, max-thresholds are [0,20] a character, which can only be inputted within 0-20 character
Account title.It, can in interface parameters it is possible to further parse one or more interface parameters in the interface packets
To include the second boundary value.For example, parsing interface packets " username ": " string ": " 0 ": " 100 " ", userid ":
" integer ": " 0 ": " 20 " }, obtain two interface parameters, interface parameters 01 be [" username ": " string ": " 0 ":
" 100 "], interface parameters 02 is [" integer ": " 0 ": " 20 "].Wherein, the second boundary value of interface parameters 01 is [0,100],
The second boundary value of interface parameters 02 is [0,20].
If there is the second boundary value to match with the first boundary value in the second boundary value, it is determined that second side
Dividing value is test boundary value;
Test data is obtained from the test boundary value;Specifically, it can be determined according to test boundary value on test side
Within dividing value can value, and, determine test boundary value except can value, from test boundary value within can be selected in value
Take several values, and from except test boundary value can value choose several values, will within test boundary value and test boundary
Selected value is as the second test data obtained except value.For example, test boundary value is [0,100], minimum test boundary
Value is 0, can take the numerical value less than 0, such as -5;Full test boundary value is 100, can take the numerical value greater than 100, such as 150;It can
With take within test boundary value can value, such as 40,60.The test data may include the test boundary as a result,
Within value can except value and the test boundary can value, such as in the present embodiment, -5,150,40 and 60 obtained
As the test data.
Generate the corresponding expected result of the test data;Wherein, expected result can be by test data input data
The result that data-interface should return it is expected after interface.In the specific implementation, the corresponding survey of each Test data generation can be directed to
Test result, as expected result.For example, for test boundary value within test value " 50 ", corresponding expected result be expectation at
Function result;For test value " -5 " except boundary value, corresponding expected result is desired failure result.
Based on the test data and the expected result, interface testing use-case is generated;The interface testing use-case includes
The test data and the expected result.In the specific implementation, test value and corresponding expected result can be added to default
Use-case template, form multiple interface testing use-cases.
A3, the interface testing use-case is executed, completes data-interface test.
It, will be described by after detecting interface packets by above-mentioned thing embodiment it is found that mobile terminal proposed by the present invention
Interface packets carry out packet capturing and are loaded into local, obtain analogue data file;After receiving data-interface test request, it is based on
Test request interface packets described in local parsing generate interface testing use-case;The interface testing use-case is executed, data are completed
Interface testing.Test can be completed, the survey of data-interface is improved in the raw batches of interface testing use-case in mobile terminal local
Efficiency is tried, human resources and time cost are saved.
In addition, data-interface test program of the invention is different according to the function that its each section is realized, it can be with phase
The program module of congenerous is described.It please refers to shown in Fig. 2, is that data-interface is tested in one embodiment of mobile terminal of the present invention
The program module schematic diagram of program.In the present embodiment, the function that data-interface test program is realized according to its each section is not
Together, loading module 201, parsing module 202 and test module 203 can be divided into.By above description it is found that the present invention
So-called program module is the series of computation machine program instruction section for referring to complete specific function, than program more suitable for description
Implementation procedure of the data-interface test program in mobile terminal 10.The functions or operations step that the module 201-203 is realized
Rapid similar as above, and will not be described here in detail, illustratively, such as wherein:
Loading module 201 is used for after detecting interface packets, and the interface packets are carried out packet capturing and are loaded into local,
Obtain analogue data file;
Parsing module 202 is used for after receiving data-interface test request, based on test request described in the local parsing
Interface packets generate interface testing use-case;
Test module 203 completes data-interface test for executing the interface testing use-case.
In addition, the present invention also proposes a kind of data-interface test method, please refer to shown in Fig. 3, the data-interface test
Method includes the following steps:
After S301, mobile terminal detect interface packets, the interface packets are subjected to packet capturing and are loaded into local, are obtained
Analogue data file;
Specifically, the application program in mobile terminal needs to carry out data-interface with server-side in exploitation or test phase
Interaction, in the present embodiment, the interface packets refer to that application program carries out in data-interface interactive process with server-side,
The request message and server-side that send to server-side are back to the response message of the application program.It is mobile in the present embodiment
The interface packets are carried out packet capturing and the local file for being attached to mobile terminal delay by terminal after detecting interface packets
It deposits, obtains analogue data file, tester can carry out phase to local analogue data file is loaded onto according to test condition
The test of data-interface is realized in the modification for answering interface packets.
Further, the interface packets can be the message with standard message format, for example, JSON
The message of (JavaScript Object Notation, JS object numbered musical notation) format.
S302, after receiving data-interface test request, be based on test request interface packets described in local parsing, it is raw
At interface testing use-case;
In the present embodiment, tester can send test request by predetermined user interface.In general, in advance
Determining user interface can provide web page as user interface for tester, and tester can pass through user circle
Face carries out the configuration of test condition, and clicks the test condition of configuration, generates test request.Specifically, the test request packet
Include first boundary value, described to be based on test request interface packets described in local parsing, the step of generating interface testing use-case, packet
It includes:
The interface packets are parsed, one or more interface parameters are obtained, the interface parameters includes the second boundary value;Tool
Body, the first boundary value and the second boundary value are the minimum threshold and maximum threshold that data-interface limits input value
Value.For example, the minimum of registration interface, max-thresholds are [0,20] a character, which can only be inputted within 0-20 character
Account title.It, can in interface parameters it is possible to further parse one or more interface parameters in the interface packets
To include the second boundary value.For example, parsing interface packets " username ": " string ": " 0 ": " 100 " ", userid ":
" integer ": " 0 ": " 20 " }, obtain two interface parameters, interface parameters 01 be [" username ": " string ": " 0 ":
" 100 "], interface parameters 02 is [" integer ": " 0 ": " 20 "].Wherein, the second boundary value of interface parameters 01 is [0,100],
The second boundary value of interface parameters 02 is [0,20].
If there is the second boundary value to match with the first boundary value in the second boundary value, it is determined that second side
Dividing value is test boundary value;
Test data is obtained from the test boundary value;Specifically, it can be determined according to test boundary value on test side
Within dividing value can value, and, determine test boundary value except can value, from test boundary value within can be selected in value
Take several values, and from except test boundary value can value choose several values, will within test boundary value and test boundary
Selected value is as the second test data obtained except value.For example, test boundary value is [0,100], minimum test boundary
Value is 0, can take the numerical value less than 0, such as -5;Full test boundary value is 100, can take the numerical value greater than 100, such as 150;It can
With take within test boundary value can value, such as 40,60.The test data may include the test boundary as a result,
Within value can except value and the test boundary can value, such as in the present embodiment, -5,150,40 and 60 obtained
As the test data.
Generate the corresponding expected result of the test data;Wherein, expected result can be by test data input data
The result that data-interface should return it is expected after interface.In the specific implementation, the corresponding survey of each Test data generation can be directed to
Test result, as expected result.For example, for test boundary value within test value " 50 ", corresponding expected result be expectation at
Function result;For test value " -5 " except boundary value, corresponding expected result is desired failure result.
Based on the test data and the expected result, interface testing use-case is generated;The interface testing use-case includes
The test data and the expected result.In the specific implementation, test value and corresponding expected result can be added to default
Use-case template, form multiple interface testing use-cases.
S303, the interface testing use-case is executed, completes data-interface test.
By above-mentioned thing embodiment it is found that data-interface test method proposed by the present invention, by detecting interface packets
Afterwards, the interface packets are subjected to packet capturing and are loaded into local, obtain analogue data file;It is asked receiving data-interface test
After asking, test request interface packets described in local parsing are based on, generate interface testing use-case;The interface testing is executed to use
Example completes data-interface test.Test can be completed, is improved in the raw batches of interface testing use-case in mobile terminal local
The testing efficiency of data-interface saves human resources and time cost.
In addition, the present invention also proposes a kind of computer readable storage medium, stored on the computer readable storage medium
There is data-interface test program, following operation realized when the data-interface test program is executed by processor:
After detecting interface packets, the interface packets are subjected to packet capturing and are loaded into local, obtains analogue data text
Part;
Specifically, the application program in mobile terminal needs to carry out data-interface with server-side in exploitation or test phase
Interaction, in the present embodiment, the interface packets refer to that application program carries out in data-interface interactive process with server-side,
The request message and server-side that send to server-side are back to the response message of the application program.It is mobile in the present embodiment
The interface packets are carried out packet capturing and the local file for being attached to mobile terminal delay by terminal after detecting interface packets
It deposits, obtains analogue data file, tester can carry out phase to local analogue data file is loaded onto according to test condition
The test of data-interface is realized in the modification for answering interface packets.
Further, the interface packets can be the message with standard message format, for example, JSON
The message of (JavaScript Object Notation, JS object numbered musical notation) format.
After receiving data-interface test request, test request interface packets described in local parsing are based on, generation connects
Mouth test case;
In the present embodiment, tester can send test request by predetermined user interface.In general, in advance
Determining user interface can provide web page as user interface for tester, and tester can pass through user circle
Face carries out the configuration of test condition, and clicks the test condition of configuration, generates test request.Specifically, the test request packet
Include first boundary value, described to be based on test request interface packets described in local parsing, the step of generating interface testing use-case, packet
It includes:
The interface packets are parsed, one or more interface parameters are obtained, the interface parameters includes the second boundary value;Tool
Body, the first boundary value and the second boundary value are the minimum threshold and maximum threshold that data-interface limits input value
Value.For example, the minimum of registration interface, max-thresholds are [0,20] a character, which can only be inputted within 0-20 character
Account title.It, can in interface parameters it is possible to further parse one or more interface parameters in the interface packets
To include the second boundary value.For example, parsing interface packets " username ": " string ": " 0 ": " 100 " ", userid ":
" integer ": " 0 ": " 20 " }, obtain two interface parameters, interface parameters 01 be [" username ": " string ": " 0 ":
" 100 "], interface parameters 02 is [" integer ": " 0 ": " 20 "].Wherein, the second boundary value of interface parameters 01 is [0,100],
The second boundary value of interface parameters 02 is [0,20].
If there is the second boundary value to match with the first boundary value in the second boundary value, it is determined that second side
Dividing value is test boundary value;
Test data is obtained from the test boundary value;Specifically, it can be determined according to test boundary value on test side
Within dividing value can value, and, determine test boundary value except can value, from test boundary value within can be selected in value
Take several values, and from except test boundary value can value choose several values, will within test boundary value and test boundary
Selected value is as the second test data obtained except value.For example, test boundary value is [0,100], minimum test boundary
Value is 0, can take the numerical value less than 0, such as -5;Full test boundary value is 100, can take the numerical value greater than 100, such as 150;It can
With take within test boundary value can value, such as 40,60.The test data may include the test boundary as a result,
Within value can except value and the test boundary can value, such as in the present embodiment, -5,150,40 and 60 obtained
As the test data.
Generate the corresponding expected result of the test data;Wherein, expected result can be by test data input data
The result that data-interface should return it is expected after interface.In the specific implementation, the corresponding survey of each Test data generation can be directed to
Test result, as expected result.For example, for test boundary value within test value " 50 ", corresponding expected result be expectation at
Function result;For test value " -5 " except boundary value, corresponding expected result is desired failure result.
Based on the test data and the expected result, interface testing use-case is generated;The interface testing use-case includes
The test data and the expected result.In the specific implementation, test value and corresponding expected result can be added to default
Use-case template, form multiple interface testing use-cases.
The interface testing use-case is executed, data-interface test is completed.
It, will be described by after detecting interface packets by above-mentioned thing embodiment it is found that storage medium proposed by the present invention
Interface packets carry out packet capturing and are loaded into local, obtain analogue data file;After receiving data-interface test request, it is based on
Test request interface packets described in local parsing generate interface testing use-case;The interface testing use-case is executed, data are completed
Interface testing.Test can be completed, the survey of data-interface is improved in the raw batches of interface testing use-case in mobile terminal local
Efficiency is tried, human resources and time cost are saved.
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 a storage medium
In (such as ROM/RAM, magnetic disk, CD), including some instructions are used so that a terminal device (can be mobile phone, computer, clothes
Business device, air conditioner or the network equipment etc.) execute method described in each embodiment of the present invention.The above is only of the invention excellent
Embodiment is selected, is not intended to limit the scope of the invention, it is all using made by description of the invention and accompanying drawing content etc.
Structure or equivalent process transformation are imitated, is applied directly or indirectly in other relevant technical fields, and is similarly included in the present invention
Scope of patent protection in.
Claims (10)
1. a kind of mobile terminal, which is characterized in that the mobile terminal includes memory and the processing that connect with the memory
Device, the processor is for executing the data-interface test program stored on the memory, the data-interface test program
Following steps are realized when being executed by the processor:
The interface packets are carried out packet capturing and are loaded into local, simulated by A1, mobile terminal after detecting interface packets
Data file;
A2, after receiving data-interface test request, be based on test request interface packets described in local parsing, generate interface
Test case;
A3, the interface testing use-case is executed, completes data-interface test.
2. mobile terminal as described in claim 1, which is characterized in that the interface packets include the application program of mobile terminal
It is carried out in data-interface interactive process with server-side, the request message and server-side sent to server-side is back to described
The response message of mobile terminal.
3. mobile terminal as described in claim 1, which is characterized in that the test request includes first boundary value, the base
In test request interface packets described in local parsing, the step of generating interface testing use-case, comprising:
The interface packets are parsed, one or more interface parameters are obtained, the interface parameters includes the second boundary value;
If there is the second boundary value to match with the first boundary value in the second boundary value, it is determined that the second boundary value
To test boundary value;
Test data is obtained from the test boundary value;
Generate the corresponding expected result of the test data;
Based on the test data and the expected result, interface testing use-case is generated.
4. mobile terminal as claimed in claim 3, which is characterized in that the first boundary value and the second boundary value are
The minimum threshold and max-thresholds that data-interface limits input value.
5. mobile terminal as claimed in claim 4, which is characterized in that the step for obtaining test data from test boundary
Suddenly, comprising:
According to test boundary value, value and can determine desirable except test boundary value within test boundary value is determined
Value;
Respectively several values can be chosen in value within test boundary value and except the test boundary value;
Value selected within boundary value and except test boundary value will be tested as the second test data obtained.
6. a kind of data-interface test method, which is characterized in that described method includes following steps:
The interface packets are carried out packet capturing and are loaded into local, simulated by S1, mobile terminal after detecting interface packets
Data file;
S2, after receiving data-interface test request, be based on test request interface packets described in local parsing, generate interface
Test case;
S3, the interface testing use-case is executed, completes data-interface test.
7. data-interface test method as claimed in claim 6, which is characterized in that the interface packets include mobile terminal
Application program carries out in data-interface interactive process with server-side, and the request message and server-side sent to server-side returns
It is back to the response message of the mobile terminal.
8. data-interface test method as claimed in claim 6, which is characterized in that the test request includes the first boundary
Value, it is described be based on test request interface packets described in local parsing, generate interface testing use-case the step of, comprising:
The interface packets are parsed, one or more interface parameters are obtained, the interface parameters includes the second boundary value;
If there is the second boundary value to match with the first boundary value in the second boundary value, it is determined that the second boundary value
To test boundary value;
Test data is obtained from the test boundary value;
Generate the corresponding expected result of the test data;
Based on the test data and the expected result, interface testing use-case is generated.
9. data-interface test method as claimed in claim 8, which is characterized in that the first boundary value and second side
Dividing value is the minimum threshold and max-thresholds that data-interface limits input value.
10. a kind of computer readable storage medium, the computer-readable recording medium storage has data-interface test program, institute
Stating data-interface test program can be executed by least one processor, so that at least one described processor executes such as claim
Described in any one of 6-9 the step of data-interface test method.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910419504.XA CN110287093A (en) | 2019-05-20 | 2019-05-20 | Mobile terminal, data-interface test method and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910419504.XA CN110287093A (en) | 2019-05-20 | 2019-05-20 | Mobile terminal, data-interface test method and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110287093A true CN110287093A (en) | 2019-09-27 |
Family
ID=68002255
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910419504.XA Pending CN110287093A (en) | 2019-05-20 | 2019-05-20 | Mobile terminal, data-interface test method and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110287093A (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111045928A (en) * | 2019-11-14 | 2020-04-21 | 用友网络科技股份有限公司 | Interface data testing method, device, terminal and storage medium |
CN111163067A (en) * | 2019-12-18 | 2020-05-15 | 支付宝(杭州)信息技术有限公司 | Safety testing method and device and electronic equipment |
CN112433948A (en) * | 2020-11-30 | 2021-03-02 | 上海天旦网络科技发展有限公司 | Simulation test system and method based on network data analysis |
CN113254355A (en) * | 2021-07-06 | 2021-08-13 | 云账户技术(天津)有限公司 | GRPC interface testing method and device, electronic equipment and readable storage medium |
CN116627851A (en) * | 2023-07-24 | 2023-08-22 | 恒生电子股份有限公司 | Interface testing method and device |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105490881A (en) * | 2015-12-09 | 2016-04-13 | 北京交控科技股份有限公司 | Configurable data interface test method and system |
CN105975396A (en) * | 2016-06-28 | 2016-09-28 | 腾讯科技(深圳)有限公司 | Generating method and system for automated testing case |
CN108268348A (en) * | 2017-12-08 | 2018-07-10 | 广州视源电子科技股份有限公司 | Interface test method, device, mobile terminal and storage medium |
CN109062788A (en) * | 2018-07-17 | 2018-12-21 | 招银云创(深圳)信息技术有限公司 | Method for generating test case, device, computer equipment and storage medium |
CN109710533A (en) * | 2018-12-29 | 2019-05-03 | 亚信科技(中国)有限公司 | A kind of interface test method, device and server |
CN109726128A (en) * | 2018-12-29 | 2019-05-07 | 亚信科技(中国)有限公司 | A kind of method for generating test case, device and server |
-
2019
- 2019-05-20 CN CN201910419504.XA patent/CN110287093A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105490881A (en) * | 2015-12-09 | 2016-04-13 | 北京交控科技股份有限公司 | Configurable data interface test method and system |
CN105975396A (en) * | 2016-06-28 | 2016-09-28 | 腾讯科技(深圳)有限公司 | Generating method and system for automated testing case |
CN108268348A (en) * | 2017-12-08 | 2018-07-10 | 广州视源电子科技股份有限公司 | Interface test method, device, mobile terminal and storage medium |
CN109062788A (en) * | 2018-07-17 | 2018-12-21 | 招银云创(深圳)信息技术有限公司 | Method for generating test case, device, computer equipment and storage medium |
CN109710533A (en) * | 2018-12-29 | 2019-05-03 | 亚信科技(中国)有限公司 | A kind of interface test method, device and server |
CN109726128A (en) * | 2018-12-29 | 2019-05-07 | 亚信科技(中国)有限公司 | A kind of method for generating test case, device and server |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111045928A (en) * | 2019-11-14 | 2020-04-21 | 用友网络科技股份有限公司 | Interface data testing method, device, terminal and storage medium |
CN111045928B (en) * | 2019-11-14 | 2024-03-26 | 用友网络科技股份有限公司 | Interface data testing method, device, terminal and storage medium |
CN111163067A (en) * | 2019-12-18 | 2020-05-15 | 支付宝(杭州)信息技术有限公司 | Safety testing method and device and electronic equipment |
CN111163067B (en) * | 2019-12-18 | 2022-05-03 | 支付宝(杭州)信息技术有限公司 | Safety testing method and device and electronic equipment |
CN112433948A (en) * | 2020-11-30 | 2021-03-02 | 上海天旦网络科技发展有限公司 | Simulation test system and method based on network data analysis |
CN113254355A (en) * | 2021-07-06 | 2021-08-13 | 云账户技术(天津)有限公司 | GRPC interface testing method and device, electronic equipment and readable storage medium |
CN116627851A (en) * | 2023-07-24 | 2023-08-22 | 恒生电子股份有限公司 | Interface testing method and device |
CN116627851B (en) * | 2023-07-24 | 2023-10-20 | 恒生电子股份有限公司 | Interface testing method and device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110287093A (en) | Mobile terminal, data-interface test method and storage medium | |
CN107133180B (en) | Dynamic page testing method, testing device and storage medium | |
CN109558290B (en) | Server, interface automatic test method and storage medium | |
CN109634841A (en) | Electronic device, automatic interface testing method and storage medium | |
CN106294102B (en) | Application program testing method, client, server and system | |
CN105303112B (en) | The detection method and device of component call loophole | |
US9747449B2 (en) | Method and device for preventing application in an operating system from being uninstalled | |
CN104639423B (en) | Information interaction method, information interaction device and terminals | |
CN106502646A (en) | The page info processing method and processing device of application | |
CN110058999A (en) | Electronic device, application exception localization method and storage medium | |
CN110069177A (en) | Electronic device, application program guiding method of operating and storage medium | |
CN104679627A (en) | Testing method and device | |
CN104572318A (en) | Report information obtaining method, device, equipment and system | |
CN113672441B (en) | Method and device for testing intelligent equipment | |
CN104317648B (en) | A kind of method and apparatus of monitoring advertisement | |
CN106341259A (en) | Fault information report method and device | |
CN109684195A (en) | Electronic device, script conversion method and storage medium | |
CN103543991A (en) | Method for extending functions of browser and browser system | |
CN109634813A (en) | Electronic device, cloud platform exception confirmation method and storage medium | |
CN106131133A (en) | Browsing history information inspection method, Apparatus and system | |
CN110163481A (en) | Electronic device, user's air control auditing system test method and storage medium | |
CN110780918B (en) | Middleware container processing method and device, electronic equipment and storage medium | |
CN105635200A (en) | Information processing method, electronic equipment, server and information processing system | |
CN109683856A (en) | Electronic device, Faas stage function creation method and storage medium | |
CN114244821A (en) | Data processing method, device, equipment, electronic equipment 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 |