CN105808440A - Application low memory test method, apparatus and system - Google Patents

Application low memory test method, apparatus and system Download PDF

Info

Publication number
CN105808440A
CN105808440A CN201610144107.2A CN201610144107A CN105808440A CN 105808440 A CN105808440 A CN 105808440A CN 201610144107 A CN201610144107 A CN 201610144107A CN 105808440 A CN105808440 A CN 105808440A
Authority
CN
China
Prior art keywords
memory
application program
data
program
tested 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
CN201610144107.2A
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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201610144107.2A priority Critical patent/CN105808440A/en
Publication of CN105808440A publication Critical patent/CN105808440A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases

Abstract

The application relates to an application low memory test method, apparatus and system. The method comprises the following steps: obtaining current operating page data of a tested application, and recording the data as first data; switching the tested application to a background; receiving a starting instruction, and starting a memory consumption application according to the starting instruction; if it is detected that the tested application is killed, receiving a termination instruction, and terminating the memory consumption application according to the termination instruction; restarting the tested application, obtaining current operating page data, and recording the data as second data; and determining whether the first data and the second data is consistent with predetermined expectation, if so, allowing the tested application to pass the test, and if not, allowing the tested application not to pass the test. According to the application low memory test method, apparatus and system disclosed by the present invention, application low memory test is implemented without manually test, and test efficiency is high.

Description

