CN105354143A - Test method and device for application programs - Google Patents

Test method and device for application programs Download PDF

Info

Publication number
CN105354143A
CN105354143A CN201510868045.5A CN201510868045A CN105354143A CN 105354143 A CN105354143 A CN 105354143A CN 201510868045 A CN201510868045 A CN 201510868045A CN 105354143 A CN105354143 A CN 105354143A
Authority
CN
China
Prior art keywords
tested
application program
function
preset
application
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201510868045.5A
Other languages
Chinese (zh)
Inventor
李功文
李心珠
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Qihoo Technology Co Ltd
Qizhi Software Beijing Co Ltd
Original Assignee
Beijing Qihoo Technology Co Ltd
Qizhi Software Beijing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Qihoo Technology Co Ltd, Qizhi Software Beijing Co Ltd filed Critical Beijing Qihoo Technology Co Ltd
Priority to CN201510868045.5A priority Critical patent/CN105354143A/en
Publication of CN105354143A publication Critical patent/CN105354143A/en
Pending legal-status Critical Current

Links

Abstract

The invention discloses a test method for application programs. According to the method, the returned value of a preset API function is intercepted and modified to simulate different test scenes, and then the modified returned value is sent to an application program to be tested, so that the application program to be tested obtains the cooperation of preset hardware so as to realize a preset function, and finally the technical effect automatically testing the preset function of the application program to be tested is realized. Meanwhile, the invention provides a test device for application programs.

Description

