Summary of the invention
One to be solved of the embodiment of the present invention technical problem is that: provides a kind of application testing method, dress
Put and system, when the application in Android system being tested with pattern harsh in utilizing Android system,
Reduce test job amount, improve testing efficiency.
An aspect according to embodiments of the present invention, it is provided that a kind of application testing method, including:
Embedded test framework in Android system;
When running each application to be measured in the Android system opening harsh pattern, by described test frame
Revise the operation rule of each described application to be measured;
The operation of application to be measured each described is monitored by described Android system, forms monitoring daily record.
In another embodiment based on said method, described test frame is Lazy PHP framework.
In another embodiment based on said method, described Lazy PHP framework includes Hook letter
Number, described Hook function includes testing logic;Each is run in the Android system opening harsh pattern
To be measured application time, described Hook function in application compilation process to be measured each described according to described test
Logic distorts the calling, to revise the operation rule of each described application to be measured of function in application to be measured.
In another embodiment based on said method, described test logic includes characteristic function, feature
The position of function and the alternate process corresponding with described characteristic function.
In another embodiment based on said method, described alternate process is included in described characteristic function
Pretreatment before operation is or/and post processing after described characteristic function runs.
In another embodiment based on said method, after forming monitoring daily record, described application is surveyed
Method for testing also includes: looks into described monitoring daily record is counter, determines in the source code of described application to be measured
Pending code.
In another embodiment based on said method, described Android system is to application to be measured each described
In operation, establishment and the release of object are monitored.
Another aspect according to embodiments of the present invention, it is provided that a kind of application test device, including:
Framework embedded unit, for Embedded test framework in Android system;
Rules modification unit, when running each application to be measured in the Android system opening harsh pattern, uses
In the executing rule being revised each described application to be measured by described test frame;
Daily record forms unit, for the monitoring run application to be measured each described according to described Android system
Form monitoring daily record.
In another embodiment based on said apparatus, described test frame is Lazy PHP framework.
Another aspect according to embodiments of the present invention, it is provided that a kind of application test systems, including above-mentioned
Arbitrary application test device, and
Intelligent terminal, the operating system of described intelligent terminal is Android system, and described intelligent terminal is provided with
At least one application to be measured.
Application testing method based on the above embodiment of the present invention offer, Apparatus and system, at Android system
Middle Embedded test framework;Thus when running each application to be measured in the Android system opening harsh pattern,
The operation rule of each described application to be measured is revised by described test frame;The most described Android system pair
The operation of each described application to be measured is monitored, and forms monitoring daily record.Peace for Embedded test framework
Tall and erect system, it runs each application to be measured, to monitor the fortune of each application to be measured under opening harsh pattern
During row, it is possible to revised the operation rule of each application to be measured by test frame, it is achieved Android system
In application to be measured monitoring daily record acquisition.Owing to need not insert in each application to be measured for realizing sternly
The test code of severe pattern, after the source code of application to be measured updates, enters the application to be measured after updating
During row test, it is not necessary to the source code after updating is repacked with test code, simplifies application to be measured
Testing procedure, it is to avoid packing and topological structure to application to be measured impact, reduces test job
Amount, improves application testing efficiency.
Below by drawings and Examples, technical scheme is described in further detail.
Detailed description of the invention
The various exemplary embodiments of the present invention are described in detail now with reference to accompanying drawing.It should also be noted that remove
Non-additionally illustrate, the parts that illustrate the most in these embodiments and step positioned opposite, digital
Expression formula and numerical value do not limit the scope of the invention.
Simultaneously, it should be appreciated that for the ease of describing, the size of the various piece shown in accompanying drawing is not
It is to draw according to actual proportionate relationship.
Description only actually at least one exemplary embodiment is illustrative below, never conduct
To the present invention and application thereof or any restriction of use.
May not beg in detail for technology, method and apparatus known to person of ordinary skill in the relevant
Opinion, but in the appropriate case, described technology, method and apparatus should be considered a part for description.
It should also be noted that similar label and letter represent similar terms in following accompanying drawing, therefore, once
A certain Xiang Yi accompanying drawing is defined, then need not it is begged for further in accompanying drawing subsequently
Opinion.
Existing Android system, in realizing harsh mode process, needs the source of each application in Android system
Code first inserts the test code for realizing harsh pattern, then by source code and the above-mentioned survey of application
Examination code is packaged into a program bag, and packing and its internal topological structure on application produce impact.
And owing to the tester of application does not has the authority to SVN submission other codes of interpolation.Source in application
After code revision, to test application by the harsh pattern of android system, need to remodify
And submit the test code for realizing harsh pattern to, source code and the debugging code of application are beaten again
Bag.Apply frequently for optimizing, be both needed to re-start aforesaid operations when retesting after every suboptimization,
Workload is heavy, and testing efficiency is low.
Fig. 1 is the flow chart of one embodiment of application testing method of the present invention.As it is shown in figure 1, this enforcement
The application testing method of example includes:
S102, Embedded test framework in Android system.
Concrete, test frame is embedded in Android system so that Android system starting when not
The secondary file that Android system to be loaded is primary, the content of test frame to be loaded, it is achieved test block
Frame initialization context layout under system environments, prepares for follow-up test.Such as, Android system
Load the program bag in test frame, in loading procedure, this self environment of program initialization packet, will fortune
The file used is needed all to be placed under the file path specified during row.
S104, when running each application to be measured in the Android system opening harsh pattern, passes through test block
Un-wheeling repair changes the operation rule of each application to be measured, and the operation of each application to be measured is carried out by Android system simultaneously
Monitoring, forms monitoring daily record.
Concrete, running each application to be measured in Android system can be for the institute in UI main thread in Android system
There is application program.Thus realize the test to application all in Android system.
Described monitoring daily record can include applying EMS memory occupation amount in running, such as, in application to be measured
The foundation of object and the release impact on internal memory.
The application testing method provided based on the above embodiment of the present invention, Embedded test frame in Android system
Frame;Thus when running each application to be measured in the Android system opening harsh pattern, pass through test frame
Revising the operation rule of each application to be measured, the operation of each application to be measured is supervised by Android system simultaneously
Control, forms monitoring daily record.For the Android system of Embedded test framework, it is transported under opening harsh pattern
Each application to be measured of row, to monitor in the running of each application to be measured, it is possible to by test block un-wheeling repair
Change the operation rule of each application to be measured, it is achieved the acquisition of application to be measured monitoring daily record in Android system.By
The test code for realizing harsh pattern is inserted, in application to be measured in need not in each application to be measured
Source code update after, to update after application to be measured test time, it is not necessary to will update after source generation
Code is repacked with test code, simplifies the testing procedure of application to be measured, it is to avoid play application to be measured
Bag and topological structure impact, and reduce test job amount, improve application testing efficiency to be measured.
In another embodiment based on said method, described test frame could be an upwardly facing the programming of tangent plane
Framework.Concrete, described test frame is Lazy PHP framework, it is also possible to referred to as LP framework, its
In can being applied operating system by the program in Lazy PHP framework, function calls the fortune distorted
OK, thus the operation to application to be measured in Android system redefines, and opens harsh at Android system
During pattern, it is not necessary to insert test code again in the source code of application to be measured.The exploitation of follow-up application to be measured
After source code is modified by person, corresponding test frame can realize under harsh pattern without modifying
Test, reduce application test workload, improve application testing efficiency.
In another embodiment based on said method, described Lazy PHP framework is static agent frame
Frame.Described Lazy PHP framework includes that Hook function, described Hook function include testing logic;?
Open the Android system of harsh pattern runs each to be measured application time, described Hook function is in each institute
State in application compilation process to be measured and distort the calling, to repair of function in application to be measured according to described test logic
Change the operation rule of each described application to be measured.
Concrete, described test logic include characteristic function, the position of characteristic function and with described feature
The alternate process that function is corresponding.The position of described characteristic function can be characterized function at application source program to be measured
In position.Described alternate process is included in the pretreatment before described characteristic function runs or/and described
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/
Tangent plane information afterwards, thus to be measured when obtaining the characteristic function corresponding operation phase apply in harsh pattern
The log information of lower operation, to form monitoring daily record.
In another embodiment based on said method, each application to be measured is run by described Android system
Establishment and the release of middle object are monitored, and form monitoring daily record.Conveniently determine application running to be measured
In each characteristic function run impact on Installed System Memory.
Fig. 2 is the flow chart of another embodiment of application testing method of the present invention.As in figure 2 it is shown, this is real
The application testing method executing example includes:
S202, Embedded test framework in Android system.
S204, when running each application to be measured in the Android system opening harsh pattern, passes through test block
Un-wheeling repair changes the operation rule of each application to be measured, and the operation of each application to be measured is carried out by Android system simultaneously
Monitoring, forms monitoring daily record.
S206, to monitoring, daily record is counter looks into, and determines the pending code in the source code of application to be measured.
In another embodiment based on said method, each application to be measured is run by described Android system
Establishment and the release of middle object are monitored, and to form monitoring daily record, conveniently determine that application to be measured ran
In journey, each characteristic function runs the impact on Installed System Memory.Then, the monitoring daily record to being formed is carried out
Counter look into, thus quickly determine the code causing internal memory constantly to consume, facilitate developer to application to be measured
Source code carries out improving or revising.
One of ordinary skill in the art will appreciate that: realize all or part of step of said method embodiment
Can be completed by the hardware that programmed instruction is relevant, aforesaid program can be stored in a computer-readable
Taking in storage medium, this program upon execution, performs to include the step of said method embodiment;And it is aforementioned
Storage medium include: various Jie that can store program code such as ROM, RAM, magnetic disc or CD
Matter.
Fig. 3 is the structural representation that the present invention applies test one embodiment of device.As it is shown on figure 3, should
The application test device of embodiment includes:
Framework embedded unit 101, for Embedded test framework in Android system;
Rules modification unit 103, runs each application to be measured in the Android system opening harsh pattern
Time, for being revised the executing rule of each application to be measured by test frame;
Daily record forms unit 105, is formed for the monitoring run each application to be measured according to Android system
Monitoring daily record.
Concrete, by framework embedded unit 101, test frame is embedded in Android system so that peace
The tall and erect system secondary file that Android system to be loaded is primary starting when, test block to be loaded
The content of frame, it is achieved test frame initialization context layout under system environments, does for follow-up test
Prepare.Such as, Android system loads the program bag in test frame, in loading procedure, this program bag
Initialize self environment, be all placed in, by running needs the file used, the file path specified
Under.
Concrete, running each application to be measured in Android system can be for the institute in UI main thread in Android system
There is application program.Thus realize the test to application all in Android system.
The application test device provided based on the above embodiment of the present invention, is existed by framework embedded unit 101
Embedded test framework in Android system;Then, in the Android system opening harsh pattern, run each to treat
When surveying application, rules modification unit 103 is made to perform rule by what test frame revised each application to be measured
Then, daily record simultaneously forms the monitoring formation prison that each application to be measured is run by unit 105 according to Android system
Control daily record.Apply in Android system and carry out in test process under harsh pattern, owing to need not
Each application to be measured is inserted for realizing the test code of harsh pattern, application to be measured source code more
After Xin, when the application to be measured after updating is tested, it is not necessary to the source code after updating and test generation
Code is repacked, and simplifies the testing procedure of application to be measured, it is to avoid packing and the topology to application to be measured
Structure impacts, and reduces test job amount, improves application testing efficiency.
In another embodiment based on said apparatus, framework embedded unit 101 is embedding in Android system
The test frame entered could be an upwardly facing the programming framework of tangent plane.Concrete, described test frame is Lazy PHP
Framework, it is also possible to referred to as LP framework, it can be by the program in Lazy PHP framework to operation system
In system application function call the operation carrying out distorting, thus the operation to application to be measured in Android system is entered
Row redefines, when Android system opens harsh pattern, it is not necessary to insert in the source code of application to be measured again
Enter to test code.After source code is modified by the developer of follow-up application to be measured, corresponding test frame
Without the test that can realize under harsh pattern of modifying, reduce the work during test of application to be measured
Amount, improves testing efficiency.
In another embodiment based on said apparatus, described Lazy PHP framework is static agent frame
Frame.Described Lazy PHP framework includes that Hook function, described Hook function include testing logic;?
Open the Android system of harsh pattern runs each to be measured application time, described Hook function is in each institute
State in application compilation process to be measured and distort the calling, to repair of function in application to be measured according to described test logic
Change the operation rule of each described application to be measured.
Concrete, described test logic include characteristic function, the position of characteristic function and with described feature
The alternate process that function is corresponding.Described alternate process is included in the pretreatment before described characteristic function runs
Or/and the post processing after described characteristic function runs.
In the present embodiment, above-mentioned test frame can obtain in application to be measured characteristic function before runtime or/
Tangent plane information afterwards, thus obtain the log information applied and run under harsh pattern to be measured, with shape
Become monitoring daily record.
In another embodiment based on said apparatus, each application to be measured is run by described Android system
Establishment and the release of middle object are monitored, and form monitoring daily record.Conveniently determine application running to be measured
In each characteristic function run impact on Installed System Memory.
In another embodiment based on said apparatus, described application test device also includes: daily record divides
Analysis unit (not shown), for looking into described monitoring daily record is counter, determines in the source code of application to be measured
Pending code.
In the present embodiment, described Android system each application to be measured is run in the establishment of object and discharge into
Row monitoring, to form monitoring daily record, conveniently determines that in application running to be measured, each characteristic function runs
Impact on Installed System Memory.Then, the monitoring daily record to being formed of the log analysis unit is counter looks into, from
And quickly determine the code causing internal memory constantly to consume, facilitate developer that the source code of application has been carried out
It is apt to or amendment.
Fig. 4 is the structural representation of one embodiment of application test systems of the present invention.As shown in Figure 4, should
The application test systems of embodiment includes application test device 10 and intelligent terminal 20.Intelligent terminal's 20
Operating system is Android system, and intelligent terminal is provided with at least one application to be measured.
Application test device 10 can be application test device in arbitrary above-described embodiment.In the present embodiment, should
Include with test device 10:
Framework embedded unit 101, for Embedded test framework in Android system;
Rules modification unit 103, runs each application to be measured in the Android system opening harsh pattern
Time, for being revised the executing rule of each application to be measured by test frame;
Daily record forms unit 105, is formed for the monitoring run each application to be measured according to Android system
Monitoring daily record.
Due to Embedded test framework in the operating system (Android system) of intelligent terminal 20, it is being opened
Each application to be measured is run, to monitor in the running of each application to be measured, it is possible to logical under harsh pattern
Cross test frame and revise the operation rule of each application to be measured, it is achieved application to be measured monitoring day in Android system
The acquisition of will.Owing to need not the test generation inserted in each application to be measured for realizing harsh pattern
Code, after the source code of application to be measured updates, when testing the application to be measured after updating, it is not necessary to
Source code after updating is repacked with test code, simplifies the step of application test, it is to avoid treat
Packing and the topological structure of surveying application impact, and reduce the workload of test, improve application and survey
Examination efficiency.
Embodiments provide techniques below scheme:
1, a kind of application testing method, including:
Embedded test framework in Android system;
When running each application to be measured in the Android system opening harsh pattern, by described test frame
Revise the operation rule of each described application to be measured;
The operation of application to be measured each described is monitored by described Android system, forms monitoring daily record.
2, according to the application testing method described in 1, described test frame is Lazy PHP framework.
3, according to the application testing method described in 2, described Lazy PHP framework includes Hook function,
Described Hook function includes testing logic;Each is run to be measured in the Android system opening harsh pattern
During application, described Hook function in application compilation process to be measured each described according to described test logic
Distort the calling, to revise the operation rule of each described application to be measured of function in application to be measured.
4, according to the application testing method described in 3, described test logic includes characteristic function, characteristic function
Position and the alternate process corresponding with described characteristic function.
5, according to the application testing method described in 4, described alternate process is included in described characteristic function and runs
Pretreatment before is or/and post processing after described characteristic function runs.
6, according to described application testing method arbitrary in 1 to 5, after forming monitoring daily record, described
Application testing method also includes: looks into described monitoring daily record is counter, determines the source generation of described application to be measured
Pending code in Ma.
7, according to described application testing method arbitrary in 1 to 5, described Android system is treated described in each
Establishment and the release of surveying object during application runs are monitored.
8, a kind of application test device, including:
Framework embedded unit, for Embedded test framework in Android system;
Rules modification unit, when running each application to be measured in the Android system opening harsh pattern, uses
In the executing rule being revised each described application to be measured by described test frame;
Daily record forms unit, for the monitoring run application to be measured each described according to described Android system
Form monitoring daily record.
9, testing device according to the application described in 8, described test frame is Lazy PHP framework.
10, testing device according to the application described in 9, described Lazy PHP framework includes Hook function,
Described Hook function includes testing logic;Each is run to be measured in the Android system opening harsh pattern
During application, described rules modification unit is compiled in application to be measured each described by described Hook function
Journey distorts calling of function in application to be measured according to described test logic, with revise each described to be measured should
Operation rule.
11, testing device according to the application described in 10, described test logic includes characteristic function, feature letter
The position of number and the alternate process corresponding with described characteristic function.
12, according to the device of the application test described in 11, described alternate process is included in described characteristic function
Pretreatment before operation is or/and post processing after described characteristic function runs.
13, according to described application test device arbitrary in 8 to 12, described application test device also wraps
Include: log analysis unit, for looking into described monitoring daily record is counter, determine the source of described application to be measured
Pending code in code.
14, according to described application test device arbitrary in 8 to 12, described Android system is to described in each
In application to be measured operation, establishment and the release of object are monitored.
15, a kind of application test systems, including arbitrary described application test device in 8 to 14, and
Intelligent terminal, the operating system of described intelligent terminal is Android system, and described intelligent terminal is provided with
At least one application to be measured.
In this specification, each embodiment all uses the mode gone forward one by one to describe, and each embodiment stresses
It is all the difference with other embodiments, same or analogous part cross-reference between each embodiment
?.For system embodiment, owing to it is the most corresponding with embodiment of the method, so the ratio described
Relatively simple, relevant part sees the part of embodiment of the method and illustrates.
The methods, devices and systems of the present invention may be achieved in many ways.Such as, can be by soft
Part, hardware, firmware or software, hardware, any combination of firmware realize the method for the present invention, dress
Put and system.For the said sequence of step of described method merely to illustrate, the side of the present invention
The step of method is not limited to order described in detail above, unless specifically stated otherwise.Additionally,
In some embodiments, the present invention also can be embodied as the program recorded in the recording medium, these program bags
Include the machine readable instructions for realizing the method according to the invention.Thus, the present invention also covers storage and uses
Record medium in the program performing the method according to the invention.