The low internal storage testing method of application program, device and system
Technical field
The present invention relates to field tests, particularly relate to the low internal storage testing method of a kind of application program, device and system.
Background technology
Android system is a multitask system, user can start multiple application program in Android device, in order to reduce time overhead during Android application program launching, when user exits an application program or application program is withdrawn into backstage, system will not discharge the internal memory shared by application program at once, when so next time starts this application program, it is possible to accelerate the speed of service.But when the internal memory warning value of system free memory areal system, Lowmemorykiller mechanism in android system can sort according to the significance level of application program and kill the application program that some importances are relatively low, is so to ensure that android system can continue to properly functioning.
In software development and field tests; after ensureing that the application program being switched to backstage is killed by the Lowmemorykiller mechanism of system; normal operation can be continued after being again started up; such as can normally recover the operation before user and related data, it is necessary to the scene of this low internal memory is simulated and test by exploitation and tester.Such as; user uses certain lottery application to spend the long period to determine stake content in stake single-page; as shown in Figure 1A; then open other application programs comparing consumption internal memory and operate a period of time; lottery application has been switched to backstage by system; then user opens lottery application; if the user data under the not low internal memory scene of lottery application is protected; then can find the data " loss " in application program operation before now user, as shown in Figure 1B.So bring very big inconvenience to user.
Traditional method of testing for low internal memory scene is manual testing, namely tester runs concrete test case after tested application program launching, then tested application program is switched to backstage and constantly manually boot other application program multiple, until owing to Installed System Memory is not enough, tested application program is restarted after being killed by the Lowmemorykiller mechanism of system again and is opened tested application program, continues to run with test case to test availability and the vigorousness etc. of application program.But traditional manual testing needs means constantly to start and runs other application program consumption Installed System Memory, Lowmemorykiller mechanism to reach system kills tested application program, then continuing implementation of test cases after manually starting tested application program again, testing efficiency is low.
Summary of the invention
Based on this, it is necessary to for traditional inefficient problem of manual testing, it is provided that the low internal storage testing method of a kind of application program, testing efficiency can be improved.
Additionally, there is a need to provide the low test device for internal memory of a kind of application program and system, testing efficiency can be improved.
The low internal storage testing method of a kind of application program, comprises the following steps:
Obtain the current operation page data of tested application program, be recorded as the first data;
Described tested application program is switched to backstage;
Receive enabled instruction, start memory consumption program according to described enabled instruction;
If detecting, described tested application program is killed, then receive command for stopping, terminates described memory consumption program according to described command for stopping;
Restart described tested application program, obtain current operation page data, be recorded as the second data;
When described first data and the predetermined expection of the second data fit, then described tested Application testing passes through.
A kind of low test device for internal memory of application program, including:
Data acquisition module, for obtaining the current operation page data of tested application program, is recorded as the first data;
Handover module, for being switched to backstage by described tested application program;
Start module, be used for receiving enabled instruction, start memory consumption program according to described enabled instruction;
Terminating module, if for detecting that described tested application program is killed, then receiving command for stopping, terminating described memory consumption program according to described command for stopping;
Described data acquisition module is additionally operable to after restarting described tested application program, obtains current operation page data, is recorded as the second data;
Judge module, for when described first data and the predetermined expection of the second data fit, then described tested Application testing passes through.
A kind of low memory test system of application program, including:
Test control end, is used for sending test instruction to equipment under test;
Equipment under test, for receiving described test instruction, tested application program is started according to test instruction, automatically the sequence of operation is performed, obtain current operation page data, be recorded as the first data, more described tested application program is switched to backstage, and receive enabled instruction, start memory consumption program according to described enabled instruction;
The application program that described test control end is additionally operable to scan on described equipment under test to run, detects whether described tested application program is killed, if detecting, described tested application program is killed, then send command for stopping to described equipment under test;
Described equipment under test is additionally operable to terminate described memory consumption program according to described command for stopping, and restart described tested application program, obtain current operation page data, it is recorded as the second data, and judge whether described first data and the second data meet predetermined expection, if so, then described tested Application testing passes through, if it is not, then described tested Application testing does not pass through.
The low internal storage testing method of above-mentioned application program, device and system, obtain the current operation page data of tested application program, it is designated as the first data, tested application program is switched to backstage, start memory consumption program, Installed System Memory is taken until Installed System Memory deficiency kills tested application program by memory consumption program, after tested application program is killed, terminate memory consumption program, restart tested application program again, obtain current operation page data, it is designated as the second data, judge the first data and the predetermined expection of the second data fit, then tested Application testing passes through, achieve the low MEMTEST of application programs, need not test manually, testing efficiency is high.
Accompanying drawing explanation
The lottery application that Figure 1A is traditional is switched to the page presentation schematic diagram before backstage;
Figure 1B is the page presentation schematic diagram after lottery application is switched on again;
Fig. 2 is the applied environment schematic diagram of the low internal storage testing method of application program in an embodiment;
Fig. 3 is the internal structure schematic diagram of equipment under test in an embodiment;
Fig. 4 is the flow chart of the low internal storage testing method of application program in an embodiment;
Fig. 5 is the schematic diagram performing the sequence of operation after entering tested application program in an embodiment;
Fig. 6 is the schematic diagram obtaining current operation page data in an embodiment;
Fig. 7 is startup and the termination control logic schematic diagram of memory consumption program in an embodiment;
Fig. 8 is the schematic flow sheet starting memory consumption program in an embodiment;
Fig. 9 is the structured flowchart of the low test device for internal memory of application program in an embodiment;
Figure 10 is the internal structure block diagram of the second startup module in an embodiment;
Figure 11 is the structured flowchart of the low test device for internal memory of application program in another embodiment;
Figure 12 is the structural representation of the low memory test system of application program in an embodiment.
Detailed description of the invention
In order to make the purpose of the present invention, technical scheme and advantage clearly understand, below in conjunction with drawings and Examples, the present invention is further elaborated.Should be appreciated that specific embodiment described herein is only in order to explain the present invention, is not intended to limit the present invention.
It is appreciated that term used in the present invention " first ", " second " etc. can be used for describing various element in this article, but these elements should not be limited by these terms.These terms are only for distinguishing first element with another element.For example, without departing from the scope of the invention, it is possible to the first client is called the second client, and similarly, the second client can be called the first client.First client and the second client both clients, but it is not same client.
Fig. 2 is the applied environment schematic diagram of the low internal storage testing method of application program in an embodiment.As in figure 2 it is shown, this applied environment includes test control end 210 and equipment under test 220.Test control end 210 sends test instruction to equipment under test 220;Equipment under test 220 starts tested application program according to test instruction, automatically performs the sequence of operation, obtains current operation page data, it is recorded as the first data, tested application program is switched to backstage again, receives enabled instruction, start memory consumption program according to enabled instruction;Test control end 210 scans the application program run on equipment under test, detects whether tested application program is killed, if detecting, tested application program is killed, then send command for stopping to equipment under test 220;Equipment under test 220 terminates described memory consumption program according to command for stopping, and restart described tested application program, obtain current operation page data, it is recorded as the second data, and judge these first data and the whether predetermined expection of the second data, if so, then this tested Application testing passes through, if it is not, then this tested Application testing does not pass through.
Test control end 210 can be test platform or testing and control terminal etc..
Equipment under test 220 can be desk computer, mobile phone, panel computer or personal digital assistant or Wearable etc..
Fig. 3 is the internal structure schematic diagram of equipment under test in an embodiment.As it is shown on figure 3, this terminal includes the processor, non-volatile memory medium, internal memory, network interface, display screen and the input equipment that are connected by system bus.Wherein, the non-volatile memory medium storage of terminal has operating system.This processor is used to realize the low internal storage testing method of application program.The display screen of terminal can be LCDs or electric ink display screen etc., input equipment can be the touch layer covered on display screen, can also be the button, trace ball or the Trackpad that arrange in terminal enclosure, it is also possible to be external keyboard, Trackpad or mouse etc..This terminal can be mobile phone, panel computer or personal digital assistant.It will be appreciated by those skilled in the art that, structure shown in Fig. 3, it it is only the block diagram of the part-structure relevant to the application scheme, it is not intended that the restriction to the terminal that the application scheme is applied thereon, concrete terminal can include than shown in figure more or less of parts, or combine some parts, or there is different parts layouts.Additionally, test control end may also comprise processor, non-volatile memory medium, internal memory, network interface and the input equipment etc. that are connected by system bus.
Fig. 4 is the flow chart of the low internal storage testing method of application program in an embodiment.As shown in Figure 4, the low internal storage testing method of a kind of application program, comprise the following steps:
Step 402, obtains the current operation page data of tested application program, is recorded as the first data.
In the present embodiment, obtain the current operation page data after tested application program is performed operation, be recorded as the first data.
In one embodiment, before step 402, also include: start tested application program;Automatically the sequence of operation is performed.
In the present embodiment, before starting tested application program, can first start test case, initialization test environment.Test case refers to one group of test input, execution condition and the expected results worked out for certain special objective, in order to tests certain Program path or examines whether meet certain particular requirement.Test case herein is the test case worked out to test the low MEMTEST of application program.Initialization test environment is installed tested application program, and records a daily record.
Low MEMTEST refers to when system because after low memory kills the application program being switched to backstage by user, the test such as availability after application program is opened again and vigorousness.
Equipment under test starts tested application program automatically according to test instruction.
Being pre-configured with the sequence of operation, then tested application program performs according to the sequence of operation being pre-configured with.The sequence of operation refers to that sequence of operations arranges the operational order of formation in order.Such as, after accessing webpage, first obtain list of songs, then select song 4 broadcasting etc. to form a series of operational order in list of songs.
Fig. 5 is the schematic diagram performing the sequence of operation after entering tested application program in an embodiment.As it is shown in figure 5, after entering the operation interface of tested application program, automatically perform the sequence of operation, as chosen the 4th first song in playlist.
Fig. 6 is the schematic diagram obtaining current operation page data in an embodiment.As shown in Figure 6, the first data of record are song 1, song 2, song 3, song 4, song 5, song 6, song 7, song 8, song 9, and currently playing is song 4.
Step 404, is switched to backstage by this tested application program.
In the present embodiment, tested application program is switched to running background by equipment under test.
Step 406, receives enabled instruction, starts memory consumption program according to this enabled instruction.
In the present embodiment, equipment under test receives the enabled instruction that test control end sends, and starts memory consumption program according to this enabled instruction.This memory consumption program can be pre-installed on equipment under test.The effect of memory consumption program is the free memory of cycle consumption system; the internal memory of application fixed size when circulation starts every time; read system free memory again; when system free memory is more than the minimal protection threshold value of system; then application takies the internal memory of fixed size; enter back into next round circulation; when system free memory is less than the minimal protection threshold value of system; then suspend memory consumption program; and discharge the internal memory taken; restart memory consumption circulation, until detecting that tested application program is killed, then memory consumption program determination.
Step 408, if detecting, this tested application program is killed, then receive command for stopping, terminates this memory consumption program according to this command for stopping.
In the present embodiment, test control end, by the application program run on process scanning imaging system scanning equipment under test, detects whether tested application program is killed, if tested application program is killed, then sends command for stopping to equipment under test.Equipment under test receives command for stopping, terminates memory consumption program according to this command for stopping.
Step 410, restarts this tested application program, obtains current operation page data, is recorded as the second data.
In the present embodiment, after equipment under test terminates memory consumption program, restart this tested application program, obtain current operation page data, be recorded as the second data.
Step 412, it is judged that whether these first data and the second data meet predetermined expection, if so, then performs step 414, if it is not, then perform step 416.
In the present embodiment, it is judged that whether the first data and the second data meet predetermined expection, and this predetermined expection can be that the first data are identical with the second data.
Step 414, this tested Application testing passes through.
Step 416, this tested Application testing does not pass through.
Above-mentioned steps 402 to 420 realizes it should be noted that can call adbshell order.Such as, tested APP (application program): adbinstall tested APP path is installed;
Start tested APP:adbshellamstart order;
Obtain current operation page data: adbshelldumpsyssurfaceFlinger list;
Tested APP is switched to backstage: adbshellinputkeyevent3;
Start memory consumption program: adbshell memory consumption Program path;
Process scan instruction: abdshellps | the tested APP process name $ of findstr.
The low internal storage testing method of above-mentioned application program, get the current operation page data of tested application program, it is designated as the first data, tested application program is switched to backstage, start memory consumption program, Installed System Memory is taken until Installed System Memory deficiency kills tested application program by memory consumption program, after tested application program is killed, terminate memory consumption program, restart tested application program again, obtain current operation page data, it is designated as the second data, judge the first data and the predetermined expection of the second data fit, then tested Application testing passes through, achieve the low MEMTEST of application programs, need not test manually, reduce the cost of labor of test, testing efficiency is high.Additionally, also the compatibility test of different type of machines can be carried out to the equipment of multiple types by Quick Extended.
The low internal storage testing method of above-mentioned application program can be applicable to web browser test, music player test, lottery application test, stock Application testing etc., is not limited to this.
It should be noted that, under low internal memory scene, a major effect of application programs is that the data that application program is saved in internal memory are released, thus causing time application program is opened again, user can find the loss of data operated before, in order to avoid this problem, the mechanism that data persistence preserves can be adopted:
(1) data preserve: when user leaves the page (Activity) that data depend on, tested application program is saved in the data on this page in the file of storage card of equipment under test automatically;
Specifically, write the data to when Activity performs onPause () method in the file of storage card.
(2) data load: when user is again introduced into this page, first check for whether also preserving in internal memory the data of correspondence, if having, then directly read the data preserved in internal memory, and are rendered on the page and are shown;If no, then from the file of preservation last time, read the data of correspondence and be rendered on the page and be shown, being also saved in internal memory for next time simultaneously.
Specifically, perform data when Activity performs onResume () method to load.
In one embodiment, before the step of the tested application program of this startup, the low internal storage testing method of above-mentioned application program also includes: utilize primary developing instrument establishment memory consumption program.
In the present embodiment, utilize NDK (NativeDevelopmentKit, primary developing instrument) work out memory consumption program, the memory consumption program of this primary developing instrument establishment is not limited (namely each Android application program not can exceed that the internal memory restriction upper limit set by system) by Installed System Memory.So, the memory consumption program that available NDK writes quickly consumes Installed System Memory.
Fig. 7 is startup and the termination control logic schematic diagram of memory consumption program in an embodiment.As it is shown in fig. 7, the control of memory consumption program includes test control end, process scanning imaging system and memory consumption program.Test control end is the control end that automatic test cases performs, and is responsible for the execution of whole test case, including the control instruction sending memory consumption program to equipment under test, including enabled instruction and command for stopping.
The enabled instruction of memory consumption program can be: adbshell memory consumption executable path start.
Memory consumption program termination instruction can be: adbshellkill s9 memory consumption program process ID.
Startup and the termination control mode of memory consumption program are not limited to above-mentioned instruction, can be also other.
On test control end calling process scanning imaging system scanning equipment under test, whether tested application program is killed, its Main Function is the application program by continually scanning on equipment under test, checks whether the tested application program being switched to backstage is killed by system due to low memory.
Process scan instruction can be: adbshellps | the tested APP process name $ of findstr.Such as: adbshellps | findstrcom.abc.qqLottery.
Startup and the termination procedure of memory consumption program include: test control end sends enabled instruction to equipment under test, equipment under test startup optimization memory consumption program;Test control end calling process scanning imaging system, detects whether tested application program is killed, if so, then sends command for stopping to equipment under test, and equipment under test is according to command for stopping memory consumption program out of service, if it is not, then process scanning imaging system continues to scan on.
Fig. 8 is the schematic flow sheet starting memory consumption program in an embodiment.As shown in Figure 8, in one embodiment, start the step of this memory consumption program according to this enabled instruction to include:
Step 802, reads system free memory.
In the present embodiment, system free memory refers to the spendable internal memory of system spare.Can pass through to order: cat/proc/meminfo) read system free memory.
Step 804, it may be judged whether receive command for stopping, if so, then terminates, if it is not, then perform step 806.
Step 806, it is judged that this system free memory, whether less than minimal protection threshold value, if so, performs step 808, if it is not, perform step 812.
Minimal protection threshold value is that anti-locking system free memory is depleted to 0M (million) left and right, thus causing the system protection threshold value that system reboot makes the failure of whole test case set.Minimal protection threshold value generally takes the internal memory warning value of the foreground process that current equipment under test sets.
Step 808, this memory consumption program of operation suspension, discharge committed memory.
In the present embodiment, system free memory less than minimal protection threshold value, then suspends memory consumption program, and discharges the internal memory taken.
Step 810, starts multiple other application programs except this tested application program successively to foreground, is then back to perform step 802.
In the present embodiment, start other application programs except tested application program successively to foreground, can being reduced at the importance score of the tested application program on backstage, thus allowing tested application program become in follow-up memory consumption circulation, Lowmemorykiller mechanism more preferably selects kills target.These other application programs can be the application program in trusted pool of applications, improves the safety of system.
Before step 810, also include: whether to authorize other application programs started except tested application program, if so, then allow other application programs starting except tested application program to foreground, if it is not, then do not allow to start other application programs.
It is that to be more early switched to the probability that the application program on backstage preferentially killed more high that Lowmemorykiller mechanism kills the selection strategy of background application.The importance of the application program being switched to backstage earlier is reduced to backstage, thus killing tested application program as early as possible by constantly starting and switch other application programs.
The corresponding table of a Application Type and importance parameter can be safeguarded, as shown in table 1 inside operating system.
Table 1
Wherein, foreground application refers to the application program that can only operate in foreground, can be suspended when it is invisible.Such as music player etc..
Visible application program refers to some widgets etc. being positioned on interface, such as informing etc..
Background service refers to that some programs are at running background, are generally used for and intercept information or the action that hardware, system or other application programs produce.
Multipad refers to desktop presentation application program.
Background application refers to application program limited alternately, is hiding at life cycle or other times, during configuration.Such as call filtration program or automatic SMS reply program etc..
Content supply point refers to that the data between the application that Android application framework provides provide and exchange scheme, and it provides outbound data for all of application.
The importance of this kind of application program that importance parameter is more low is more high.
For minimal protection threshold value for M5, after android system free memory is lower than M5, system start-up Lowmemorykiller mechanism is killed the process being positioned at backstage and is carried out releasing memory.
Step 812, distributes fixed size internal memory for this memory consumption program.
In the present embodiment, when system free memory is not less than minimal protection threshold value, then distribute fixed size internal memory for memory consumption program.This fixed size internal memory can be 5KB (kilobytes) or 10KB etc., is not limited to this.
When not receiving command for stopping, when system free memory is not less than minimal protection threshold value, it is constantly memory consumption program storage allocation.
The method of above-mentioned startup optimization memory consumption program; by arranging minimal protection threshold value; anti-locking system free memory exhausts and causes that system reboot makes whole test crash; by when system free memory is lower than minimal protection threshold value; suspend memory consumption program, start other application programs successively to foreground after committed memory discharging, be reduced at the importance of the tested application program on backstage; so that tested application program is preferentially killed, improve testing efficiency.
Fig. 9 is the structured flowchart of the low test device for internal memory of application program in an embodiment.As it is shown in figure 9, the low test device for internal memory of a kind of application program, start module 906 including data acquisition module 902, handover module 904, second, terminate module 908 and judge module 910.Wherein:
Data acquisition module 902, for obtaining the current operation page data of tested application program, is recorded as the first data.
Handover module 904 is for being switched to backstage by this tested application program.
Start module 906 to be used for receiving enabled instruction, start memory consumption program according to this enabled instruction.
In the present embodiment, equipment under test receives the enabled instruction that test control end sends, and starts memory consumption program according to this enabled instruction.This memory consumption program can be pre-installed on equipment under test.
If terminating module 908 for detecting that this tested application program is killed, then receive command for stopping, terminate this memory consumption program according to this command for stopping.
Data acquisition module 910 is additionally operable to after restarting this tested application program, obtains current operation page data, is recorded as the second data.
Judge module 912 is used for judging whether these first data and the second data meet predetermined expection, and if so, then this tested Application testing passes through, if it is not, then this tested Application testing does not pass through.
In the present embodiment, it is judged that whether the first data and the second data meet predetermined expection, and this predetermined expection can be that the first data are identical with the second data.
The low test device for internal memory of above-mentioned application program, after starting tested application program, perform the sequence of operation, get current operation page data, it is designated as the first data, tested application program is switched to backstage, start memory consumption program, Installed System Memory is taken until Installed System Memory deficiency kills tested application program by memory consumption program, after tested application program is killed, terminate memory consumption program, restart tested application program again, obtain current operation page data, it is designated as the second data, judge the first data and the predetermined expection of the second data fit, then tested Application testing passes through, achieve the low MEMTEST of application programs, need not test manually, testing efficiency is high.
In one embodiment, the low test device for internal memory of a kind of application program, start module 906 including data acquisition module 902, handover module 904, second, terminate module 908 and judge module 910, also include starting module and operation executing module.
Start module to be additionally operable to start tested application program.
In the present embodiment, before starting tested application program, can first start test case, initialization test environment.Test case refers to one group of test input, execution condition and the expected results worked out for certain special objective, in order to tests certain Program path or examines whether meet certain particular requirement.Test case herein is the test case worked out to test the low MEMTEST of application program.Initialization test environment is installed tested application program, and records a daily record.
Low MEMTEST refers to when system because after low memory kills the application program being switched to backstage by user, the test such as availability after application program is opened again and vigorousness.
Equipment under test starts tested application program automatically according to test instruction.
Operation executing module is for automatically performing the sequence of operation.
In the present embodiment, being pre-configured with the sequence of operation, the sequence of operation being then pre-configured with performs.The sequence of operation refers to that sequence of operations arranges the operational order of formation in order.Such as access after webpage, first select numeral 1, then choose digital 2 etc. to form a series of operational order.
Figure 10 is the internal structure block diagram of the second startup module in an embodiment.As shown in Figure 10, this startup module 906 includes reading unit 9062, judging unit 9064, releasing unit 9066, start unit 9068 and allocation units 9069.Wherein:
Read unit 9062 to be used for reading system free memory.
Judging unit 9064 is used for judging whether to receive command for stopping, if so, then terminates, if it is not, determine whether that whether this system free memory is less than minimal protection threshold value.
If releasing unit 9066 is for this system free memory less than minimal protection threshold value, then this memory consumption program of operation suspension, discharges committed memory.
Start unit 9068 is for starting multiple other application programs except this tested application program successively, then is continued reading system free memory by reading unit.
If allocation units 9069 are not less than minimal protection threshold value for this system free memory, then it it is this memory consumption program distribution fixed size internal memory.
The method of above-mentioned startup optimization memory consumption program; by arranging minimal protection threshold value; anti-locking system free memory exhausts and causes that system reboot makes whole test crash; by when system free memory is lower than minimal protection threshold value; suspend memory consumption program, start other application programs successively to foreground after committed memory discharging, be reduced at the importance of the tested application program on backstage; so that tested application program is preferentially killed, improve testing efficiency.
Figure 11 is the structured flowchart of the low test device for internal memory of application program in another embodiment.As shown in figure 11, the low test device for internal memory of a kind of application program, except including data acquisition module 902, handover module 904, start module 906, terminating module 908 and judge module 910, also include compiling module 912.Wherein:
Compiling module 912 is for, before the tested application program of this startup, utilizing primary developing instrument establishment memory consumption program.
Figure 12 is the structural representation of the low memory test system of application program in an embodiment.As shown in figure 12, the low memory test system of a kind of application program, including test control end 1210 and equipment under test 1220.Wherein:
Test control end 1210 is used for sending test instruction to equipment under test.
Equipment under test 1220 is used for receiving this test instruction, tested application program is started according to test instruction, automatically the sequence of operation is performed, obtain current operation page data, it is recorded as the first data, again this tested application program is switched to backstage, and receives enabled instruction, start memory consumption program according to this enabled instruction.
The application program that test control end 1210 is additionally operable to scan on this equipment under test to run, detects whether this tested application program is killed, if detecting, this tested application program is killed, then send command for stopping to this equipment under test.
This equipment under test 1220 is additionally operable to terminate this memory consumption program according to this command for stopping, and restart this tested application program, obtain current operation page data, it is recorded as the second data, and judge whether these first data and the second data meet predetermined expection, if so, then this tested Application testing passes through, if it is not, then this tested Application testing does not pass through.
Test control end can realize by calling adbshell order, for instance:
Tested APP (application program): adbinstall tested APP path is installed;
Start tested APP:adbshellamstart order;
Obtain current operation page data: adbshelldumpsyssurfaceFlinger list;
Tested APP is switched to backstage: adbshellinputkeyevent3;
Start memory consumption program: adbshell memory consumption Program path;
Process scan instruction: abdshellps | the tested APP process name $ of findstr.
The low memory test system of above-mentioned application program, after starting tested application program, perform the sequence of operation, get current operation page data, it is designated as the first data, tested application program is switched to backstage, start memory consumption program, Installed System Memory is taken until Installed System Memory deficiency kills tested application program by memory consumption program, after tested application program is killed, terminate memory consumption program, restart tested application program again, obtain current operation page data, it is designated as the second data, judge the first data and the predetermined expection of the second data fit, then tested Application testing passes through, achieve the low MEMTEST of application programs, need not test manually, testing efficiency is high.
In one embodiment, after this equipment under test 1220 starts memory consumption program, read system free memory, it is judged that whether this system free memory is less than minimal protection threshold value;If this system free memory is less than minimal protection threshold value, then this memory consumption program of operation suspension, discharge committed memory, then start multiple other application programs except this tested application program successively to foreground, continue reading system free memory;If this system free memory is not less than minimal protection threshold value, then it it is this memory consumption program distribution fixed size internal memory.
The method of above-mentioned startup optimization memory consumption program; by arranging minimal protection threshold value; anti-locking system free memory exhausts and causes that system reboot makes whole test crash; by when system free memory is lower than minimal protection threshold value; suspend memory consumption program, start other application programs successively to foreground after committed memory discharging, be reduced at the importance of the tested application program on backstage; so that tested application program is preferentially killed, improve testing efficiency.
Further, this equipment under test installs the memory consumption program utilizing primary developing instrument to work out.
One of ordinary skill in the art will appreciate that all or part of flow process realizing in above-described embodiment method, can be by the hardware that computer program carrys out instruction relevant to complete, described program can be stored in a non-volatile computer read/write memory medium, this program is upon execution, it may include such as the flow process of the embodiment of above-mentioned each side method.Wherein, described storage medium can be magnetic disc, CD, read-only store-memory body (Read-OnlyMemory, ROM) etc..
Embodiment described above only have expressed the several embodiments of the present invention, and it describes comparatively concrete and detailed, but therefore can not be interpreted as the restriction to the scope of the claims of the present invention.It should be pointed out that, for the person of ordinary skill of the art, without departing from the inventive concept of the premise, it is also possible to making some deformation and improvement, these broadly fall into protection scope of the present invention.Therefore, the protection domain of patent of the present invention should be as the criterion with claims.