A kind of method of testing for application program and device
Technical field
The present invention relates to technical field of software engineering, particularly relate to a kind of method of testing for application program and device.
Background technology
Along with the development of science and technology, the kind of intelligent terminal gets more and more, and present people can pass through various types of intelligent terminal, enjoy the comfortable life along with development in science and technology brings.Such as, the intelligent terminal such as smart mobile phone, panel computer has become an important ingredient in people's life, people can use the intelligent terminal such as smart mobile phone, panel computer to listen to the music, see a film, play games, surf the web etc., to live the pressure brought to alleviate modern fast pace.
Intelligent terminal, there is independently operating system, support user installs various types of APP (Application that the third party service provider provides voluntarily, application program), such as: game class APP, video class APP, music class APP, shopping class APP, security classes APP, the class APP that takes pictures, speculation in stocks class APP, social class APP, purchase by group class APP, the class APP that orders, pay class APP, etc., thus meet the various demands in people's daily life.
In APP performance history, need to carry out a large amount of Experience of Software Testing Works.Software test is whether the mode using manual operation or software automatically to run meets the demand of regulation to check APP or understand fully the process of the difference between expected results and actual result.Software test is the process of correctness, completely degree and the quality helping the software (in whole or in part) identifying that exploitation completes (middle or final version), it is the important subdomain of SQA (softwarequalityassurance, software quality assurance).
Nowadays, a lot of APP needs the cooperation of the hardware (such as: sensor) on intelligent terminal, realizes some specific functions.Such as: some social APP need under the cooperation of acceleration transducer, realize " shaking " function; Some car race games APP needs gyrostatic cooperation, realizes the function of " racing car turning "; Some shopping or payment APP need the cooperation of camera, realize the function of " barcode scanning payment "; Some navigation APP needs the cooperation of baroceptor, realizes the acquisition of elevation information; Etc..And for the test of these specific functions, the simple testing software that relies on is difficult to realize, generally needs tester to simulate associated scenario and operate in person, such as, when testing " shaking " function, tester is needed to shake mobile terminal, to trigger acceleration transducer; When testing " barcode scanning payment merit " energy, need tester to operate camera scanning payment code (can be bar code or Quick Response Code), this is unfavorable for the requirement of automatic test, causes testing efficiency lower, and this has become current problem demanding prompt solution.
Summary of the invention
In view of the above problems, the present invention is proposed to provide a kind of overcoming the problems referred to above or the method for testing for application program solved the problem at least in part and device.
One aspect of the present invention, provides a kind of method of testing for application program, comprising:
Trigger application call one to be tested and preset application programming interfaces api function; Wherein, described application program to be tested is arranged in the system of described mobile terminal, described default api function for calling the predetermined hardware in described mobile terminal, to realize the preset function in described application program to be tested;
Tackle the rreturn value of described default api function;
Described rreturn value is modified;
Amended rreturn value is sent to described application program to be tested, to make described application program to be tested realize described preset function based on described amended rreturn value, thus described preset function is tested;
Record the test result that described preset function is tested.
Preferably, described triggering application call one to be tested also comprises before presetting application programming interfaces api function:
Receive the broadcast that a default terminal sends;
From described broadcast, extract one preset request, wherein, described default request is used for request and tests described preset function;
Respond described default request, perform described triggering application call one to be tested and preset application programming interfaces api function.
Preferably, described triggering application call one to be tested also comprises before presetting application programming interfaces api function:
The system of described mobile terminal is installed described application program to be tested.
Preferably, application programming interfaces api function is preset in described triggering application call one to be tested, comprising:
A preset control on the user interface UI of described application program to be tested is operated, thus triggers default api function described in application call to be tested.
Preferably, the rreturn value of the described default api function of described interception, comprising:
By hook HOOK function, tackle the rreturn value of described default api function.
Preferably, the described rreturn value to described default api function is modified, and comprising:
From described default request, extract the parameters of described predetermined hardware;
Based on described parameters, revise described rreturn value.
Preferably, the test result that described record is tested described preset function, comprising:
Record described application program to be tested realize described preset function after related data; And/or
Record described application program to be tested realize described preset function after screenshot capture.
Preferably, after the test result that described record is tested described preset function, also comprise:
Described test result is sent to described default terminal.
Another aspect of the present invention, provides a kind of proving installation for application program, it is characterized in that, comprising:
Trigger element, presets application programming interfaces api function for triggering application call one to be tested; Wherein, described application program to be tested is arranged in the system of described mobile terminal, described default api function for calling the predetermined hardware in described mobile terminal, to realize the preset function in described application program to be tested;
Interception unit, for tackling the rreturn value of described default api function;
Amendment unit, for modifying to described rreturn value;
First transmitting element, for amended rreturn value is sent to described application program to be tested, to make described application program to be tested realize described preset function based on described amended rreturn value, thus tests described preset function;
Record cell, for recording the test result of testing described preset function.
Preferably, the described proving installation for application program, also comprises:
Receiving element, before presetting application programming interfaces api function, receives the broadcast that a default terminal sends for described triggering application call one to be tested;
Extraction unit, presets request for extracting one from described broadcast, and wherein, described default request is used for request and tests described preset function;
Response unit, for responding described default request, performing described triggering application call one to be tested and presetting application programming interfaces api function.
Preferably, the described proving installation for application program, also comprises:
Installation unit, before presetting application programming interfaces api function, the system of described mobile terminal is installed described application program to be tested for described triggering application call one to be tested.
Preferably, described trigger element, specifically for:
A preset control on the user interface UI of described application program to be tested is operated, thus triggers default api function described in application call to be tested.
Preferably, described interception unit, specifically for:
By hook HOOK function, tackle the rreturn value of described default api function.
Preferably, described amendment unit, specifically for:
From described default request, extract the parameters of described predetermined hardware; Based on described parameters, revise described rreturn value.
Preferably, described record cell, specifically for:
Record described application program to be tested realize described preset function after related data; And/or
Record described application program to be tested realize described preset function after screenshot capture.
Preferably, the described proving installation for application program, also comprises:
Second transmitting element, after the test result of testing described preset function for described record, sends to described default terminal by described test result.
The one or more technical schemes provided in the embodiment of the present application, at least have following technique effect or advantage:
According to a kind of method of testing for application program of the present invention, comprising: trigger application call one to be tested and preset application programming interfaces api function; Wherein, application program to be tested is arranged in the system of mobile terminal, presets api function for calling the predetermined hardware in mobile terminal, to realize the preset function in application program to be tested; The rreturn value of api function is preset in interception; Rreturn value is modified; Amended rreturn value is sent to application program to be tested, to make application program to be tested realize preset function based on amended rreturn value, thus preset function is tested; Record the test result that preset function is tested.The present invention presets the rreturn value of api function by interception, and this rreturn value is modified, simulate different test scenes, again amended rreturn value is sent to application program to be tested, thus make application program to be tested obtain the cooperation of predetermined hardware, to realize the function preset, finally achieve the technique effect that the preset function treating test application carries out automatic test, thus improve testing efficiency.
Above-mentioned explanation is only the general introduction of technical solution of the present invention, in order to technological means of the present invention can be better understood, and can be implemented according to the content of instructions, and can become apparent, below especially exemplified by the specific embodiment of the present invention to allow above and other objects of the present invention, feature and advantage.
Accompanying drawing explanation
By reading hereafter detailed description of the preferred embodiment, various other advantage and benefit will become cheer and bright for those of ordinary skill in the art.Accompanying drawing only for illustrating the object of preferred implementation, and does not think limitation of the present invention.And in whole accompanying drawing, represent identical parts by identical reference symbol.In the accompanying drawings:
Fig. 1 shows the Organization Chart of automation software testing system according to an embodiment of the invention;
Fig. 2 shows a kind of according to an embodiment of the invention process flow diagram of the method for testing for application program;
Fig. 3 shows a kind of according to an embodiment of the invention structural drawing of the proving installation for application program.
Embodiment
Embodiments provide a kind of method of testing for application program and device, in order to solve in prior art, the function that cannot hardware be needed to coordinate in application programs carries out the technical matters of automatic test.
Below with reference to accompanying drawings exemplary embodiment of the present disclosure is described in more detail.Although show exemplary embodiment of the present disclosure in accompanying drawing, however should be appreciated that can realize the disclosure in a variety of manners and not should limit by the embodiment set forth here.On the contrary, provide these embodiments to be in order to more thoroughly the disclosure can be understood, and complete for the scope of the present disclosure can be conveyed to those skilled in the art.
First illustrate, the term "and/or" occurred herein, being only a kind of incidence relation describing affiliated partner, can there are three kinds of relations in expression, and such as, A and/or B, can represent: individualism A, exists A and B simultaneously, these three kinds of situations of individualism B.In addition, character "/" herein, general expression forward-backward correlation is to the relation liking a kind of "or".
Secondly, before formally introducing the method for testing for application program in the present embodiment, being introduced first to the automation software testing system for realizing this method of testing.As shown in Figure 1, this automation software testing system is primarily of PC (PersonalComputer, PC) and mobile terminal composition, described mobile terminal can be: smart mobile phone or the intelligent terminal such as panel computer or vehicle-mounted computer, be not specifically limited herein.And, an OS (OperatingSystem, operating system) is installed in described mobile terminal, such as: IOS, Andorid, Windows8 or Windows10 etc., is also not specifically limited herein.In PC side, one test script is installed, at mobile terminal side, one test APP (Application is installed, application program), the method for testing for application program that the present embodiment provides, namely completes primarily of the test script of PC side and the test APP of mobile terminal side.
Embodiment one
Present embodiments provide a kind of method of testing for application program, be applied to mobile terminal side, can be completed by the test APP being arranged on mobile terminal side, as shown in Figure 2, the method comprises:
Step S101: trigger application call one to be tested and preset API (ApplicationProgramInterface, application programming interfaces) function; Wherein, application program to be tested is arranged in the system of mobile terminal, presets api function for calling the predetermined hardware in mobile terminal, to realize the preset function in application program to be tested.
In specific implementation process, before execution step S101, also comprise: in the system of mobile terminal, application program to be tested is installed.
Specifically, mobile terminal can be connected with PC by data line, and the test script of PC side can obtain the installation kit of the application program to be tested that tester provides, and application program to be tested is installed in mobile terminal based on this installation kit.Concrete installation process has following two kinds of modes:
The first, the installation data after decompress(ion) by the installation kit decompress(ion) of application program to be tested, and can be sent to mobile terminal by data line by PC side test script; After mobile terminal side test APP receives this installation data, based on this installation data, application program to be tested is arranged in the system of mobile terminal.
The second, the installation kit of application program to be tested can directly be sent to mobile terminal side test APP by data line by PC side test script; After mobile terminal side test APP receives this installation kit, run this installation kit, application program to be tested to be arranged in the system of mobile terminal.
In specific implementation process, this application program to be tested can be: game class APP or video class APP or music class APP or shopping class APP or security classes APP take pictures class APP or speculation in stocks class APP or social class APP purchase by group class APP or order class APP or pay class APP, or browser class APP, etc.Herein, for described application program to be tested specifically which kind of APP, the present embodiment is not specifically limited.
In specific implementation process, described predetermined hardware can be mounted in the sensor in mobile terminal, such as, and magnetometer, gyroscope, acceleration transducer, range sensor, baroceptor, Fibre Optical Sensor, etc.; Certainly, described predetermined hardware also can be camera.Herein, for described predetermined hardware specifically which kind of hardware, the present embodiment is not specifically limited.
In specific implementation process, there is in application program to be tested a preset function, when realizing this preset function, needing the cooperation of a predetermined hardware.Such as, some social APP need under the cooperation of acceleration transducer, realize " shaking " function; Some car race games APP needs gyrostatic cooperation, realizes " racing car turning " function; Some shopping or payment APP need the cooperation of camera, realize " barcode scanning payment " function; Some navigation APP needs the cooperation of baroceptor, realizes the acquisition of elevation information; " electronic compass " APP needs under the cooperation of magnetometer, realizes " compass " function.
In specific implementation process, mobile terminal side test APP can under the control of PC side test script, and the described preset function starting to treat test application is tested.Specifically, before step S101, mobile terminal side test APP can receive the broadcast that a default terminal (that is: PC) sends, and from broadcast, extract a default request (wherein, this presets request for asking the preset function treated in test application to be tested), request is preset in response again, starts to perform step S101.Wherein, this broadcast is that PC side test script sends under the control of tester, and the described preset function starting to treat test application to control mobile terminal side test APP is tested.
In specific implementation process, when performing step S010, mobile terminal side APP can treat the UI (UserInterface of test application, user interface) on a preset control (such as: order button control) operate, thus trigger application call one to be tested and preset api function.For example, when needs are tested " shaking " function, then on UI interface, finding the order button for opening " shaking " function, and triggering this button; When needs are tested " barcode scanning payment " function, then on UI interface, finding the order button for opening " barcode scanning payment ", and triggering this button; When needs are tested " compass " function, then on UI interface, finding the order button for opening " compass ", and triggering this button; Etc.).After this preset control is operated, APP to be tested then opens corresponding preset function, and call a default api function, this default api function is for calling corresponding hardware (such as: the acceleration transducer that " shaking " function needs, or the camera that " barcode scanning payment " function needs, or the magnetometer that " compass " function needs, etc.), thus realize the preset function needing test.
Step S102: the rreturn value of api function is preset in interception.
In specific implementation process, mobile terminal side test APP, can pass through HOOK (hook) function, and the rreturn value of api function is preset in interception.
In specific implementation process, when the preset function (that is: the function needing predetermined hardware to coordinate) to application program to be measured carries out automation software testing, simulate associated scenario operate in person to remove tester from, herein, interception is needed to preset the rreturn value of api function.This rreturn value is to send to application program to be tested originally, to realize the preset function that will test based on rreturn value to make application program to be tested, but because now tester does not operate related hardware, the information in rreturn value cannot make application program to be tested complete the preset function needing test.At this moment just need to continue to perform step S103.
Step S103: rreturn value is modified.
In specific implementation process, the parameters of described predetermined hardware can be comprised in the default request of the broadcast sent at PC side test script, now, mobile terminal side test APP can preset request from this, extract the parameters of predetermined hardware, and revise the rreturn value of the default api function intercepted based on parameters.
For example, when testing " shaking " function, the rreturn value of default api function can be revised as the rreturn value that acceleration transducer produces when tester shakes mobile terminal, thus " shaking " that is virtually reality like reality operation, thus " shaking " function is tested.
For example, when testing " compass " function, the rreturn value of default api function can be revised as and the rreturn value of mobile terminal front for producing during south be detected at magnetometer, thus simulating mobile terminal front is southern scene, tests " compass " function.
For example, when testing " barcode scanning payment " function, the rreturn value of default api function can be revised as the rreturn value produced when camera surface sweeping presets payment code to, thus " barcode scanning payment " that is virtually reality like reality operation, thus " barcode scanning payment " function is tested.
For example, when testing " racing car turning " function of car race game, the rreturn value of default api function can be revised as the rreturn value produced when gyroscope detects that mobile terminal is tilted to the left, thus " racing car left-hand rotation " that is virtually reality like reality operation, thus " racing car turning " function is tested.
Step S104: amended rreturn value is sent to application program to be tested, to make application program to be tested realize preset function based on amended rreturn value, thus tests preset function.
For example, when testing " shaking " function, if this function is normal, then when application program to be tested realizes " shaking " function based on amended rreturn value, application program to be tested can show default picture (such as: will simultaneously carry out the letter of the user that " shaking " operates by screen display out).If this dysfunction, then cannot obtain the picture preset.
For example, when testing " compass " function, if this function is normal, then when then realizing " compass " function in application program to be tested based on amended rreturn value, application program to be tested can show that one presets picture (such as: mobile terminal front is designated as southern picture).If this dysfunction, then cannot obtain the picture that this is preset.
For example, when testing " barcode scanning payment " function, if this function is normal, then when application program to be tested realizes " barcode scanning payment " function based on amended rreturn value, application program to be tested can show one and preset payment interface.If this dysfunction, then cannot show this default payment interface.
For example, when testing " racing car left-hand rotation " function, if this function is normal, then application program to be tested based on amended rreturn value, can control racing car and turns left, and the racing car left-hand rotation picture that display is corresponding.If this dysfunction, then uncontrollable racing car is turned left, and also cannot show racing car left-hand rotation picture.
In the present embodiment, by tackling the rreturn value of default api function, and this rreturn value is modified, simulate different test scenes, again amended rreturn value is sent to application program to be tested, thus make application program to be tested obtain the cooperation of predetermined hardware, to realize the function preset, finally achieve the technique effect that the preset function treating test application carries out automatic test.
Step S105: record the test result that preset function is tested.
In specific implementation process, test result can show tester by some related datas in application program to be tested, or shows tester by screenshot capture, so more directly perceived.Therefore, in step S105, can record application program to be tested realize preset function after related data, and/or, record application program to be tested realize preset function after screenshot capture.
As a kind of optional embodiment, after step S105, also comprise:
Test result is sent to default terminal (that is: PC).
In specific implementation process, after acquisition test result, mobile terminal side test APP needs test result to be sent to PC side test script, shows test results to tester to make PC side test script.Test result is fed back to research staff by tester again, is conducive to research staff and improves.
The technical scheme provided in the embodiment of the present application, at least has following technique effect or advantage:
According to a kind of method of testing for application program of the present invention, comprising: trigger application call one to be tested and preset application programming interfaces api function; Wherein, application program to be tested is arranged in the system of mobile terminal, presets api function for calling the predetermined hardware in mobile terminal, to realize the preset function in application program to be tested; The rreturn value of api function is preset in interception; Rreturn value is modified; Amended rreturn value is sent to application program to be tested, to make application program to be tested realize preset function based on amended rreturn value, thus preset function is tested; Record the test result that preset function is tested.The present invention presets the rreturn value of api function by interception, and this rreturn value is modified, simulate different test scenes, again amended rreturn value is sent to application program to be tested, thus make application program to be tested obtain the cooperation of predetermined hardware, to realize the function preset, finally achieve the technique effect that the preset function treating test application carries out automatic test, thus improve testing efficiency.
Embodiment two
Based on same inventive concept, present embodiments provide a kind of proving installation for application program, as shown in Figure 3, comprising:
Trigger element 201, presets application programming interfaces api function for triggering application call one to be tested; Wherein, described application program to be tested is arranged in the system of described mobile terminal, described default api function for calling the predetermined hardware in described mobile terminal, to realize the preset function in described application program to be tested;
Interception unit 202, for tackling the rreturn value of described default api function;
Amendment unit 203, for modifying to described rreturn value;
First transmitting element 204, for amended rreturn value is sent to described application program to be tested, to make described application program to be tested realize described preset function based on described amended rreturn value, thus tests described preset function;
Record cell 205, for recording the test result of testing described preset function.
As a kind of optional embodiment, the described proving installation for application program, also comprises:
Receiving element, before presetting application programming interfaces api function, receives the broadcast that a default terminal sends for described triggering application call one to be tested;
Extraction unit, presets request for extracting one from described broadcast, and wherein, described default request is used for request and tests described preset function;
Response unit, for responding described default request, performing described triggering application call one to be tested and presetting application programming interfaces api function.
As a kind of optional embodiment, the described proving installation for application program, also comprises:
Installation unit, before presetting application programming interfaces api function, the system of described mobile terminal is installed described application program to be tested for described triggering application call one to be tested.
As a kind of optional embodiment, described trigger element 201, specifically for:
A preset control on the user interface UI of described application program to be tested is operated, thus triggers default api function described in application call to be tested.
As a kind of optional embodiment, described interception unit 202, specifically for:
By hook HOOK function, tackle the rreturn value of described default api function.
As a kind of optional embodiment, described amendment unit, specifically for:
From described default request, extract the parameters of described predetermined hardware; Based on described parameters, revise described rreturn value.
As a kind of optional embodiment, described record cell 205, specifically for:
Record described application program to be tested realize described preset function after related data; And/or
Record described application program to be tested realize described preset function after screenshot capture.
As a kind of optional embodiment, the described proving installation for application program, also comprises:
Second transmitting element, after the test result of testing described preset function for described record, sends to described default terminal by described test result.
Due to the device adopted for the method for testing for application program in enforcement the embodiment of the present application for the proving installation of application program that the present embodiment is introduced, so based on the method for testing for application program introduced in the embodiment of the present application, those skilled in the art can understand embodiment and its various version of the proving installation for application program of the present embodiment, so introduce no longer in detail in this method of testing for application program how realized in the embodiment of the present application for this proving installation for application program.As long as those skilled in the art implement for the device that the method for testing of application program adopts in the embodiment of the present application, all belong to the application for protection scope.
The technical scheme provided in the embodiment of the present application, at least has following technique effect or advantage:
According to a kind of proving installation for application program of the present invention, comprising: trigger element, presetting application programming interfaces api function for triggering application call one to be tested; Wherein, application program to be tested is arranged in the system of mobile terminal, presets api function for calling the predetermined hardware in mobile terminal, to realize the preset function in application program to be tested; Interception unit, for tackling the rreturn value of default api function; Amendment unit, for modifying to rreturn value; First transmitting element, for amended rreturn value is sent to application program to be tested, to make application program to be tested realize preset function based on amended rreturn value, thus tests preset function; Record cell, for recording the test result of testing preset function.The present invention presets the rreturn value of api function by interception, and this rreturn value is modified, simulate different test scenes, again amended rreturn value is sent to application program to be tested, thus make application program to be tested obtain the cooperation of predetermined hardware, to realize the function preset, finally achieve the technique effect that the preset function treating test application carries out automatic test, thus improve testing efficiency.
Intrinsic not relevant to any certain computer, virtual system or miscellaneous equipment with display at this algorithm provided.Various general-purpose system also can with use based on together with this teaching.According to description above, the structure constructed required by this type systematic is apparent.In addition, the present invention is not also for any certain programmed language.It should be understood that and various programming language can be utilized to realize content of the present invention described here, and the description done language-specific is above to disclose preferred forms of the present invention.
In instructions provided herein, describe a large amount of detail.But can understand, embodiments of the invention can be put into practice when not having these details.In some instances, be not shown specifically known method, structure and technology, so that not fuzzy understanding of this description.
Similarly, be to be understood that, in order to simplify the disclosure and to help to understand in each inventive aspect one or more, in the description above to exemplary embodiment of the present invention, each feature of the present invention is grouped together in single embodiment, figure or the description to it sometimes.But, the method for the disclosure should be construed to the following intention of reflection: namely the present invention for required protection requires feature more more than the feature clearly recorded in each claim.Or rather, as claims below reflect, all features of disclosed single embodiment before inventive aspect is to be less than.Therefore, the claims following embodiment are incorporated to this embodiment thus clearly, and wherein each claim itself is as independent embodiment of the present invention.
Those skilled in the art are appreciated that and adaptively can change the module in the equipment in embodiment and they are arranged in one or more equipment different from this embodiment.Module in embodiment or unit or assembly can be combined into a module or unit or assembly, and multiple submodule or subelement or sub-component can be put them in addition.Except at least some in such feature and/or process or unit be mutually repel except, any combination can be adopted to combine all processes of all features disclosed in this instructions (comprising adjoint claim, summary and accompanying drawing) and so disclosed any method or equipment or unit.Unless expressly stated otherwise, each feature disclosed in this instructions (comprising adjoint claim, summary and accompanying drawing) can by providing identical, alternative features that is equivalent or similar object replaces.
In addition, those skilled in the art can understand, although to comprise in other embodiment some included feature instead of further feature in this some embodiments, the combination of the feature of different embodiment means and to be within scope of the present invention and to form different embodiments.Such as, in the following claims, the one of any of embodiment required for protection can use with arbitrary array mode.
All parts embodiment of the present invention with hardware implementing, or can realize with the software module run on one or more processor, or realizes with their combination.It will be understood by those of skill in the art that the some or all functions that microprocessor or digital signal processor (DSP) can be used in practice to realize the some or all parts in gateway according to the embodiment of the present invention, proxy server, system.The present invention can also be embodied as part or all equipment for performing method as described herein or device program (such as, computer program and computer program).Realizing program of the present invention and can store on a computer-readable medium like this, or the form of one or more signal can be had.Such signal can be downloaded from internet website and obtain, or provides on carrier signal, or provides with any other form.
The present invention will be described instead of limit the invention to it should be noted above-described embodiment, and those skilled in the art can design alternative embodiment when not departing from the scope of claims.In the claims, any reference symbol between bracket should be configured to limitations on claims.Word " comprises " not to be got rid of existence and does not arrange element in the claims or step.Word "a" or "an" before being positioned at element is not got rid of and be there is multiple such element.The present invention can by means of including the hardware of some different elements and realizing by means of the computing machine of suitably programming.In the unit claim listing some devices, several in these devices can be carry out imbody by same hardware branch.Word first, second and third-class use do not represent any order.Can be title by these word explanations.
The invention discloses, A1, a kind of method of testing for application program, it is characterized in that, comprising:
Trigger application call one to be tested and preset application programming interfaces api function; Wherein, described application program to be tested is arranged in the system of described mobile terminal, described default api function for calling the predetermined hardware in described mobile terminal, to realize the preset function in described application program to be tested;
Tackle the rreturn value of described default api function;
Described rreturn value is modified;
Amended rreturn value is sent to described application program to be tested, to make described application program to be tested realize described preset function based on described amended rreturn value, thus described preset function is tested;
Record the test result that described preset function is tested.
A2, the method for testing for application program as described in A1, it is characterized in that, described triggering application call one to be tested also comprises before presetting application programming interfaces api function:
Receive the broadcast that a default terminal sends;
From described broadcast, extract one preset request, wherein, described default request is used for request and tests described preset function;
Respond described default request, perform described triggering application call one to be tested and preset application programming interfaces api function.
A3, the method for testing for application program as described in A2, it is characterized in that, described triggering application call one to be tested also comprises before presetting application programming interfaces api function:
The system of described mobile terminal is installed described application program to be tested.
A4, the method for testing for application program as described in A1, it is characterized in that, application programming interfaces api function is preset in described triggering application call one to be tested, comprising:
A preset control on the user interface UI of described application program to be tested is operated, thus triggers default api function described in application call to be tested.
A5, the method for testing for application program as described in A1, it is characterized in that, the rreturn value of the described default api function of described interception, comprising:
By hook HOOK function, tackle the rreturn value of described default api function.
A6, the method for testing for application program as described in A2, it is characterized in that, the described rreturn value to described default api function is modified, and comprising:
From described default request, extract the parameters of described predetermined hardware;
Based on described parameters, revise described rreturn value.
A7, the method for testing for application program as described in A1, is characterized in that the test result that described record is tested described preset function comprises:
Record described application program to be tested realize described preset function after related data; And/or
Record described application program to be tested realize described preset function after screenshot capture.
A8, as arbitrary in A2 ~ A7 as described in the method for testing for application program, it is characterized in that, after the test result that described record is tested described preset function, also comprise:
Described test result is sent to described default terminal.
B9, a kind of proving installation for application program, is characterized in that, comprising:
Trigger element, presets application programming interfaces api function for triggering application call one to be tested; Wherein, described application program to be tested is arranged in the system of described mobile terminal, described default api function for calling the predetermined hardware in described mobile terminal, to realize the preset function in described application program to be tested;
Interception unit, for tackling the rreturn value of described default api function;
Amendment unit, for modifying to described rreturn value;
First transmitting element, for amended rreturn value is sent to described application program to be tested, to make described application program to be tested realize described preset function based on described amended rreturn value, thus tests described preset function;
Record cell, for recording the test result of testing described preset function.
B10, the proving installation for application program as described in B9, it is characterized in that, the described proving installation for application program, also comprises:
Receiving element, before presetting application programming interfaces api function, receives the broadcast that a default terminal sends for described triggering application call one to be tested;
Extraction unit, presets request for extracting one from described broadcast, and wherein, described default request is used for request and tests described preset function;
Response unit, for responding described default request, performing described triggering application call one to be tested and presetting application programming interfaces api function.
B11, the proving installation for application program as described in B10, it is characterized in that, the described proving installation for application program, also comprises:
Installation unit, before presetting application programming interfaces api function, the system of described mobile terminal is installed described application program to be tested for described triggering application call one to be tested.
B12, the proving installation for application program as described in B9, is characterized in that, described trigger element, specifically for:
A preset control on the user interface UI of described application program to be tested is operated, thus triggers default api function described in application call to be tested.
B13, the proving installation for application program as described in B9, is characterized in that, described interception unit, specifically for:
By hook HOOK function, tackle the rreturn value of described default api function.
B14, the proving installation for application program as described in B10, is characterized in that, described amendment unit, specifically for:
From described default request, extract the parameters of described predetermined hardware; Based on described parameters, revise described rreturn value.
B15, the proving installation for application program as described in B9, is characterized in that, described record cell, specifically for:
Record described application program to be tested realize described preset function after related data; And/or
Record described application program to be tested realize described preset function after screenshot capture.
B16, as arbitrary in B10 ~ B15 as described in the proving installation for application program, it is characterized in that, the described proving installation for application program, also comprises:
Second transmitting element, after the test result of testing described preset function for described record, sends to described default terminal by described test result.

