Abstract:In order to solve the problem that the automatic unit test tool often occurs memory overflow failure and takes a long time when testing large-scale C++ projects, the cache optimization technology is introduced in the test process, and a cache optimization method for different testing methods is proposed. When the user directly tests the entire project, the system will adopt the cache prefetch method. Through the designed cache prefetch model, it will provide data blocks for the cache before read misses; When the user tests a single file, the system will use the improved GDSF replacement algorithm for cache replacement. Experiments show that this method can effectively avoid memory overflow failures of such unit test tools and reduce the test time. The scale of the tested project supported by it has increased from about 5,000 lines to more than 100,000 lines, which greatly improves the performance of the system.