Claims (12)

1. a low internal storage testing method for application program, comprises the following steps:
Obtain the current operation page data of tested application program, be recorded as the first data;
Described tested application program is switched to backstage;
Receive enabled instruction, start memory consumption program according to described enabled instruction;
When detecting that described tested application program is killed, receive command for stopping, terminate described memory consumption program according to described command for stopping;
Restart described tested application program, obtain current operation page data, be recorded as the second data;
When described first data and the predetermined expection of the second data fit, described tested Application testing passes through.
2. method according to claim 1, it is characterised in that the described step according to the described enabled instruction described memory consumption program of startup includes:
Reading system free memory;
Judge that whether described system free memory is less than minimal protection threshold value;
If described system free memory is less than minimal protection threshold value, then memory consumption program described in operation suspension, discharge committed memory, then start multiple other application programs except described tested application program successively to foreground, continue reading system free memory;
If described system free memory is not less than minimal protection threshold value, then it it is described memory consumption program distribution fixed size internal memory.
3. method according to claim 2, it is characterised in that after the step of described reading system free memory, described method also includes:
Judge whether to receive command for stopping, if so, then terminate, if it is not, then perform described to judge that system free memory is whether less than the step of minimal protection threshold value.
4. method according to claim 1, it is characterised in that before the step of the tested application program of described startup, described method also includes:
Utilize primary developing instrument establishment memory consumption program.
5. the low test device for internal memory of an application program, it is characterised in that including:
Data acquisition module, for obtaining the current operation page data of tested application program, is recorded as the first data;
Handover module, for being switched to backstage by described tested application program;
Start module, be used for receiving enabled instruction, start memory consumption program according to described enabled instruction;
Terminate module, if for detecting that described tested application program is killed, receive command for stopping, terminate described memory consumption program according to described command for stopping;
Described data acquisition module is additionally operable to after restarting described tested application program, obtains current operation page data, is recorded as the second data;
Judge module, for when described first data and the predetermined expection of the second data fit, described tested Application testing passes through.
6. device according to claim 5, it is characterised in that described startup module includes:
Read unit, be used for reading system free memory;
Judging unit, is used for judging that whether described system free memory is less than minimal protection threshold value;
Releasing unit, if for described system free memory less than minimal protection threshold value, then memory consumption program described in operation suspension, discharges committed memory;
Start unit, for starting multiple other application programs except described tested application program to foreground successively, then is continued reading system free memory by reading unit;
Allocation units, if being not less than minimal protection threshold value for described system free memory, are then described memory consumption program distribution fixed size internal memory.
7. device according to claim 6, it is characterised in that described judging unit is additionally operable to after described reading system free memory; judge whether to receive command for stopping, if so, then terminate; if it is not, then performed to judge that whether system free memory is less than minimal protection threshold value by described judging unit.
8. device according to claim 5, it is characterised in that described device also includes:
Compiling module, for, before the tested application program of described startup, utilizing primary developing instrument establishment memory consumption program.
9. the low memory test system of an application program, it is characterised in that including:
Test control end, is used for sending test instruction to equipment under test;
Equipment under test, for receiving described test instruction, tested application program is started according to test instruction, automatically the sequence of operation is performed, obtain current operation page data, be recorded as the first data, more described tested application program is switched to backstage, and receive enabled instruction, start memory consumption program according to described enabled instruction;
The application program that described test control end is additionally operable to scan on described equipment under test to run, detects whether described tested application program is killed, if detecting, described tested application program is killed, then send command for stopping to described equipment under test;
Described equipment under test is additionally operable to terminate described memory consumption program according to described command for stopping, and restart described tested application program, obtain current operation page data, it is recorded as the second data, and judge whether described first data and the second data meet predetermined expection, if so, then described tested Application testing passes through, if it is not, then described tested Application testing does not pass through.
10. system according to claim 9, it is characterised in that after described equipment under test starts memory consumption program, reads system free memory, it is judged that whether described system free memory is less than minimal protection threshold value;
If described system free memory is less than minimal protection threshold value, then memory consumption program described in operation suspension, discharge committed memory, then start multiple other application programs except described tested application program successively, continue reading system free memory;
If described system free memory is not less than minimal protection threshold value, then it it is described memory consumption program distribution fixed size internal memory.
11. system according to claim 10, it is characterised in that described equipment under test is additionally operable to after described reading system free memory; judge whether to receive command for stopping, if so, then terminate; if it is not, then judge that whether system free memory is less than minimal protection threshold value.
12. system according to claim 9, it is characterised in that described equipment under test installs the memory consumption program utilizing primary developing instrument to work out.
CN201610144107.2A 2016-03-14 2016-03-14 Application low memory test method, apparatus and system Pending CN105808440A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610144107.2A CN105808440A (en) 2016-03-14 2016-03-14 Application low memory test method, apparatus and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610144107.2A CN105808440A (en) 2016-03-14 2016-03-14 Application low memory test method, apparatus and system