Claims (10)

1. for a method of testing for application program, it is characterized in that, comprising:
Trigger application call one to be tested and preset application programming interfaces api function; Wherein, described application program to be tested is arranged in the system of described mobile terminal, described default api function for calling the predetermined hardware in described mobile terminal, to realize the preset function in described application program to be tested;
Tackle the rreturn value of described default api function;
Described rreturn value is modified;
Amended rreturn value is sent to described application program to be tested, to make described application program to be tested realize described preset function based on described amended rreturn value, thus described preset function is tested;
Record the test result that described preset function is tested.
2., as claimed in claim 1 for the method for testing of application program, it is characterized in that, described triggering application call one to be tested also comprises before presetting application programming interfaces api function:
Receive the broadcast that a default terminal sends;
From described broadcast, extract one preset request, wherein, described default request is used for request and tests described preset function;
Respond described default request, perform described triggering application call one to be tested and preset application programming interfaces api function.
3., as claimed in claim 2 for the method for testing of application program, it is characterized in that, described triggering application call one to be tested also comprises before presetting application programming interfaces api function:
The system of described mobile terminal is installed described application program to be tested.
4., as claimed in claim 1 for the method for testing of application program, it is characterized in that, application programming interfaces api function is preset in described triggering application call one to be tested, comprising:
A preset control on the user interface UI of described application program to be tested is operated, thus triggers default api function described in application call to be tested.
5., as claimed in claim 1 for the method for testing of application program, it is characterized in that, the rreturn value of the described default api function of described interception, comprising:
By hook HOOK function, tackle the rreturn value of described default api function.
6., as claimed in claim 2 for the method for testing of application program, it is characterized in that, the described rreturn value to described default api function is modified, and comprising:
From described default request, extract the parameters of described predetermined hardware;
Based on described parameters, revise described rreturn value.
7., as claimed in claim 1 for the method for testing of application program, it is characterized in that the test result that described record is tested described preset function comprises:
Record described application program to be tested realize described preset function after related data; And/or
Record described application program to be tested realize described preset function after screenshot capture.
8. the method for testing for application program as described in as arbitrary in claim 2 ~ 7, is characterized in that, after the test result that described record is tested described preset function, also comprises:
Described test result is sent to described default terminal.
9. for a proving installation for application program, it is characterized in that, comprising:
Trigger element, presets application programming interfaces api function for triggering application call one to be tested; Wherein, described application program to be tested is arranged in the system of described mobile terminal, described default api function for calling the predetermined hardware in described mobile terminal, to realize the preset function in described application program to be tested;
Interception unit, for tackling the rreturn value of described default api function;
Amendment unit, for modifying to described rreturn value;
First transmitting element, for amended rreturn value is sent to described application program to be tested, to make described application program to be tested realize described preset function based on described amended rreturn value, thus tests described preset function;
Record cell, for recording the test result of testing described preset function.
10., as claimed in claim 9 for the proving installation of application program, it is characterized in that, the described proving installation for application program, also comprises:
Receiving element, before presetting application programming interfaces api function, receives the broadcast that a default terminal sends for described triggering application call one to be tested;
Extraction unit, presets request for extracting one from described broadcast, and wherein, described default request is used for request and tests described preset function;
Response unit, for responding described default request, performing described triggering application call one to be tested and presetting application programming interfaces api function.
CN201510868045.5A 2015-12-02 2015-12-02 Test method and device for application programs Pending CN105354143A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510868045.5A CN105354143A (en) 2015-12-02 2015-12-02 Test method and device for application programs

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510868045.5A CN105354143A (en) 2015-12-02 2015-12-02 Test method and device for application programs

