CN110083526A - Applied program testing method, device, computer installation and storage medium - Google Patents
Applied program testing method, device, computer installation and storage medium Download PDFInfo
- Publication number
- CN110083526A CN110083526A CN201910199220.4A CN201910199220A CN110083526A CN 110083526 A CN110083526 A CN 110083526A CN 201910199220 A CN201910199220 A CN 201910199220A CN 110083526 A CN110083526 A CN 110083526A
- Authority
- CN
- China
- Prior art keywords
- interface
- database
- test
- user information
- test case
- 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
- 238000009434 installation Methods 0.000 title claims abstract description 25
- 238000003860 storage Methods 0.000 title claims abstract description 19
- 238000012360 testing method Methods 0.000 claims abstract description 173
- 238000012795 verification Methods 0.000 claims description 26
- 238000004590 computer program Methods 0.000 claims description 21
- 238000000034 method Methods 0.000 claims description 20
- 238000007689 inspection Methods 0.000 claims description 18
- 238000010998 test method Methods 0.000 abstract description 6
- 230000006870 function Effects 0.000 description 14
- 230000002159 abnormal effect Effects 0.000 description 8
- 238000012545 processing Methods 0.000 description 6
- 238000010586 diagram Methods 0.000 description 4
- 235000013399 edible fruits Nutrition 0.000 description 3
- 238000003780 insertion Methods 0.000 description 3
- 230000037431 insertion Effects 0.000 description 3
- 241000208340 Araliaceae Species 0.000 description 2
- 235000005035 Panax pseudoginseng ssp. pseudoginseng Nutrition 0.000 description 2
- 235000003140 Panax quinquefolius Nutrition 0.000 description 2
- 230000008901 benefit Effects 0.000 description 2
- 238000004364 calculation method Methods 0.000 description 2
- 238000004891 communication Methods 0.000 description 2
- 235000008434 ginseng Nutrition 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000010365 information processing Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 238000005192 partition Methods 0.000 description 1
- 238000000926 separation method Methods 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
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
Abstract
The present invention provides a kind of applied program testing method, device, computer installation and storage medium.Application program is embedded in third-party application.The application programming interfaces test method includes: acquisition user information;Obtain the interface message of interface;The test case of the interface, input parameter of the user information described in the test case as the interface are generated according to the user information and the interface message;The interface is tested using the test case, obtains the test result of the interface;Judge whether the interface is normal according to the test result.The present invention can carry out automation interface test to the application program being embedded in third-party application, improve the efficiency of interface testing.
Description
Technical field
The present invention relates to computer software technical field more particularly to a kind of applied program testing method, device, computers
Device and storage medium.
Background technique
Currently, the exploitation for the application program (such as wechat small routine in wechat) being embedded in third-party application is increasingly
It is more.Such application program includes front-end and back-end, and rear end provides interface and calls for front end, and front end is real by third-party application frame
Existing, rear end is realized by the inner frame of application development side.When testing the interface, since front-end and back-end belong to
In different frames, it is difficult to realize the automatic test to the interface.
Summary of the invention
In view of the foregoing, it is necessary to propose that a kind of applied program testing method, device, computer installation and storage are situated between
Matter can carry out automation interface test to the application program being embedded in third-party application, improve the efficiency of interface testing.
The first aspect of the application provides a kind of applied program testing method, and application program is embedded in third-party application,
The described method includes:
Obtain user information;
Obtain the interface message of interface;
The test case of the interface, institute in the test case are generated according to the user information and the interface message
State input parameter of the user information as the interface;
The interface is tested using the test case, obtains the test result of the interface;
Judge whether the interface is normal according to the test result.
In alternatively possible implementation, the acquisition user information includes:
The user information is obtained by the API that the third-party application provides.
In alternatively possible implementation, the test case has standardised generic structure.
In alternatively possible implementation, the test result includes status code, the interface that the interface returns
Output valve and/or the interface return to time of the output valve.
In alternatively possible implementation, it is described according to the test result judge the interface whether normally include:
Judge whether the status code is preset state code;
Judge whether the output valve of the interface is consistent with preset desired value or in the preset range of the desired value;
Judge whether within a preset time the interface returns to the time of the output valve.
In alternatively possible implementation, the test case further includes database statement identification code and database verification
Data, the method also includes:
According to the database statement identification code and database verification data to the database of the application program into
Row verification.
It is described according to the database statement identification code and the database check number in alternatively possible implementation
Include: according to verification is carried out to database
The corresponding database statement of the database statement identification code is searched from the database statement template pre-established;
The database is checked according to the database statement, to obtain the inspection result of the database;
The inspection result is compared with database verification data, obtains the check results of the database.
The second aspect of the application provides a kind of Application testing device, and application program is embedded in third-party application,
Described device includes:
Module is obtained, for obtaining the interface message of user information and interface;
Generation module generates the test case of the interface, the survey according to the user information and the interface message
Input parameter of the user information as the interface described in example on probation;
Test module tests the interface using the test case, obtains the test result of the interface;
Judgment module judges whether the interface is normal according to the test result.
The third aspect of the application provides a kind of computer installation, and the computer installation includes processor, the processing
Device is for realizing the applied program testing method when executing the computer program stored in memory.
The fourth aspect of the application provides a kind of computer readable storage medium, is stored thereon with computer program, described
The applied program testing method is realized when computer program is executed by processor.
The present invention obtains user information;Obtain the interface message of interface;According to the user information and the interface message
Generate the test case of the interface, input parameter of the user information described in the test case as the interface;It utilizes
The test case tests the interface, obtains the test result of the interface;Institute is judged according to the test result
Whether normal state interface.The present invention can carry out automation interface test to the application program being embedded in third-party application, improve
The efficiency of interface testing.
Detailed description of the invention
Fig. 1 is the flow chart of applied program testing method provided in an embodiment of the present invention.
Fig. 2 is the structure chart of Application testing device provided in an embodiment of the present invention.
Fig. 3 is the schematic diagram of computer installation provided in an embodiment of the present invention.
Specific embodiment
To better understand the objects, features and advantages of the present invention, with reference to the accompanying drawing and specific real
Applying example, the present invention will be described in detail.It should be noted that in the absence of conflict, embodiments herein and embodiment
In feature can be combined with each other.
In the following description, numerous specific details are set forth in order to facilitate a full understanding of the present invention, described embodiment is only
It is only a part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, ordinary skill
Personnel's every other embodiment obtained without making creative work, shall fall within the protection scope of the present invention.
Unless otherwise defined, all technical and scientific terms used herein and belong to technical field of the invention
The normally understood meaning of technical staff is identical.Term as used herein in the specification of the present invention is intended merely to description tool
The purpose of the embodiment of body, it is not intended that in the limitation present invention.
Preferably, applied program testing method of the invention is applied in one or more computer installation.The meter
Calculation machine device be it is a kind of can be according to the instruction for being previously set or store, automatic progress numerical value calculating and/or information processing are set
Standby, hardware includes but is not limited to microprocessor, specific integrated circuit (Application Specific Integrated
Circuit, ASIC), programmable gate array (Field-Programmable Gate Array, FPGA), digital processing unit
(Digital Signal Processor, DSP), embedded device etc..
The computer installation can be the calculating such as desktop PC, notebook, palm PC and cloud server and set
It is standby.The computer installation can carry out people by modes such as keyboard, mouse, remote controler, touch tablet or voice-operated devices with user
Machine interaction.
Embodiment one
Fig. 1 is the flow chart for the applied program testing method that the embodiment of the present invention one provides.The Application testing side
Method is applied to computer installation.Application program is embedded in third-party application.The application program includes front-end and back-end, described
Rear end provides interface and calls for the front end.The front end is realized by third-party application frame, for showing the application program
The page.The rear end is realized by the inner frame of the exploitation side of the application program, is patrolled for realizing the business of application program
Volume.For testing the interface, can verify the interface work normally the applied program testing method.
In one embodiment, the application program is wechat small routine, and the third-party application is wechat.The side
Method includes:
Step 101, user information is obtained.
The user information is used to identify the user using the application program.
The user information may include User ID, user's head portrait, user mobile phone number etc..It is micro- in the third-party application
In the embodiment of letter, the User ID can be the WeChat ID of user.
The user information can also include user's Entered state.User's Entered state includes Entered state and not landed
State.User's Entered state can be indicated with Entered state code.For example, Entered state code is 1 expression Entered state, shape is logged in
State code is the 0 not landed state of expression.
The user information can also include OpenID.OpenID is the online identity certification of decentralization, any website
A kind of mode that OpenID can be used to log in as user, any website also all can serve as the offer of OpenID identity
Person.
The user information can also include user's pet name, user's gender, user location (such as province, city)
Deng.
In the present embodiment, the API that can be provided by third-party application obtains the user information.API is using journey
The abbreviation of sequence interface (application interface), may be implemented being in communication with each other between computer software by API.
The third-party application be wechat embodiment in, can by wechat provide API:wx.login,
Wx.getUserInfo is issued to wechat server and is requested, and obtains the user information of wechat.
The user information can be returned into the front end.For example, the user information is returned to front end js layers
In code data.
Timer can be set, the applied program testing method is periodically executed by the timer.When described fixed
When device scheduled time when reaching, execute the step of obtaining user information.
Step 102, the interface message of the interface is obtained.
The interface message is for identifying the interface.
The interface message may include interface IP address.The interface IP address can use URL (Uniform Resource
Locator, uniform resource locator) it indicates.
The interface message can also include interface identification code.The interface identification code can be number, letter or symbol,
It is also possible to any combination of number, letter, symbol.
The interface message can be read from predeterminated position (such as default file folder).Alternatively, can receive user's input
Interface message.
The interface message can be returned into the front end.For example, the interface message is returned to front end js layers
In code data.
Step 103, the test case of the interface, the test are generated according to the user information and the interface message
Input parameter of the user information described in use-case as the interface.
Test case is one group of test input, execution condition and the expected results worked out for some special objective, with
Just it tests some Program path or verifies whether meet some particular demands.
In the present embodiment, the test case has standardised generic structure.For example, the format of the test case is
{ ' name ': ' interface testing use-case name ', ' url ': ' interface message ', ' method ': ' test method ', ' args ': { ' input ginseng
Number ' }, ' ret ': { ' equal ': { ' desired value/verification data ' } } }.
One or more test cases can be generated.If generating multiple test cases, each test case can be encapsulated
For function, alternatively, whole test cases can be encapsulated into a file.
Step 104, the interface is tested using the test case, obtains the test result of the interface.
Input parameter of the user information as described in the test case as the interface, it is connect to described
When mouth is tested, the interface is passed to using the user information as the input parameter of the interface.
It can detecte and whether receive interface testing order, if receiving interface testing order, utilize the test case
The interface is tested.
The test result may include that the status code, the output valve of the interface, the interface of the interface return are returned
Return the time of the output valve.
Step 105, judge whether the interface is normal according to the test result.
In the present embodiment, judge whether the interface normally may include according to according to the output valve of the interface
Status code judges whether the interface is normal.May determine that whether the status code is preset state code, if the status code is
Preset state code (such as 200), then the interface is normal.Otherwise, if the status code is not preset state code, the interface
It is abnormal.
Judge whether the interface normally may include according to the defeated of interface return according to the output valve of the interface
Value judges whether the interface is normal out.May determine that whether the output valve is consistent with preset desired value or in the expectation
In the preset range of value, if the output valve is consistent with the desired value or in the preset range of the desired value, determines
The interface is normal.Otherwise, if the output valve and desired value is inconsistent or preset range more than the desired value,
Determine that the interface is abnormal.
Judge whether the interface normally may include according to interface return according to the output valve of the interface
The time of output valve judges whether the interface is normal.It may determine that whether the interface returns to the time of the output valve pre-
If in the time, if the interface returns to output valve in preset time (such as 1 minute), the interface is normal.Otherwise, if institute
It states interface and does not return to output valve within a preset time, then the interface is abnormal.The interface does not return to output within a preset time
Value may include that the interface returns to output valve after the preset time, also may include that the interface does not return to output
Value.
A kind of applied program testing method is present embodiments provided, application program is embedded in third-party application.It is described to answer
It include: acquisition user information with program testing method;Obtain the interface message of interface;According to the user information and the interface
Information generates the test case of the interface, input parameter of the user information described in the test case as the interface;
The interface is tested using the test case, obtains the test result of the interface;Sentenced according to the test result
Whether the interface that breaks is normal.This method can carry out automation interface survey to the application program in third-party application in insertion
Examination.
In another embodiment, the applied program testing method can also include: the test result for exporting the interface.
Application testing interface can be generated, the test result of the interface is shown on the Application testing interface.It can be with
The test report is written in the test result by the test report for generating the interface.
In another embodiment, if the applied program testing method can also include: that the interface is abnormal, interface is different
Normal information is sent to default contact person.The interface exception information can be sent to by modes such as mail, short message, wechats pre-
If contact person.
In another embodiment, the test case can also include database statement identification code and database check number
According to.For example, the format of the test case be ' name ': ' interface testing use-case name ', ' url ': ' interface message ',
' method ': ' test method ', ' args ': { ' input parameter ' }, ' ret ': ' equal ': { ' desired value/verification data ' },
' mysql ': { ' database statement identification code and database verify data ' } } }.The method can also include: according to the number
The database of the application program is verified according to library sentence identification code and database verification data.The database school
Testing data may include database check field and database check value.Carrying out verification to database is the standard in order to improve test
True property.
Carrying out verification to data library according to the database statement identification code and database verification data may include:
(1) the corresponding database language of the database statement identification code is searched from the database statement template pre-established
Sentence;
(2) database is checked according to the database statement, to obtain the inspection result of the database;
(3) inspection result is compared with database verification data, obtains the verification knot of the database
Fruit.May determine that whether the inspection result and the database check value are identical, if the inspection result and the database
Check value is identical, then the inspection result of database is correct, i.e., database authentication passes through;If the inspection result and the database
Check value is not identical, then the inspection result mistake of database, i.e., database authentication fails.
Embodiment two
Fig. 2 is the structure chart of Application testing device provided by Embodiment 2 of the present invention.The Application testing dress
It sets 20 and is applied to computer installation.Application program is embedded in third-party application.The application program includes front-end and back-end, institute
It states rear end and provides interface for front end calling.The front end is realized by third-party application frame, described using journey for showing
The page of sequence.The rear end is realized by the inner frame of the exploitation side of the application program, for realizing the business of application program
Logic.The Application testing device 20 tests the interface, and can verify the interface work normally.Such as Fig. 2 institute
Show, the application programming interfaces test device 20 may include obtaining module 201, generation module 202, test module 203, judgement
Module 204.
Module 201 is obtained, for obtaining user information.
The user information is used to identify the user using the application program.
The user information may include User ID, user's head portrait, user mobile phone number etc..It is micro- in the third-party application
In the embodiment of letter, the User ID can be the WeChat ID of user.
The user information can also include user's Entered state.User's Entered state includes Entered state and not landed
State.User's Entered state can be indicated with Entered state code.For example, Entered state code is 1 expression Entered state, shape is logged in
State code is the 0 not landed state of expression.
The user information can also include OpenID.OpenID is the online identity certification of decentralization, any website
A kind of mode that OpenID can be used to log in as user, any website also all can serve as the offer of OpenID identity
Person.
The user information can also include user's pet name, user's gender, user location (such as province, city)
Deng.
In the present embodiment, the API that can be provided by third-party application obtains the user information.API is using journey
The abbreviation of sequence interface (application interface), may be implemented being in communication with each other between computer software by API.
The third-party application be wechat embodiment in, can by wechat provide API:wx.login,
Wx.getUserInfo is issued to wechat server and is requested, and obtains the user information of wechat.
The user information can be returned into the front end.For example, the user information is returned to front end js layers
In code data.
Timer can be set, the applied program testing method is periodically executed by the timer.When described fixed
When device scheduled time when reaching, execute the step of obtaining user information.
Module 201 is obtained, is also used to obtain the interface message of the interface.
The interface message is for identifying the interface.
The interface message may include interface IP address.The interface IP address can use URL (Uniform Resource
Locator, uniform resource locator) it indicates.
The interface message can also include interface identification code.The interface identification code can be number, letter or symbol,
It is also possible to any combination of number, letter, symbol.
The interface message can be read from predeterminated position (such as default file folder).Alternatively, can receive user's input
Interface message.
The interface message can be returned into the front end.For example, the interface message is returned to front end js layers
In code data.
Generation module 202 generates the test case of the interface according to the user information and the interface message, described
Input parameter of the user information described in test case as the interface.
Test case is one group of test input, execution condition and the expected results worked out for some special objective, with
Just it tests some Program path or verifies whether meet some particular demands.
In the present embodiment, the test case has standardised generic structure.For example, the format of the test case is
{ ' name ': ' interface testing use-case name ', ' url ': ' interface message ', ' method ': ' test method ', ' args ': { ' input ginseng
Number ' }, ' ret ': { ' equal ': { ' desired value/verification data ' } } }.
One or more test cases can be generated.If generating multiple test cases, each test case can be encapsulated
For function, alternatively, whole test cases can be encapsulated into a file.
Test module 203 obtains the test of the interface for testing using the test case the interface
As a result.
Input parameter of the user information as described in the test case as the interface, it is connect to described
When mouth is tested, the interface is passed to using the user information as the input parameter of the interface.
It can detecte and whether receive interface testing order, if receiving interface testing order, utilize the test case
The interface is tested.
The test result may include that the status code, the output valve of the interface, the interface of the interface return are returned
Return the time of the output valve.
Judgment module 204, for judging whether the interface is normal according to the test result.
In the present embodiment, judge whether the interface normally may include according to according to the output valve of the interface
Status code judges whether the interface is normal.May determine that whether the status code is preset state code, if the status code is
Preset state code (such as 200), then the interface is normal.Otherwise, if the status code is not preset state code, the interface
It is abnormal.
Judge whether the interface normally may include according to the defeated of interface return according to the output valve of the interface
Value judges whether the interface is normal out.May determine that whether the output valve is consistent with preset desired value or in the expectation
In the preset range of value, if the output valve is consistent with the desired value or in the preset range of the desired value, determines
The interface is normal.Otherwise, if the output valve and desired value is inconsistent or preset range more than the desired value,
Determine that the interface is abnormal.
Judge whether the interface normally may include according to interface return according to the output valve of the interface
The time of output valve judges whether the interface is normal.It may determine that whether the interface returns to the time of the output valve pre-
If in the time, if the interface returns to output valve in preset time (such as 1 minute), the interface is normal.Otherwise, if institute
It states interface and does not return to output valve within a preset time, then the interface is abnormal.The interface does not return to output within a preset time
Value may include that the interface returns to output valve after the preset time, also may include that the interface does not return to output
Value.
A kind of Application testing device 20 is present embodiments provided, application program is embedded in third-party application.It is described
Application testing device 20 obtains user information;Obtain the interface message of interface;According to the user information and the interface
Information generates the test case of the interface, input parameter of the user information described in the test case as the interface;
The interface is tested using the test case, obtains the test result of the interface;Sentenced according to the test result
Whether the interface that breaks is normal.The present embodiment can carry out automation interface survey to the application program in third-party application in insertion
Examination.
In another embodiment, the Application testing device 20 can also include: output unit, described for exporting
The test result of interface.Application testing interface can be generated, show the interface on the Application testing interface
Test result.The test report is written in the test result by the test report that the interface can be generated.
Further, the Application testing device 20 can also include: transmission unit, if the test knot for interface
Fruit is abnormal, and exception information notice is sent to default contact person, can be by modes such as mail, short message, wechats by the interface
Exception information is sent to default contact person.
In another embodiment, the test case can also include database statement identification code and database check number
According to.For example, the format of the test case be ' name ': ' interface testing use-case name ', ' url ': ' interface message ',
' method ': ' test method ', ' args ': { ' input parameter ' }, ' ret ': ' equal ': { ' desired value/verification data ' },
' mysql ': { ' database statement identification code and database verify data ' } } }.It is connect according to the judgement of the output valve of the interface
Whether mouth normally may include: according to the database statement identification code and database verification data to the application program
Database verified.The database verification data may include database check field and database check value.Logarithm
Carrying out verification according to library is the accuracy in order to improve test.
Carrying out verification to data library according to the database statement identification code and database verification data may include:
(1) the corresponding database language of the database statement identification code is searched from the database statement template pre-established
Sentence;
(2) database is checked according to the database statement, to obtain the inspection result of the database;
(3) inspection result is compared with database verification data, obtains the verification knot of the database
Fruit.May determine that whether the inspection result and the database check value are identical, if the inspection result and the database
Check value is identical, then the inspection result of database is correct, i.e., database authentication passes through;If the inspection result and the database
Check value is not identical, then the inspection result mistake of database, i.e., database authentication fails.
Embodiment three
The present embodiment provides a kind of computer readable storage medium, computer is stored on the computer readable storage medium
Program, the computer program realize the step in above-mentioned applied program testing method embodiment, such as Fig. 1 when being executed by processor
Shown step 101-105:
Step 101, user information is obtained;
Step 102, the interface message of interface is obtained;
Step 103, the test case of the interface, the test are generated according to the user information and the interface message
Input parameter of the user information described in use-case as the interface;
Step 104, the interface is tested using the test case, obtains the test result of the interface;
Step 105, judge whether the interface is normal according to the test result.
Alternatively, the function of each module in above-mentioned apparatus embodiment is realized when the computer program is executed by processor, such as
Module 201-204 in Fig. 2:
Module 201 is obtained, for obtaining the interface message of user information and interface;
Generation module 202 generates the test case of the interface according to the user information and the interface message, described
Input parameter of the user information described in test case as the interface;
Test module 203 obtains the test of the interface for testing using the test case the interface
As a result;
Judgment module 204, for judging whether the interface is normal according to the test result.
Example IV
Fig. 3 is the schematic diagram for the computer installation that the embodiment of the present invention four provides.The computer installation 30 includes storage
Device 301, processor 302 and it is stored in the computer program that can be run in the memory 301 and on the processor 302
303, such as Application testing program.The processor 302 realizes above-mentioned application program when executing the computer program 303
Step in test method embodiment, such as step 101-105 shown in FIG. 1:
Step 101, user information is obtained;
Step 102, the interface message of interface is obtained;
Step 103, the test case of the interface, the test are generated according to the user information and the interface message
Input parameter of the user information described in use-case as the interface;
Step 104, the interface is tested using the test case, obtains the test result of the interface;
Step 105, judge whether the interface is normal according to the test result.
Alternatively, realized when the processor 302 executes the computer program 303 each module in above-mentioned apparatus embodiment/
The function of unit, such as the module 201-204 in Fig. 2:
Module 201 is obtained, for obtaining the interface message of user information and interface;
Generation module 202 generates the test case of the interface according to the user information and the interface message, described
Input parameter of the user information described in test case as the interface;
Test module 203 obtains the test of the interface for testing using the test case the interface
As a result;
Judgment module 204, for judging whether the interface is normal according to the test result.
Illustratively, the computer program 303 can be divided into one or more modules, one or more of
Module is stored in the memory 301, and is executed by the processor 302, to complete this method.It is one or more of
Module can be the series of computation machine program instruction section that can complete specific function, and the instruction segment is for describing the computer
Implementation procedure of the program 303 in the computer installation 30.For example, the computer program 303 can be divided into Fig. 2
Acquisition module 201, generation module 202, test module 203, judgment module 204, each unit concrete function is referring to embodiment two.
The computer installation 30 can be the calculating such as desktop PC, notebook, palm PC and cloud server
Equipment.It will be understood by those skilled in the art that the schematic diagram 3 is only the example of computer installation 30, do not constitute to meter
The restriction of calculation machine device 30 may include perhaps combining certain components or different portions than illustrating more or fewer components
Part, such as the computer installation 30 can also include input-output equipment, network access equipment, bus etc..
Alleged processor 302 can be central processing unit (Central Processing Unit, CPU), can also be
Other general processors, digital signal processor (Digital Signal Processor, DSP), specific integrated circuit
(Application Specific Integrated Circuit, ASIC), ready-made programmable gate array (Field-
Programmable Gate Array, FPGA) either other programmable logic device, discrete gate or transistor logic,
Discrete hardware components etc..General processor can be microprocessor or the processor 302 is also possible to any conventional processing
Device etc., the processor 302 are the control centres of the computer installation 30, are entirely calculated using various interfaces and connection
The various pieces of machine device 30.
The memory 301 can be used for storing the computer program 303, and the processor 302 is by operation or executes
The computer program or module being stored in the memory 301, and the data being stored in memory 301 are called, it realizes
The various functions of the computer installation 30.The memory 301 can mainly include storing program area and storage data area,
In, storing program area can application program needed for storage program area, at least one function (such as sound-playing function, image
Playing function etc.) etc.;Storage data area, which can be stored, uses created data (such as audio number according to computer installation 30
According to, phone directory etc.) etc..In addition, memory 301 may include high-speed random access memory, it can also include non-volatile deposit
Reservoir, such as hard disk, memory, plug-in type hard disk, intelligent memory card (Smart Media Card, SMC), secure digital
(Secure Digital, SD) card, flash card (Flash Card), at least one disk memory, flush memory device or other
Volatile solid-state part.
If the integrated module of the computer installation 30 is realized in the form of SFU software functional unit and as independent production
Product when selling or using, can store in a computer readable storage medium.Based on this understanding, the present invention realizes
All or part of the process in above-described embodiment method can also instruct relevant hardware to complete by computer program,
The computer program can be stored in a computer readable storage medium, the computer program when being executed by processor,
The step of above-mentioned each embodiment of the method can be achieved.Wherein, the computer program includes computer program code, the calculating
Machine program code can be source code form, object identification code form, executable file or certain intermediate forms etc..The computer
Readable medium may include: any entity or device, recording medium, USB flash disk, the movement that can carry the computer program code
Hard disk, magnetic disk, CD, computer storage, read-only memory (ROM, Read-Only Memory), random access memory
(RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium etc..It needs to illustrate
It is that the content that the computer-readable medium includes can be fitted according to the requirement made laws in jurisdiction with patent practice
When increase and decrease, such as in certain jurisdictions, according to legislation and patent practice, computer-readable medium does not include electric carrier wave letter
Number and telecommunication signal.
In conclusion the present invention provides a kind of applied program testing method, device, computer installation and storage medium,
Application program is embedded in third-party application.The applied program testing method includes: acquisition user information;Obtain connecing for interface
Message breath;The test case of the interface, institute in the test case are generated according to the user information and the interface message
State input parameter of the user information as the interface;The interface is tested using the test case, is obtained described
The test result of interface;Judge whether the interface is normal according to the test result.The present invention can be in third-party application
Application program in insertion carries out automation interface test.
In several embodiments provided by the present invention, it should be understood that disclosed system, device and method can be with
It realizes by another way.For example, the apparatus embodiments described above are merely exemplary, for example, the module
It divides, only a kind of logical function partition, there may be another division manner in actual implementation.
The module as illustrated by the separation member may or may not be physically separated, aobvious as module
The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple
In network unit.Some or all of the modules therein can be selected to realize the mesh of this embodiment scheme according to the actual needs
's.
It, can also be in addition, each functional module in each embodiment of the present invention can integrate in one processing unit
It is that each unit physically exists alone, can also be integrated in one unit with two or more units.Above-mentioned integrated list
Member both can take the form of hardware realization, can also realize in the form of hardware adds software function module.
The above-mentioned integrated unit realized in the form of software function module, can store and computer-readable deposit at one
In storage media.Above-mentioned software function module is stored in a storage medium, including some instructions are used so that a computer
It is each that equipment (can be personal computer, server or the network equipment etc.) or processor (processor) execute the present invention
The part steps of embodiment the method.
It is obvious to a person skilled in the art that invention is not limited to the details of the above exemplary embodiments, Er Qie
In the case where without departing substantially from spirit or essential attributes of the invention, the present invention can be realized in other specific forms.Therefore, no matter
From the point of view of which point, the present embodiments are to be considered as illustrative and not restrictive, and the scope of the present invention is by appended power
Benefit requires rather than above description limits, it is intended that all by what is fallen within the meaning and scope of the equivalent elements of the claims
Variation is included in the present invention.Any attached associated diagram label in claim should not be considered as right involved in limitation to want
It asks.Furthermore, it is to be understood that one word of " comprising " does not exclude other units or steps, odd number is not excluded for plural number.It is stated in system claims
Multiple units or device can also be implemented through software or hardware by a unit or device.The first, the second equal words
It is used to indicate names, and does not indicate any particular order.
Finally it should be noted that the above examples are only used to illustrate the technical scheme of the present invention and are not limiting, although reference
Preferred embodiment describes the invention in detail, those skilled in the art should understand that, it can be to of the invention
Technical solution is modified or equivalent replacement, without departing from the spirit and scope of the technical solution of the present invention.
Claims (10)
1. a kind of applied program testing method, application program are embedded in third-party application, which is characterized in that the method packet
It includes:
Obtain user information;
Obtain the interface message of interface;
The test case that the interface is generated according to the user information and the interface message, is used described in the test case
Input parameter of the family information as the interface;
The interface is tested using the test case, obtains the test result of the interface;
Judge whether the interface is normal according to the test result.
2. applied program testing method as described in claim 1, which is characterized in that the acquisition user information includes:
The user information is obtained by the API that the third-party application provides.
3. applied program testing method as described in claim 1, which is characterized in that the test case has standardised generic
Structure.
4. applied program testing method as described in claim 1, which is characterized in that the test result includes that the interface returns
Status code, the output valve of the interface and/or the interface returned returns to the time of the output valve.
5. applied program testing method as claimed in claim 4, which is characterized in that described to judge institute according to the test result
State interface whether normally include:
Judge whether the status code is preset state code;
Judge whether the output valve is consistent with preset desired value or in the preset range of the desired value;
Judge whether within a preset time the interface returns to the time of the output valve.
6. applied program testing method as described in claim 1, which is characterized in that the test case further includes database language
Sentence identification code and database verify data, the method also includes:
School is carried out to the database of the application program according to the database statement identification code and database verification data
It tests.
7. applied program testing method as claimed in claim 6, which is characterized in that described to be identified according to the database statement
Code and database verification data carry out verification to data library and include:
The corresponding database statement of the database statement identification code is searched from the database statement template pre-established;
The database is checked according to the database statement, to obtain the inspection result of the database;
The inspection result is compared with database verification data, obtains the check results of the database.
8. a kind of Application testing device, application program are embedded in third-party application, which is characterized in that described device packet
It includes:
Module is obtained, for obtaining the interface message of user information and interface;
Generation module, the test case of the interface is generated according to the user information and the interface message, and the test is used
Input parameter of the user information as the interface described in example;
Test module tests the interface using the test case, obtains the test result of the interface;
Judgment module judges whether the interface is normal according to the test result.
9. a kind of computer installation, it is characterised in that: the computer installation includes processor, and the processor is deposited for executing
The computer program stored in reservoir is to realize the applied program testing method as described in any one of claim 1-7.
10. a kind of computer readable storage medium, computer program, feature are stored on the computer readable storage medium
It is: realizes the applied program testing method as described in any one of claim 1-7 when the computer program is executed by processor.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910199220.4A CN110083526A (en) | 2019-03-15 | 2019-03-15 | Applied program testing method, device, computer installation and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910199220.4A CN110083526A (en) | 2019-03-15 | 2019-03-15 | Applied program testing method, device, computer installation and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110083526A true CN110083526A (en) | 2019-08-02 |
Family
ID=67412542
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910199220.4A Pending CN110083526A (en) | 2019-03-15 | 2019-03-15 | Applied program testing method, device, computer installation and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110083526A (en) |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110704218A (en) * | 2019-08-30 | 2020-01-17 | 深圳壹账通智能科技有限公司 | Data processing method, data processing device, computer equipment and storage medium |
CN111274131A (en) * | 2020-01-17 | 2020-06-12 | 北京达佳互联信息技术有限公司 | Interface testing method and device, electronic equipment and storage medium |
CN111355800A (en) * | 2020-02-28 | 2020-06-30 | 中国建设银行股份有限公司 | Service processing method, device, equipment and storage medium |
CN111427797A (en) * | 2020-04-12 | 2020-07-17 | 广州通达汽车电气股份有限公司 | Automatic interface testing method and device, electronic equipment and storage medium |
CN112579425A (en) * | 2019-09-27 | 2021-03-30 | 腾讯科技(深圳)有限公司 | Method, device and medium for testing small program method interface |
CN113433819A (en) * | 2021-06-09 | 2021-09-24 | 浙江中控技术股份有限公司 | Method for screening data in PID control loop and system identification method |
CN114978869A (en) * | 2022-07-15 | 2022-08-30 | 数研院(福建)信息产业发展有限公司 | Configurable interface state automatic judgment method and system |
WO2022179363A1 (en) * | 2021-02-26 | 2022-09-01 | 华为云计算技术有限公司 | Application programming interface (api) testing method and device |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105117345A (en) * | 2015-09-23 | 2015-12-02 | 网易(杭州)网络有限公司 | Interface testing method and device for application program |
CN108415832A (en) * | 2018-02-07 | 2018-08-17 | 平安科技(深圳)有限公司 | Automatic interface testing method, device, equipment and storage medium |
CN108446190A (en) * | 2017-02-16 | 2018-08-24 | 杭州海康威视数字技术股份有限公司 | interface test method and device |
CN108984388A (en) * | 2018-06-01 | 2018-12-11 | 平安壹钱包电子商务有限公司 | A kind of method and terminal device generating automatic test cases |
-
2019
- 2019-03-15 CN CN201910199220.4A patent/CN110083526A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105117345A (en) * | 2015-09-23 | 2015-12-02 | 网易(杭州)网络有限公司 | Interface testing method and device for application program |
CN108446190A (en) * | 2017-02-16 | 2018-08-24 | 杭州海康威视数字技术股份有限公司 | interface test method and device |
CN108415832A (en) * | 2018-02-07 | 2018-08-17 | 平安科技(深圳)有限公司 | Automatic interface testing method, device, equipment and storage medium |
CN108984388A (en) * | 2018-06-01 | 2018-12-11 | 平安壹钱包电子商务有限公司 | A kind of method and terminal device generating automatic test cases |
Non-Patent Citations (1)
Title |
---|
孙甲霞;雷进辉;: "面向C++的API自动测试工具的原型***实现", 河南科技学院学报(自然科学版), no. 02, 15 June 2008 (2008-06-15) * |
Cited By (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110704218A (en) * | 2019-08-30 | 2020-01-17 | 深圳壹账通智能科技有限公司 | Data processing method, data processing device, computer equipment and storage medium |
CN110704218B (en) * | 2019-08-30 | 2023-03-10 | 深圳壹账通智能科技有限公司 | Data processing method, data processing device, computer equipment and storage medium |
CN112579425A (en) * | 2019-09-27 | 2021-03-30 | 腾讯科技(深圳)有限公司 | Method, device and medium for testing small program method interface |
CN112579425B (en) * | 2019-09-27 | 2024-05-10 | 腾讯科技(深圳)有限公司 | Method, device and medium for testing applet method interface |
CN111274131A (en) * | 2020-01-17 | 2020-06-12 | 北京达佳互联信息技术有限公司 | Interface testing method and device, electronic equipment and storage medium |
CN111355800A (en) * | 2020-02-28 | 2020-06-30 | 中国建设银行股份有限公司 | Service processing method, device, equipment and storage medium |
CN111427797A (en) * | 2020-04-12 | 2020-07-17 | 广州通达汽车电气股份有限公司 | Automatic interface testing method and device, electronic equipment and storage medium |
CN111427797B (en) * | 2020-04-12 | 2023-12-05 | 广州通达汽车电气股份有限公司 | Automatic interface testing method and device, electronic equipment and storage medium |
WO2022179363A1 (en) * | 2021-02-26 | 2022-09-01 | 华为云计算技术有限公司 | Application programming interface (api) testing method and device |
CN113433819A (en) * | 2021-06-09 | 2021-09-24 | 浙江中控技术股份有限公司 | Method for screening data in PID control loop and system identification method |
CN113433819B (en) * | 2021-06-09 | 2022-05-10 | 浙江中控技术股份有限公司 | System identification method and computer equipment |
CN114978869A (en) * | 2022-07-15 | 2022-08-30 | 数研院(福建)信息产业发展有限公司 | Configurable interface state automatic judgment method and system |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110083526A (en) | Applied program testing method, device, computer installation and storage medium | |
CN108415832B (en) | Interface automation test method, device, equipment and storage medium | |
CN111506444A (en) | Form approval method and device, storage medium and electronic equipment | |
CN110990053A (en) | Method for creating and using machine learning scheme template and device | |
CN109491860A (en) | Method for detecting abnormality, terminal device and the medium of application program | |
CN111475494A (en) | Mass data processing method, system, terminal and storage medium | |
CN109828906A (en) | UI automated testing method, device, electronic equipment and storage medium | |
CN114116496A (en) | Automatic testing method, device, equipment and medium | |
US20210042291A1 (en) | Annotation Assessment and Ground Truth Construction | |
CN109542757A (en) | Interface testing environment determines method, apparatus, electronic equipment and storage medium | |
CN109582906A (en) | Determination method, apparatus, equipment and the storage medium of data reliability | |
CN112948275A (en) | Test data generation method, device, equipment and storage medium | |
CN114168565B (en) | Backtracking test method, device and system of business rule model and decision engine | |
CN113342692B (en) | Automatic test case generation method and device, electronic equipment and storage medium | |
CN113434542B (en) | Data relationship identification method and device, electronic equipment and storage medium | |
CN112395182A (en) | Automatic testing method, device, equipment and computer readable storage medium | |
CN113778878A (en) | Interface testing method and device, electronic equipment and storage medium | |
US20240086165A1 (en) | Systems and methods for building and deploying machine learning applications | |
CN112182562A (en) | Data auditing method and system in sandbox environment, electronic equipment and medium | |
CN112085611A (en) | Asynchronous data verification method and device, electronic equipment and storage medium | |
CN110362294A (en) | Development task executes method, apparatus, electronic equipment and storage medium | |
US20200327364A1 (en) | Clustering simulation failures for triage and debugging | |
US20220138584A1 (en) | Artificial content identification using subset scanning over generative model activations | |
CN111859985B (en) | AI customer service model test method and device, electronic equipment and storage medium | |
CN110008098B (en) | Method and device for evaluating operation condition of nodes in business process |
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 |