Publications (1)

Publication Number Publication Date
CN105808440A true CN105808440A (en) 2016-07-27

Family

ID=56468354

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610144107.2A Pending CN105808440A (en) 2016-03-14 2016-03-14 Application low memory test method, apparatus and system

Country Status (1)

Country Link
CN (1) CN105808440A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108153620A (en) * 2017-12-27 2018-06-12 深圳豪客互联网有限公司 A kind of course control method and device
CN108874268A (en) * 2017-05-09 2018-11-23 腾讯科技(深圳)有限公司 The acquisition method and device of user behavior data
CN112860145A (en) * 2019-07-30 2021-05-28 华为技术有限公司 Application control method and electronic equipment

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102662850A (en) * 2012-03-30 2012-09-12 杭州华三通信技术有限公司 Memory management method and system
CN102799471A (en) * 2012-05-25 2012-11-28 上海斐讯数据通信技术有限公司 Method and system for process recycling of operating system
US20120324200A1 (en) * 2011-01-30 2012-12-20 International Business Machines Corporation Method and apparatus of memory overload control
CN103186462A (en) * 2011-12-30 2013-07-03 百度在线网络技术(北京)有限公司 Android operation system detection method and system
CN103218307A (en) * 2013-04-18 2013-07-24 海信集团有限公司 Memory management system and memory management method
CN103324500A (en) * 2013-05-06 2013-09-25 广州市动景计算机科技有限公司 Method and device for recycling internal memory
CN104252389A (en) * 2013-06-27 2014-12-31 腾讯科技(深圳)有限公司 Application operation method, system and application
US20150095603A1 (en) * 2013-09-30 2015-04-02 Samsung Electronics Co., Ltd. Method and device for clearing process in electronic device

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120324200A1 (en) * 2011-01-30 2012-12-20 International Business Machines Corporation Method and apparatus of memory overload control
CN103186462A (en) * 2011-12-30 2013-07-03 百度在线网络技术(北京)有限公司 Android operation system detection method and system
CN102662850A (en) * 2012-03-30 2012-09-12 杭州华三通信技术有限公司 Memory management method and system
CN102799471A (en) * 2012-05-25 2012-11-28 上海斐讯数据通信技术有限公司 Method and system for process recycling of operating system
CN103218307A (en) * 2013-04-18 2013-07-24 海信集团有限公司 Memory management system and memory management method
CN103324500A (en) * 2013-05-06 2013-09-25 广州市动景计算机科技有限公司 Method and device for recycling internal memory
CN104252389A (en) * 2013-06-27 2014-12-31 腾讯科技(深圳)有限公司 Application operation method, system and application
US20150095603A1 (en) * 2013-09-30 2015-04-02 Samsung Electronics Co., Ltd. Method and device for clearing process in electronic device