Publications (1)

Publication Number Publication Date
CN105354143A true CN105354143A (en) 2016-02-24

Family

ID=55330117

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510868045.5A Pending CN105354143A (en) 2015-12-02 2015-12-02 Test method and device for application programs

Country Status (1)

Country Link
CN (1) CN105354143A (en)

Cited By (22)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105975394A (en) * 2016-05-06 2016-09-28 华为技术有限公司 Program testing method and device
CN106096399A (en) * 2016-06-01 2016-11-09 努比亚技术有限公司 The detection device and method of application programming interface
CN106227664A (en) * 2016-07-22 2016-12-14 华为技术有限公司 A kind of method and device testing application program
CN107203465A (en) * 2016-03-18 2017-09-26 阿里巴巴集团控股有限公司 System interface method of testing and device
CN107220169A (en) * 2016-03-21 2017-09-29 阿里巴巴集团控股有限公司 A kind of emulating server returns to the method and apparatus for customizing data
CN107294808A (en) * 2017-07-05 2017-10-24 网易(杭州)网络有限公司 The methods, devices and systems of interface testing
CN107861822A (en) * 2017-10-30 2018-03-30 阿里巴巴集团控股有限公司 Method and device, the equipment of broadcast notice in simulant-client
CN108173713A (en) * 2017-12-26 2018-06-15 深圳市极致汇仪科技有限公司 A kind of more network interface card parallel test methods of list PC
CN108345535A (en) * 2017-12-26 2018-07-31 阿里巴巴集团控股有限公司 Mock test methods, device and equipment
CN108922080A (en) * 2018-06-06 2018-11-30 福建联迪商用设备有限公司 A kind of the barcode scanning payment test method and cash register of control barcode scanning gun
CN108920220A (en) * 2018-06-06 2018-11-30 北京奇虎科技有限公司 A kind of method, apparatus and terminal of function call
CN109062810A (en) * 2018-09-26 2018-12-21 北京城市网邻信息技术有限公司 A kind of test method of application program, device, electronic equipment and storage medium
CN109062806A (en) * 2018-09-14 2018-12-21 杭州数梦工场科技有限公司 A kind of program testing method, system, device and computer readable storage medium
CN109582556A (en) * 2017-09-29 2019-04-05 阿里巴巴集团控股有限公司 Test method, the device and system of a kind of application program in running of mobile terminal situation
CN109873735A (en) * 2018-12-14 2019-06-11 深圳壹账通智能科技有限公司 Performance test methods, device and the computer equipment of the H5 page
CN110008074A (en) * 2019-04-11 2019-07-12 苏州浪潮智能科技有限公司 The method, device and equipment of automatic test inquiry hardware information high-level interface
CN110580224A (en) * 2019-09-20 2019-12-17 中国银行股份有限公司 System testing method, device and equipment
CN111199353A (en) * 2019-12-31 2020-05-26 Oppo(重庆)智能科技有限公司 Test method and test system
CN111367821A (en) * 2020-05-22 2020-07-03 支付宝(杭州)信息技术有限公司 Software testing method and system
WO2020177519A1 (en) * 2019-03-05 2020-09-10 中国银联股份有限公司 Debugging method executed on smart terminal and software debugging device
CN112256984A (en) * 2020-10-22 2021-01-22 上海悦易网络信息技术有限公司 Method and device for acquiring interface background screenshot corresponding to webpage
CN112468641A (en) * 2020-10-26 2021-03-09 百果园技术(新加坡)有限公司 Program testing method, device, terminal and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2011157180A2 (en) * 2011-06-03 2011-12-22 华为技术有限公司 Method, apparatus and system for online application processing
CN103049628A (en) * 2011-10-14 2013-04-17 深圳市快播科技有限公司 Accelerating method and system of online game
CN105045713A (en) * 2015-07-14 2015-11-11 腾讯科技(深圳)有限公司 Data processing method and mobile terminal

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2011157180A2 (en) * 2011-06-03 2011-12-22 华为技术有限公司 Method, apparatus and system for online application processing
CN103049628A (en) * 2011-10-14 2013-04-17 深圳市快播科技有限公司 Accelerating method and system of online game
CN105045713A (en) * 2015-07-14 2015-11-11 腾讯科技(深圳)有限公司 Data processing method and mobile terminal

