1. Field of the Invention
The present invention relates to a system testing method, and more particularly to a system testing method through a subsystem performance-based generator.
2. Related Art
The kernel of Linux system includes many system modules, for example, system modules of the system layer (kernel level) or functional modules that are encoded and programmed by a subscriber for realizing certain function. Once the Linux system is booted, the system modules or function modules are loaded into the kernel of the Linux system, so that the functions provided by the system modules or functional modules (briefly referred to as module below) are executed. The memory space and CPU occupation rate occupied by the modules after being loaded into the Linux system directly affect the performance of the whole Linux system. If the programmed modules occupy too much CPU resources or memory space, the system resources that can be simulated by the other modules in the Linux system may be affected, so as to affect the overall system efficiency, or further affect the success rate in assigning the memory space. Therefore, after the module is finished to be programmed, it further needs to test the system performance when the module is loaded into the system. Generally, the common manner includes: after the module is loaded into the kernel of the Linux system, the whole system stability is tested, and then it is observed whether the execution efficiency of the Linux system is reduced or not or the CPU resources are excessively occupied or not after the module is loaded. However, it is a challenging problem how to test the loaded module, and the specific reasons thereof lie in that, although the module can be stably operated in a certain Linux system after being loaded therein, it cannot ensure that the module can be normally operated in other systems, and furthermore, the loaded module may not be operated in a full speed (full load) mode, since the hardware environment is limited, and the testing conditions are complicated.
Different module has a different operation status, so the tested performance data only represents the system performance under the current state, but cannot represent the actual performance of a designated module. Meanwhile, the bottleneck of the whole system performance cannot be effectively found out, for example, I/O problem or memory management defect. As can be known that, the current performance test cannot accurately examine the actual performance of the module under test. In addition, a dependence problem in the usage of system resources exists among the plurality of modules in the Linux system, so the performance of a single module may directly affect the performance of the other modules, which undoubtedly increases the complexity in testing the module performance.
In view of the above problems in the conventional art that the complexity in testing the module performance is rather high and it cannot accurately examine the reason for affecting the system performance, the present invention is directed to a system testing method through a subsystem performance-based generator, which simulates various performances of a module to be tested under various different software execution environments through the subsystem performance-based generator, so as to accurately test the performances of the module to be tested under different performance environments, and thus accurately mastering the reason for affecting the whole system performance under different environments, thereby accurately examining each performance of the module to be tested.
In order to achieve the above objective, the method of the present invention includes the following steps. Firstly, a performance testing parameter of a subsystem performance-based generator is initialized. Next, according to the performance testing parameter, the subsystem performance-based generator assigns a memory occupying space, CPU occupation rate, and I/O round-trip time of the module to be tested. Then, the test on the memory, CPU, and I/O performance are performed on the Linux system through a performance testing tool. Then, the subsystem performance-based generator modifies the performance testing parameter according to test results of the performance tests. Finally, according to the modified testing parameter setting, the system test is performed once again and the test results are recorded through the performance testing tool.
In the system testing method through a subsystem performance-based generator according to a preferred embodiment of the present invention, the step of initializing the subsystem includes setting the performance testing parameter and a subscriber demand parameter through a human-machine interface. The performance testing parameter or the subscriber demand parameter may be the memory occupying space, CPU occupation rate, and I/O performance.
In the system testing method through a subsystem performance-based generator according to a preferred embodiment of the present invention, the step of performing tests on the memory of the Linux system further includes: setting a memory occupying space of the module to be tested according to the performance testing parameter; acquiring a situation about a residual memory space of the Linux system; returning an error message, if the residual memory space of the Linux system does not satisfy the memory occupying space of the performance testing parameter; and otherwise, if the residual memory space of the Linux system satisfies the memory occupying space of the performance testing parameter, further determining whether the memory occupying space of the module to be tested satisfies the subscriber demand parameter or not. If the memory occupying space of the module to be tested does not satisfy the subscriber demand parameter, the memory occupying space of the module to be tested is increased through the subsystem performance-based generator and the system test is performed again.
In the system testing method through a subsystem performance-based generator according to a preferred embodiment of the present invention, the step of performing tests on the CPU performance of the Linux system includes: setting the CPU occupation rate of the module to be tested according to the performance testing parameter; acquiring a CPU occupation rate of the Linux system; returning the error message, if the CPU occupation rate of the Linux system is larger than the CPU occupation rate of the subscriber demand parameter; and otherwise, if the CPU occupation rate of the Linux system is not larger than the CPU occupation rate of the performance testing parameter, further determining whether the CPU occupation rate of the Linux system satisfies the CPU occupation rate of the subscriber demand parameter or not.
If the CPU occupation rate of the module to be tested does not satisfy the subscriber demand parameter, the CPU occupation rate of the module to be tested is increased through the subsystem performance-based generator and the system test is performed again.
In the system testing method through a subsystem performance-based generator according to a preferred embodiment of the present invention, the step of performing tests on the I/O performance of the Linux system includes: calculating an I/O performance of the module to be tested in a unit of time; returning the error message, if the I/O performance of the Linux system does not satisfy an I/O performance value of the subscriber demand parameter; and otherwise, if the I/O performance of the Linux system satisfies the I/O performance value of the subscriber demand parameter, further determining whether the I/O performance value setting of the module to be tested reaches the I/O performance value of the subscriber demand parameter or not.
If the I/O performance of the module to be tested does not satisfy the subscriber demand parameter, the I/O performance of the module to be tested is increased through the subsystem performance-based generator, and the system test is performed again.
To sum up, in the system testing method through a subsystem performance-based generator of the present invention, the subsystem performance-based generator is used to simulate the performance settings of the module to be tested, for example, the memory occupying space, CPU occupation rate, and after setting the operating parameter of the module to be tested, the whole system performance test is performed by the performance testing tool. If the obtained overall performance does not satisfy the subscriber demand, a single performance testing parameter is adjusted and the system test is performed again, thereby accurately finding out the performances of the module to be tested under different execution environments.
The present invention will become more fully understood from the detailed description given herein below for illustration only, which thus is not limitative of the present invention, and wherein:
The objectives and implementing manners of the present invention are described below in detail through the preferred embodiments. However, the concept of the present invention can also be used in other scopes. The following exemplified embodiments are only intended to describe the objectives and implementing manners of the present invention, but not restrict the scope of the present invention.
Firstly, a performance testing parameter of a subsystem performance-based generator is initialized (Step S110). Next, according to the performance testing parameter, the subsystem performance-based generator simulates the memory occupying space, CPU occupation rate, and I/O performance of the module to be tested (Step S120). Then, the tests on the memory, CPU, and I/O performance are performed on the Linux system through a performance testing tool (Step S130). Then, the subsystem performance-based generator modifies the performance testing parameter according to test results of the performance tests (Step S140). Finally, according to the modified testing parameter setting, the performance test is performed again and the test results are recorded through the performance testing tool (Step S150).
The step of initializing the subsystem further includes setting the performance testing parameter and a subscriber demand parameter through a human-machine interface. The performance testing parameter and the subscriber demand parameter include three variables (performance parameters), namely, memory occupying space, CPU occupation rate, and I/O performance. In addition, the I/O performance is the number or size of data packets sent by the module to be tested of the Linux system in a unit of time. The CPU occupation rate equation is:
CPU Occupation Rate=Total Time of Specific Process/Total Time of all the Processes.
The steps of the performance tests on three performance parameters performed through the subsystem performance-based generator of the present invention are described below.