Non-Patent Citations (5)

* Cited by examiner, † Cited by third party
Title
FLYPU: "Android Low Memory测试工具 Eat Memory", 《HTTP://BLOG.CSDN.NET/FLYPU/ARTICLE/DETAILS/48145107》 *
IMYYQ: "当Android系统内存不足时,会回收后台运行应用的内存", 《HTTP://BLOG.CSDN.NET/U010216716/ARTICLE/DETAILS/48708675》 *
WEIZONGWEI5: "android开发中模拟系统内存不足 应用释放的情况", 《HTTP://BLOG.CSDN.NET/WEIZONGWEI5/ARTICLE/DETAILS/50515719》 *
ZRHLOVESWALLOW: "低内存处理", 《HTTP://BLOG.CSDN.NET/ZRHLOVESWALLOW/ARTICLE/DETAILS/21370993》 *
月光XIA漫步: "一个快速消耗内存的小程序", 《HTTP://BLOG.CSDN.NET/YANG15225094594/ARTICLE/DETAILS/7803524》 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108874268A (en) * 2017-05-09 2018-11-23 腾讯科技(深圳)有限公司 The acquisition method and device of user behavior data
CN108874268B (en) * 2017-05-09 2023-03-10 腾讯科技(深圳)有限公司 User behavior data acquisition method and device
CN108153620A (en) * 2017-12-27 2018-06-12 深圳豪客互联网有限公司 A kind of course control method and device
CN112860145A (en) * 2019-07-30 2021-05-28 华为技术有限公司 Application control method and electronic equipment
CN112860145B (en) * 2019-07-30 2022-08-26 华为技术有限公司 Application control method and electronic equipment

