Invention content
A technical problem to be solved of the embodiment of the present invention is:A kind of application testing method, apparatus and system are provided,
When harsh pattern tests the application in Android system in using Android system, to reduce test job amount, improves and survey
Try efficiency.
One side according to the ... of the embodiment of the present invention, a kind of application testing method provided, including:
The Embedded test frame in Android system;
Run in the Android system for opening harsh pattern each to be measured in application, being changed by the test frame each
The operation rule of the application to be measured;
The Android system is monitored the operation of each application to be measured, forms monitoring daily record.
In based on another of above method embodiment, the test frame is Lazy PHP frames.
In based on another of above method embodiment, the Lazy PHP frames include Hook functions, the Hook
Function includes test logic;Run each to be measured in application, the Hook functions exist in the Android system for opening harsh pattern
It is each described to be measured using the calling for distorting function in application to be measured in compilation process according to the test logic, it is each to change
The operation rule of the application to be measured.
In based on another of above method embodiment, the test logic includes the position of characteristic function, characteristic function
It sets and alternate process corresponding with the characteristic function.
In based on another of above method embodiment, the alternate process is included in before the characteristic function operation
Pretreatment or/and the characteristic function operation after post-processing.
In based on another of above method embodiment, after forming monitoring daily record, the application testing method is also
Including:It is counter to the monitoring daily record to be looked into, determine the pending code in the source code of the application to be measured.
In based on another of above method embodiment, the Android system is to right in each application operation to be measured
The establishment and release of elephant are monitored.
Other side according to the ... of the embodiment of the present invention, what is provided is a kind of using test device, including:
Frame embedded unit, for the Embedded test frame in Android system;
Rules modification unit is run each to be measured in application, for passing through institute in the Android system for opening harsh pattern
State the executing rule that test frame changes each application to be measured;
Daily record forms unit, for forming monitoring to the monitoring of each application operation to be measured according to the Android system
Daily record.
In based on another of above-mentioned apparatus embodiment, the test frame is Lazy PHP frames.
Another aspect according to the ... of the embodiment of the present invention, a kind of application test systems provided, including any of the above-described application
Test device, and
The operating system of intelligent terminal, the intelligent terminal is Android system, and the intelligent terminal is equipped at least one
Application to be measured.
Application testing method, the apparatus and system provided based on the above embodiment of the present invention, it is embedded in Android system to survey
Try frame;To run each to be measured in application, being changed by the test frame in the Android system for opening harsh pattern
The operation rule of each application to be measured;The Android system is monitored the operation of each application to be measured simultaneously,
Form monitoring daily record.For the Android system of Embedded test frame, each application to be measured is run in the case where opening harsh pattern, with
In the operational process for monitoring each application to be measured, the operation rule of each application to be measured can be changed by test frame, realized
The acquisition of application to be measured monitoring daily record in Android system.Due to need not be inserted into for realizing harsh mould in each application to be measured
The test code of formula, after the source code update of application to be measured, when testing updated application to be measured, being not necessarily to will more
Source code after new is repacked with test code, is simplified the testing procedure of application to be measured, is avoided the packing to application to be measured
And topological structure impacts, and reduces test job amount, improves using testing efficiency.
Below by drawings and examples, technical scheme of the present invention will be described in further detail.
Specific implementation mode
Carry out the various exemplary embodiments of detailed description of the present invention now with reference to attached drawing.It should be noted that:Unless in addition having
Body illustrates that the unlimited system of component and the positioned opposite of step, numerical expression and the numerical value otherwise illustrated in these embodiments is originally
The range of invention.
Simultaneously, it should be appreciated that for ease of description, the size of attached various pieces shown in the drawings is not according to reality
Proportionate relationship draw.
It is illustrative to the description only actually of at least one exemplary embodiment below, is never used as to the present invention
And its application or any restrictions that use.
Technology, method and apparatus known to person of ordinary skill in the relevant may be not discussed in detail, but suitable
In the case of, the technology, method and apparatus should be considered as part of specification.
It should be noted that:Similar label and letter indicate similar terms in following attached drawing, therefore, once a certain Xiang Yi
It is defined, then it need not be further discussed in subsequent attached drawing in a attached drawing.
Existing Android system needs first in the source code of each application in Android system in realizing harsh mode process
It is inserted into the test code for realizing harsh pattern, the source code of application and above-mentioned test code are then packaged into a program
Packet has an impact the packing of application and its internal topological structure.And it is carried since the tester of application does not have to SVN
Hand over the permission for adding other codes.After the source code modification of application, to be tested by the harsh pattern of android system
Using needing to remodify and submit the test code for realizing harsh pattern, by the source code of application and debugging code weight
It is new to be packaged.For optimizing frequent application, it is both needed to re-start aforesaid operations when retesting after every suboptimization, workload is numerous
Weight, testing efficiency are low.
Fig. 1 is the flow chart of application testing method one embodiment of the present invention.As shown in Figure 1, the application of the embodiment is surveyed
Method for testing includes:
S102, the Embedded test frame in Android system.
Specifically, test frame is embedded into Android system so that Android system will not only load when starting
The primary secondary file of Android system also wants the content of load test frame, realizes that test frame is initial under system environments
Change environment layout, prepares for subsequent test.For example, the program bag in Android system load test frame, in loading procedure
In, which will need the file used to be placed under specified file path in operational process.
S104 runs each to be measured in application, being changed by test frame each in the Android system for opening harsh pattern
The operation rule of a application to be measured, while Android system is monitored the operation of each application to be measured, forms monitoring daily record.
Specifically, it can be all using journey in UI main threads in Android system to run each application to be measured in Android system
Sequence.To realize the test to all applications in Android system.
The monitoring daily record may include using EMS memory occupation amount in the process of running, for example, object is built in application to be measured
Influence vertical and that release is to memory.
Based on the application testing method that the above embodiment of the present invention provides, the Embedded test frame in Android system;To
Run each to be measured in application, changing the fortune of each application to be measured by test frame in the Android system for opening harsh pattern
Line discipline, while Android system is monitored the operation of each application to be measured, forms monitoring daily record.For Embedded test frame
Android system, run each application to be measured in the case where opening harsh pattern, in the operational process to monitor each application to be measured,
It can change the operation rule of each application to be measured by test frame, realize obtaining for application monitoring daily record to be measured in Android system
It takes.Since the test code for realizing harsh pattern need not be inserted into each application to be measured, in the source generation of application to be measured
After code update, when testing updated application to be measured, it is not necessary that updated source code and test code are beaten again
Packet, simplifies the testing procedure of application to be measured, the packing to application to be measured and topological structure is avoided to impact, and reduces test
Workload improves to be measured using testing efficiency.
In based on another of above method embodiment, the test frame could be an upwardly facing the programming framework of section.Tool
Body, the test frame is Lazy PHP frames, can also be referred to as LP frames, can be by Lazy PHP frames
The operation distorted of callings of function during program applies operating system, thus to the operation of application to be measured in Android system into
Row redefines, and when Android system opens harsh pattern, no longer needs to be inserted into test code in the source code of application to be measured.Afterwards
After the developer for continuing application to be measured modifies to source code, harsh mould can be realized without modifying in corresponding test frame
Test under formula reduces the workload using test, improves using testing efficiency.
In based on another of above method embodiment, the Lazy PHP frames are static agent frame.It is described
Lazy PHP frames include Hook functions, and the Hook functions include test logic;In the Android system for opening harsh pattern
Run each to be measured in application, the Hook functions are usurped in each application compilation process to be measured according to the test logic
The calling for changing function in application to be measured, to change the operation rule of each application to be measured.
Specifically, the test logic includes characteristic function, the position of characteristic function and corresponding with the characteristic function
Alternate process.The position of the characteristic function can be characterized position of the function in application source program to be measured.At the replacement
Reason is included in the pretreatment before the characteristic function operation or/and the post-processing after characteristic function operation.
In the present embodiment, above-mentioned test frame can obtain in application to be measured characteristic function before runtime or/and later
Section information, apply the log information run under harsh pattern to be measured when obtaining characteristic function corresponding operation phase,
Daily record is monitored to be formed.
In based on another of above method embodiment, the Android system is to object in each application operation to be measured
It creates and release is monitored, form monitoring daily record.Facilitate the operation of each characteristic function during determining application operation to be measured
Influence to Installed System Memory.
Fig. 2 is the flow chart of another embodiment of application testing method of the present invention.As shown in Fig. 2, the application of the embodiment
Test method includes:
S202, the Embedded test frame in Android system.
S204 runs each to be measured in application, being changed by test frame each in the Android system for opening harsh pattern
The operation rule of a application to be measured, while Android system is monitored the operation of each application to be measured, forms monitoring daily record.
S206, to monitoring, daily record is counter is looked into, and determines the pending code in the source code of application to be measured.
In based on another of above method embodiment, the Android system is to object in each application operation to be measured
It creates and release is monitored, to form monitoring daily record, facilitate each characteristic function operation during determining application operation to be measured
Influence to Installed System Memory.Then, to being formed by monitoring, daily record is counter is looked into, to quickly determine that memory is caused constantly to disappear
The code of consumption facilitates developer to improve or change the source code of application to be measured.
One of ordinary skill in the art will appreciate that:Realize that all or part of step of above method embodiment can pass through
The relevant hardware of program instruction is completed, and program above-mentioned can be stored in a computer read/write memory medium, the program
When being executed, step including the steps of the foregoing method embodiments is executed;And storage medium above-mentioned includes:ROM, RAM, magnetic disc or light
The various media that can store program code such as disk.
Fig. 3 is the structural schematic diagram that the present invention applies test device one embodiment.As shown in figure 3, the embodiment is answered
Include with test device:
Frame embedded unit 101, for the Embedded test frame in Android system;
Rules modification unit 103 is run each to be measured in application, for passing through in the Android system for opening harsh pattern
Test frame changes the executing rule of each application to be measured;
Daily record forms unit 105, for forming monitoring daily record to the monitoring of each application operation to be measured according to Android system.
Specifically, test frame is embedded into Android system by frame embedded unit 101 so that Android system is opening
Android system primary secondary file is not only loaded when dynamic, also wants the content of load test frame, realize test frame
Initialization context layout under system environments, prepares for subsequent test.For example, in Android system load test frame
Program bag, in loading procedure, which will need the file used to be placed in operational process
Under specified file path.
Specifically, it can be all using journey in UI main threads in Android system to run each application to be measured in Android system
Sequence.To realize the test to all applications in Android system.
Based on the application test device that the above embodiment of the present invention provides, by frame embedded unit 101 in Android system
Middle Embedded test frame;Then, run each to be measured in application, making rules modification list in the Android system for opening harsh pattern
Member 103 changes the executing rule of each application to be measured by test frame, while daily record forms unit 105 according to Android system pair
The monitoring of each application operation to be measured forms monitoring daily record.It is applied in Android system and carries out test process under harsh pattern
In, since the test code for realizing harsh pattern need not be inserted into each application to be measured, in the source generation of application to be measured
After code update, when testing updated application to be measured, it is not necessary that updated source code and test code are beaten again
Packet, simplifies the testing procedure of application to be measured, the packing to application to be measured and topological structure is avoided to impact, and reduces test
Workload is improved using testing efficiency.
In based on another of above-mentioned apparatus embodiment, the test embedded in Android system of frame embedded unit 101
Frame could be an upwardly facing the programming framework of section.Specifically, the test frame is Lazy PHP frames, LP frames can also be referred to as
Frame, the operation that the calling of function is distorted in capable of being applied to operating system by the program in Lazy PHP frames, from
And the operation of application to be measured in Android system is redefined, when Android system opens harsh pattern, no longer need to waiting for
It surveys in the source code of application and is inserted into test code.After the developer of follow-up application to be measured modifies to source code, corresponding survey
Examination frame reduces the workload when test of application to be measured, carries without the test that can be realized under harsh pattern of modifying
High testing efficiency.
In based on another of above-mentioned apparatus embodiment, the Lazy PHP frames are static agent frame.It is described
Lazy PHP frames include Hook functions, and the Hook functions include test logic;In the Android system for opening harsh pattern
Run each to be measured in application, the Hook functions are usurped in each application compilation process to be measured according to the test logic
The calling for changing function in application to be measured, to change the operation rule of each application to be measured.
Specifically, the test logic includes characteristic function, the position of characteristic function and corresponding with the characteristic function
Alternate process.The alternate process is included in pretreatment before characteristic function operation or/and in the characteristic function
Post-processing after operation.
In the present embodiment, above-mentioned test frame can obtain in application to be measured characteristic function before runtime or/and later
Section information, to obtain it is to be measured apply the log information run under harsh pattern, to form monitoring daily record.
In based on another of above-mentioned apparatus embodiment, the Android system is to object in each application operation to be measured
It creates and release is monitored, form monitoring daily record.Facilitate the operation of each characteristic function during determining application operation to be measured
Influence to Installed System Memory.
In based on another of above-mentioned apparatus embodiment, the application test device further includes:Log analysis unit (figure
Do not show), for being looked into the monitoring daily record is counter, determine the pending code in the source code of application to be measured.
In the present embodiment, the Android system is monitored the establishment and release of object in each application operation to be measured,
Daily record is monitored to be formed, facilitates influence of each characteristic function operation to Installed System Memory during determining application operation to be measured.So
Afterwards, daily record is counter is looked into being formed by monitoring for log analysis unit, to quickly determine the generation for causing memory constantly to consume
Code, facilitates developer to improve or change the source code of application.
Fig. 4 is the structural schematic diagram of application test systems one embodiment of the present invention.As shown in figure 4, the embodiment is answered
Include applying test device 10 and intelligent terminal 20 with test system.The operating system of intelligent terminal 20 is Android system, intelligence
Terminal is equipped at least one application to be measured.
Can be that test device is applied in any above-described embodiment using test device 10.In the present embodiment, filled using test
Setting 10 includes:
Frame embedded unit 101, for the Embedded test frame in Android system;
Rules modification unit 103 is run each to be measured in application, for passing through in the Android system for opening harsh pattern
Test frame changes the executing rule of each application to be measured;
Daily record forms unit 105, for forming monitoring daily record to the monitoring of each application operation to be measured according to Android system.
Due to the Embedded test frame in the operating system of intelligent terminal 20 (Android system), in the case where opening harsh pattern
Each application to be measured is run, in the operational process to monitor each application to be measured, can be changed by test frame each to be measured
The operation rule of application realizes the acquisition of application to be measured monitoring daily record in Android system.Due to need not be in each application to be measured
Middle insertion to be measured is answered after the source code update of application to be measured to updated for realizing the test code of harsh pattern
When with being tested, without the step of updated source code and test code are repacked, simplified using test, avoid
The packing and topological structure of application to be measured are impacted, the workload of test is reduced, improves using testing efficiency.
An embodiment of the present invention provides following technical schemes:
1, a kind of application testing method, including:
The Embedded test frame in Android system;
Run in the Android system for opening harsh pattern each to be measured in application, being changed by the test frame each
The operation rule of the application to be measured;
The Android system is monitored the operation of each application to be measured, forms monitoring daily record.
2, the application testing method according to 1, the test frame are Lazy PHP frames.
3, the application testing method according to 2, the Lazy PHP frames include Hook functions, the Hook functions packet
Include test logic;Run each to be measured in application, the Hook functions are in each institute in the Android system for opening harsh pattern
State it is to be measured using the calling for distorting function in application to be measured in compilation process according to the test logic, to change each described wait for
Survey the operation rule of application.
4, the application testing method according to 3, the test logic include characteristic function, characteristic function position and
Alternate process corresponding with the characteristic function.
5, the application testing method according to 4, the alternate process are included in pre- before the characteristic function is run
Processing or/and the post-processing after characteristic function operation.
6, according to any application testing method in 1 to 5, after forming monitoring daily record, the application test side
Method further includes:It is counter to the monitoring daily record to be looked into, determine the pending code in the source code of the application to be measured.
7, according to any application testing method in 1 to 5, the Android system is to each application operation to be measured
The establishment and release of middle object are monitored.
8, a kind of using test device, including:
Frame embedded unit, for the Embedded test frame in Android system;
Rules modification unit is run each to be measured in application, for passing through institute in the Android system for opening harsh pattern
State the executing rule that test frame changes each application to be measured;
Daily record forms unit, for forming monitoring to the monitoring of each application operation to be measured according to the Android system
Daily record.
9, the application test device according to 8, the test frame are Lazy PHP frames.
10, the application test device according to 9, the Lazy PHP frames include Hook functions, the Hook functions
Including test logic;Run in the Android system for opening harsh pattern each to be measured in application, the rules modification unit is logical
It crosses the Hook functions and distorts function in application to be measured according to the test logic in each application compilation process to be measured
Calling, to change the operation rule of each application to be measured.
11, the application test device according to 10, the test logic include characteristic function, characteristic function position with
And alternate process corresponding with the characteristic function.
12, the device of the application test according to 11, the alternate process are included in before the characteristic function operation
Pretreatment or/and the characteristic function operation after post-processing.
13, further include according to any application test device, the application test device in 8 to 12:Log analysis
Unit determines the pending code in the source code of the application to be measured for being looked into the monitoring daily record is counter.
14, according to any application test device in 8 to 12, the Android system transports each application to be measured
The establishment and release of object are monitored in row.
15, a kind of application test systems, including in 8 to 14 it is any it is described apply test device, and
The operating system of intelligent terminal, the intelligent terminal is Android system, and the intelligent terminal is equipped at least one
Application to be measured.
Each embodiment is described in a progressive manner in this specification, the highlights of each of the examples are with its
The difference of its embodiment, same or analogous part cross-reference between each embodiment.For system embodiment
For, since it is substantially corresponding with embodiment of the method, so description is fairly simple, referring to the portion of embodiment of the method in place of correlation
It defends oneself bright.
The methods, devices and systems of the present invention may be achieved in many ways.For example, software, hardware, firmware can be passed through
Or any combinations of software, hardware, firmware come realize the present invention methods, devices and systems.The step of for the method
Said sequence merely to illustrate, the step of method of the invention, is not limited to sequence described in detail above, unless with
Other manner illustrates.In addition, in some embodiments, also the present invention can be embodied as to record journey in the recording medium
Sequence, these programs include for realizing machine readable instructions according to the method for the present invention.Thus, the present invention also covers storage and uses
In the recording medium for executing program according to the method for the present invention.