Cited By (35)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107203465A (en) * 2016-03-18 2017-09-26 阿里巴巴集团控股有限公司 System interface method of testing and device
CN107220169A (en) * 2016-03-21 2017-09-29 阿里巴巴集团控股有限公司 A kind of emulating server returns to the method and apparatus for customizing data
CN107220169B (en) * 2016-03-21 2021-05-28 创新先进技术有限公司 Method and equipment for simulating server to return customized data
CN105975394A (en) * 2016-05-06 2016-09-28 华为技术有限公司 Program testing method and device
CN105975394B (en) * 2016-05-06 2019-04-19 华为技术有限公司 A kind of program testing method and device
CN106096399A (en) * 2016-06-01 2016-11-09 努比亚技术有限公司 The detection device and method of application programming interface
CN106227664B (en) * 2016-07-22 2019-04-12 华为技术有限公司 A kind of method and device of test application program
CN106227664A (en) * 2016-07-22 2016-12-14 华为技术有限公司 A kind of method and device testing application program
CN107294808A (en) * 2017-07-05 2017-10-24 网易(杭州)网络有限公司 The methods, devices and systems of interface testing
CN107294808B (en) * 2017-07-05 2020-11-24 网易(杭州)网络有限公司 Interface test method, device and system
CN109582556B (en) * 2017-09-29 2022-04-12 阿里巴巴集团控股有限公司 Method, device and system for testing running condition of application program in mobile terminal
CN109582556A (en) * 2017-09-29 2019-04-05 阿里巴巴集团控股有限公司 Test method, the device and system of a kind of application program in running of mobile terminal situation
CN107861822A (en) * 2017-10-30 2018-03-30 阿里巴巴集团控股有限公司 Method and device, the equipment of broadcast notice in simulant-client
CN107861822B (en) * 2017-10-30 2021-09-28 创新先进技术有限公司 Method, device and equipment for simulating broadcast notification in client
CN108173713A (en) * 2017-12-26 2018-06-15 深圳市极致汇仪科技有限公司 A kind of more network interface card parallel test methods of list PC
CN108345535A (en) * 2017-12-26 2018-07-31 阿里巴巴集团控股有限公司 Mock test methods, device and equipment
CN108922080A (en) * 2018-06-06 2018-11-30 福建联迪商用设备有限公司 A kind of the barcode scanning payment test method and cash register of control barcode scanning gun
CN108920220B (en) * 2018-06-06 2021-11-30 北京奇虎科技有限公司 Function calling method, device and terminal
CN108920220A (en) * 2018-06-06 2018-11-30 北京奇虎科技有限公司 A kind of method, apparatus and terminal of function call
CN109062806A (en) * 2018-09-14 2018-12-21 杭州数梦工场科技有限公司 A kind of program testing method, system, device and computer readable storage medium
CN109062810B (en) * 2018-09-26 2022-05-06 北京城市网邻信息技术有限公司 Application program testing method and device, electronic equipment and storage medium
CN109062810A (en) * 2018-09-26 2018-12-21 北京城市网邻信息技术有限公司 A kind of test method of application program, device, electronic equipment and storage medium
CN109873735A (en) * 2018-12-14 2019-06-11 深圳壹账通智能科技有限公司 Performance test methods, device and the computer equipment of the H5 page
CN109873735B (en) * 2018-12-14 2021-09-21 深圳壹账通智能科技有限公司 Performance test method and device for H5 page and computer equipment
WO2020177519A1 (en) * 2019-03-05 2020-09-10 中国银联股份有限公司 Debugging method executed on smart terminal and software debugging device
CN110008074B (en) * 2019-04-11 2020-07-07 苏州浪潮智能科技有限公司 Method, device and equipment for automatically testing and inquiring upper-layer interface of hardware information
CN110008074A (en) * 2019-04-11 2019-07-12 苏州浪潮智能科技有限公司 The method, device and equipment of automatic test inquiry hardware information high-level interface
CN110580224A (en) * 2019-09-20 2019-12-17 中国银行股份有限公司 System testing method, device and equipment
CN111199353A (en) * 2019-12-31 2020-05-26 Oppo(重庆)智能科技有限公司 Test method and test system
CN111199353B (en) * 2019-12-31 2023-04-18 Oppo(重庆)智能科技有限公司 Test method and test system
CN111367821A (en) * 2020-05-22 2020-07-03 支付宝(杭州)信息技术有限公司 Software testing method and system
CN112256984A (en) * 2020-10-22 2021-01-22 上海悦易网络信息技术有限公司 Method and device for acquiring interface background screenshot corresponding to webpage
CN112256984B (en) * 2020-10-22 2022-09-30 上海万物新生环保科技集团有限公司 Method and device for acquiring interface background screenshot corresponding to webpage
CN112468641A (en) * 2020-10-26 2021-03-09 百果园技术(新加坡)有限公司 Program testing method, device, terminal and storage medium
CN112468641B (en) * 2020-10-26 2023-04-21 百果园技术(新加坡)有限公司 Program testing method, device, terminal and storage medium