Similar Documents

Publication Publication Date Title
CN101526901B (en) Method and device for viewing files in computer
KR101702700B1 (en) Fast computer startup
US9021243B2 (en) Method for increasing free memory amount of main memory and computer therefore
KR20090115131A (en) Supporting multiple operating systems in media devices
CN102141940B (en) Device, method and system for recovering firmware update
US20150154033A1 (en) Computer system and boot method thereof
CN101183324A (en) Recovery method of computer system
CN112506745B (en) Memory temperature reading method and device and computer readable storage medium
CN105808440A (en) Application low memory test method, apparatus and system
CN109257249A (en) A kind of network interface card stability test method, apparatus, terminal and storage medium
CN106095493A (en) The loading method of dual operating systems and system
CN109408122A (en) A kind of equipment starting method, electronic equipment and computer storage medium
US20060031716A1 (en) Method of providing a real time solution to error occurred when computer is turned on
CN100541509C (en) A kind of method of scanning and killing computer virus
CN108268302A (en) Realize the method and apparatus that equipment starts
CN106126206A (en) A kind of information processing method and electronic equipment
CN101299189A (en) DOS method of one of self-startup and multiple operating systems
JP4409681B2 (en) Information processing apparatus and memory control method for information processing apparatus
US20130159689A1 (en) Method and apparatus for initializing embedded device
CN103294578B (en) Method for obtaining instruction of triggering function
CN109634782B (en) Method and device for detecting system robustness, storage medium and terminal
CN101281485B (en) Computer testing method without hard disc
CN113315675B (en) White box switch U-Boot automatic testing method, system and storage medium
CN101901153B (en) Electronic installation and starting-up method thereof
CN105138380B (en) A kind of startup method and device of linux system

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20160727