Disclosure of Invention
In order to solve the above problems, an objective of the present invention is to provide a method for remembering and restoring a test environment, which ensures consistent environments used in two performance tests, reduces the difference between the environments used in two tests, and reduces the amount of memory space occupied by backup.
The technical scheme adopted by the invention for solving the problems is as follows:
a test environment memory and recovery method is provided, when a test terminal is used for testing the performance of an application program, the test environment memory data is obtained through the following steps:
Establishing a first memory list according to the hardware information of the test terminal, the information of the application program to be tested and the memory occupation amount before test;
establishing a second memory list according to the system setting attribute data of the test terminal;
establishing a third memory list according to the related information of the currently installed application program of the test terminal;
when the same test terminal is used again to perform performance test on the same application program, the test environment of the test terminal is recovered through the following steps:
reading the hardware information of the current test terminal and the information of the application program to be tested, and matching and comparing the hardware information and the information of the application program to be tested with the first memory list;
if the matching is successful, recovering corresponding items of the test environment from the server according to the three memory lists according to user-defined selection;
if the matching fails, the test is taken as a new test and the memory data of the test environment is obtained.
Further, the three memory lists are stored in a local server and/or a cloud server.
Further, the information related to the installed application includes, but is not limited to, an application name, a version number.
Further, the user-defined option comprises restoring system settings, restoring the application program and restoring the memory occupation amount, and the user can select one or more of the system settings, the application program and the memory occupation amount in a user-defined mode.
Further, before restoring the corresponding item of the test environment according to the user selection, the method further comprises:
reading system setting attribute data, installed application program information and memory occupation amount before testing of the testing terminal of the test;
matching and comparing the read test environment data of the current test with corresponding data in three memory lists of the test environment data of the last test;
and if the environmental data is not changed in the two tests, the recovery operation is not carried out, otherwise, the corresponding recovery operation is executed.
Further, after the user selects to restore the application program, the method further comprises the following steps:
acquiring the number of the difference between the installed application program in the test and the installed application program in the third memory list of the last test environment data;
comparing the obtained number of the applications with the difference with a preset numerical value, and if the number of the applications with the difference is not greater than the preset numerical value, downloading and recovering the application programs with the difference from the application store according to a third memory list;
if the number of the applications with the difference is larger than the preset value, sending a factory setting restoration confirmation prompt for the user to select whether to perform factory setting restoration operation, and downloading and restoring all the recorded installed application programs in the third memory list from the application store after factory setting restoration.
Further, after the factory setting is restored, the system setting is restored according to the second memory list.
Further, after the user selects to recover the memory occupation amount, the method further comprises the following steps:
acquiring the current memory occupation amount, comparing the current memory occupation amount with the memory occupation amount before the test recorded by the first memory list, and if the current memory occupation amount is lower than the recorded memory occupation amount before the test, performing memory filling operation to enable the current memory occupation amount to reach the recorded memory occupation amount before the test; and if the current memory occupation amount is higher than the recorded memory occupation amount before the test, the memory is refilled to the recorded memory occupation amount before the test after the memory is cleared firstly.
The invention has the beneficial effects that: according to the test environment memory and recovery method, the relevant information of the previous test environment is recorded in the form of the list, the test system and the application do not need to occupy a large space for backup, the storage space of the test terminal is saved, the requirement for recovering the test environment of the small-capacity mobile phone is met when backup is carried out, when the test environment needs to be recovered, the current test environment information and the information recorded by the list are matched and compared, corresponding recovery operation is executed according to the matching result, full recovery is not needed each time, the system recovery time is saved, the process is simple and automatic, the test environment can be recovered without excessive professional knowledge, and the difference between the previous test environment and the next test environment is reduced through the memory and recovery method, so that the test result is more accurate.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be described in detail with reference to the accompanying drawings and specific embodiments. The test environment memory and recovery method is suitable for the field of application performance test.
Referring to fig. 1, in the testing environment memory and recovery method of the present invention, the testing terminal may be a PC, a tablet computer, a mobile phone or other intelligent devices capable of running an application to be tested, where the mobile phone is taken as the testing terminal as an example, when a performance test is performed on an application by using the mobile phone, the testing environment memory data is obtained through the following steps:
s11, establishing a first memory list according to the mobile phone hardware information, the information of the application program to be tested and the memory occupation amount before testing;
s12, establishing a second memory list according to the system setting attribute data of the mobile phone;
s13, establishing a third memory list according to the related information of the current installed application program of the mobile phone;
the backup of the test environment only records the relevant information of the test environment by the memory list and does not backup the system and the installed application program to the local, so that the backup time is greatly shortened, and the problem that the backup of a small-capacity mobile phone is difficult is well solved because the list occupies a very small storage space.
When the same mobile phone is used again to perform performance test on the same application program, the test environment of the mobile phone is recovered through the following steps:
s21, reading the hardware information of the current mobile phone and the information of the application program to be tested, and matching and comparing the hardware information and the information of the application program to be tested with the first memory list;
s22, if the matching is successful, recovering corresponding items of the test environment from the server according to the three memory lists and user-defined selection;
and S23, if the matching fails, taking the test as a new test and acquiring the test environment memory data.
Due to the recovery from the server, even if the mobile phone is damaged or the system is formatted by misoperation, the recovery can be carried out through the server, and the situation that the recovery cannot be carried out due to the fact that the local backup is deleted is not needed to be worried about.
Further, the three memory lists are stored in a local server and/or a cloud server. The step of downloading from the server is omitted in the local memory list, so that the recovery process is simpler, but for insurance, a memory list backup is also stored in the cloud server, so that the condition that the local memory list is damaged to cause matching failure is prevented, and when the local matching fails, the memory list is continuously searched from the cloud server for matching comparison.
Further, the information related to the installed application includes, but is not limited to, an application name, a version number. The basic information may include only the application name and version number, but for more accuracy, to prevent downloading to some malicious imposter application software, the file size, file type, developer name, etc. of the application may be recorded as well as other information for identifying the application.
Further, the user-defined option comprises restoring system settings, restoring the application program and restoring the memory occupation amount, and the user can select one or more of the system settings, the application program and the memory occupation amount in a user-defined mode. Sometimes, a user may need to test the influence of a certain setting, application or memory occupation on a performance test, the factor needs to be kept different in the two test environments, and other factors are the same, so that the requirement of the user can be met by selecting a recovery item in a self-defined manner.
Further, before restoring the corresponding item of the test environment according to the user selection, the method further comprises:
reading system setting attribute data, installed application program information and memory occupation amount before testing of the mobile phone under the test;
matching and comparing the read test environment data of the current test with corresponding data in three memory lists of the test environment data of the last test;
And if the environmental data is not changed in the two tests, the recovery operation is not carried out, otherwise, the corresponding recovery operation is executed.
Because test environment recovery is required, in order to reduce the recovery time as much as possible, recovery operation is not required for the place where the two tests have not changed, before the recovery operation is performed, the test environment of the time needs to be read, matched and compared with the last test environment recorded in the memory list to find out the place where the two test environments have changed, and corresponding recovery operation is performed according to the recovery item selected by the user, if the two test environments are completely the same, the recovery step is directly skipped, and the test environment recovery is prompted to be successful.
Further, after the user selects to restore the application program, the method further comprises the following steps:
acquiring the number of the difference between the installed application program in the test and the installed application program in the third memory list of the last test environment data;
comparing the obtained number of the applications with the difference with a preset numerical value, and if the number of the applications with the difference is not greater than the preset numerical value, downloading and recovering the application programs with the difference from the application store according to a third memory list;
If the number of the applications with the difference is larger than the preset value, sending a factory setting restoration confirmation prompt for the user to select whether to perform factory setting restoration operation, and downloading and restoring all the recorded installed application programs in the third memory list from the application store after factory setting restoration.
The updating and upgrading speed of the application program is high, when the application programs installed in the test environments are changed for two times, factory setting is directly restored, and then the quick restoration is carried out according to the records of the memory list, the quick restoration is faster than the comparison and restoration of one application program, but the system setting can be restored due to the factory setting restoration, and then the system setting can be restored according to the system setting data recorded in the memory list after the factory setting is restored.
Further, after the user selects to recover the memory occupation amount, the method further comprises the following steps:
acquiring the current memory occupation amount, comparing the current memory occupation amount with the memory occupation amount before the test recorded by the first memory list, and if the current memory occupation amount is lower than the recorded memory occupation amount before the test, performing memory filling operation to enable the current memory occupation amount to reach the recorded memory occupation amount before the test; and if the current memory occupation amount is higher than the recorded memory occupation amount before the test, the memory is refilled to the recorded memory occupation amount before the test after the memory is cleared firstly.
The memory filling does not need to be the same as the memory occupation situation in the last test, the degree of how much memory is occupied by which application does not need to be reached, the recovery difficulty and the recovery time length are increased, and the memory filling can be performed by using any data which can meet the memory filling requirement only by enabling the total memory occupation to be consistent with that in the last test.
The following description is given by way of specific examples to facilitate a better understanding of the present teachings.
In one embodiment, the method for testing environmental memory comprises the following steps:
the first step is as follows: starting a performance monitoring tool and logging in an account, wherein the performance monitoring tool takes testplus assistant as an example, selecting an application program needing performance test, clicking a 'confirm' button, returning to a performance monitoring main interface, and successfully displaying an application program icon to be detected at the lower left of the interface. At this time, the performance monitoring tool can automatically scan the memory, calculate and display the memory use condition of the current equipment. And simultaneously, locally (under a performance monitoring tool installation directory) the use numerical condition of the memory is recorded in the forms of texts, lists, logs and the like. The test terminal device information, performance monitoring tool, and memory usage before testing are recorded in a first memory list, as shown in table 1.
Mobile phone model
|
Millet 6
|
Mobile phone system
|
MIUI 7.5.7.0
|
Performance monitoring tool name
|
testplus assistant
|
Application name to be tested
|
QQ
|
Memory occupancy prior to testing
|
512M |
TABLE 1
The second step is that: and clicking an application program icon of the performance monitoring interface, automatically starting and monitoring the corresponding application program by the performance monitoring tool, and automatically hiding the performance monitoring tool to a background to display a monitoring ending button and display the monitoring ending button on the interface by a floating window.
The third step: every second when the application program to be tested is operated, the background automatically records various performance indexes (such as CPU, memory, power consumption, flow consumption, CPU temperature and the like) of the detection program, and the performance index parameters can be recorded in a first memory list or a performance test result parameter list independently, and a storage path can be set as required.
The fourth step: clicking the 'end' monitor button on the interface opens the test result report interface.
The fifth step: and clicking a 'backup system memory' button below the report interface. The memory recording is completed in three steps.
1) A second memory list is created locally (under a performance monitoring tool installation directory) and used for recording the system setting attributes of the current system equipment, the attributes such as 'display', 'sound and vibration', 'synchronization' and 'positioning service' are automatically recorded through the system setting of the equipment, the loading effect is displayed in the process, other operations cannot be performed, and the recorded system setting is shown in table 2.
Table 22) creates a third memory list locally (under the installation directory of the performance monitoring tool), automatically records information such as the name and version number of the installed application program of the current device through setting- > application management, and displays the loading effect during the process, so that other operations cannot be performed, where the information of the installed application program is shown in table 3, for example.
TABLE 3
And a sixth step: after the memory is finished, the three memory tables can be uploaded to the server by clicking an upload button, and a record is also locally stored.
In the second embodiment, when the test environment recovery is required, the method comprises the following steps:
the first step is as follows: after selecting to load an application program to be tested, returning to a performance monitoring main interface, automatically detecting each memory list of the last mobile phone by the program according to the current application program to be tested and the information of the mobile phone equipment, comparing and matching (firstly, comparing the contents of the first memory list of the last test through local search, judging whether the memory lists are the same or not, if the memory lists are found to be inconsistent, searching the first memory list stored by the server, comparing and matching, and if the memory lists are successfully matched, downloading each memory list to the local), and if the memory lists are successfully matched, prompting whether the last test environment is recovered or not; if the matching fails, the test is taken as a new round of performance detection, and test environment memory is executed, starting from the first step of the first embodiment.
The second step is that: if the 'yes' button is clicked, the system can automatically record two items of 'system setting' and 'application management' and establish a corresponding new memory list, after the record is finished, the system can be compared with the previous corresponding memory list, a recovery suggestion interface is popped up (options comprise recovery system setting, application program recovery and memory occupancy recovery, and multiple options can be provided), and humanized recovery operation can be performed according to requirements; after the corresponding recovery option is selected, the recovery button is clicked, and then the recovery operation is automatically started.
The third step: if the application program recovery option is selected, the contents of the two previous and next memory setting lists are read, the difference is automatically sorted out, if the difference (version number and quantity) of the application program is less than the preset value, the application program can be automatically uninstalled or installed according to the difference list, and the example of the difference list is shown in table 4.
TABLE 4
If the difference number of the application program exceeds a preset value, more effective factory-setting-restoring operation is prompted, at the moment, a 'confirm' button is clicked, and the mobile phone can immediately enter the factory-setting-restoring operation. And if the comparison of the installed application programs is unchanged during the two tests, the operation of restoring factory settings and restoring the application programs cannot be carried out.
The fourth step: after the factory setting is restored, the system setting is restored, so that the attributes (such as brightness, sound and the like) of the system setting of the mobile phone can be automatically restored according to the record of the second memory list.
The fifth step: the software is automatically downloaded locally from the server (application store) one by one according to the record of the third memory list and installed.
And a sixth step: after all software is installed, the performance monitoring tool is restarted, the application program to be tested is manually loaded, the performance monitoring main interface is returned, the performance monitoring tool can compare the memory occupation amount of the current mobile phone scanning memory with that of the first memory list, if the memory occupation amount of the current time is 320M, the memory occupation amount is less than that of the memory occupation amount (512M) in the last test, the memory filling is carried out, and the memory occupation amount is filled to 512M. If the memory occupation of the current time is more than 512M, memory cleaning is firstly carried out, and then memory filling is carried out, so that the memory occupation quantity of two tests is consistent.
The seventh step: and completing the test environment recovery.
The above description is only a preferred embodiment of the present invention, and the present invention is not limited to the above embodiment, and the present invention shall fall within the protection scope of the present invention as long as the technical effects of the present invention are achieved by the same means. The invention is capable of other modifications and variations in its technical solution and/or its implementation, within the scope of protection of the invention.