Similar Documents

Publication Publication Date Title
CN105354143A (en) Test method and device for application programs
CN104516783B (en) Authority control method and device
CN107018191B (en) Method and device for controlling game
CN107908952B (en) Method and device for identifying real machine and simulator and terminal
CN104598380A (en) Method and system for automatic testing based on control
CN107688529B (en) Component debugging method and device
CN103634386A (en) Method and device for downloading application by client end application program
CN109800135B (en) Information processing method and terminal
CN105550101A (en) Test method for application program, electronic device and system
CN107370804B (en) Software application processing method and device
CN104580451A (en) Method and system for achieving account number synchronization among multiple platforms, and electronic device
CN111581095A (en) Self-starting USB debugging method and device based on barrier-free service and storage medium
CN105389263A (en) Method, system and equipment for monitoring application software permissions
CN108614767A (en) A kind of remote debugging method and device
CN111444103A (en) Automatic testing method for Web page and related equipment
CN104519105A (en) Method and device for acquiring applications matched with terminals
CN105205001A (en) Testing method, device and system for game program
CN107391362A (en) Application testing method, mobile terminal and storage medium
CN106648685A (en) Processing method and device of intelligent terminal system and intelligent terminal
CN103505874A (en) Method and device for operating electronic game by using wireless terminal
CN103365672B (en) A kind of method and system processing the descriptor of application program
CN111128139B (en) Non-invasive voice test method and device
CN103488508A (en) Browser working method, browser and terminal equipment
CN103577326B (en) DEBUG method and device
CN111124781A (en) Display card testing method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20160224

RJ01 Rejection of invention patent application after publication