Font Size: a A A

Research And Design Of Automatic Unit Test Framework For Object-oriented Program

Posted on:2021-08-11Degree:MasterType:Thesis
Country:ChinaCandidate:L Y RenFull Text:PDF
GTID:2518306308469474Subject:Computer technology
Abstract/Summary:PDF Full Text Request
Unit test is to test the basic components of software(such as modules,processes,functions or classes),which plays an important role in the process of ensuring software quality.Object oriented language is a kind of programming language which takes object as basic program structure unit.Unit testing involving complex logical structure in object-oriented program is very difficult,and it is a hot topic in unit testing research.The automation unit test framework of object-oriented program can improve the unit test efficiency of object-oriented program,reduce the heavy unit test task of testers,and effectively reduce the cost of object-oriented software development.There is a great technical difficulty in the research of object-oriented program automation unit testing framework.At present,there are few such unit testing frameworks in China,and most of them are secondary designs based on mature testing frameworks abroad.This paper investigates the design of foreign mature automation unit testing framework for object-oriented programs,and the design of traditional automation unit testing framework for process programs,and summarizes the design principles and prototype design of automation unit testing framework for object-oriented programs.On this basis,two studies are made:1.This paper studies the unit testing problem of object-oriented program,and analyzes the functional and performance requirements of the automatic unit testing framework of object-oriented program.In the aspect of function,the unit test problems introduced by the common features of object-oriented language,such as permission access,class attribute,function overload,are studied.In the aspect of performance,the common memory performance problems of multi program test and the platform adaptability of the actual execution environment are studied.Due to the richness of object-oriented language,this paper chooses C++as a popular object-oriented language,as the starting point of studying object-oriented language.2.Based on the prototype design and the above requirements,this paper designs an object-oriented program automatic unit test framework(ctscpp),which is used to test C++program automatically.In terms of function,the test framework can automatically preprocess,statically analyze,build test environment for C++programs,automatically generate test cases,and dynamically execute to obtain coverage information.In terms of performance,we use the form of front-end and back-end separation,using serialization technology,exchanging hard disk resources for memory resources to prevent memory overflow during the execution of the test framework;and we use adapter mode to design adapter module for preprocessing,dynamic execution and other operations,which enriches the expansibility of the test framework.The author has achieved the above-mentioned automatic unit testing framework of object-oriented program in the actual project,and verified it by the actual program.The results show that the framework of automatic unit test for object-oriented program researched and designed in this paper is feasible.It can realize automatic program analysis,unit extraction,coverage test and other functions for object-oriented programs.
Keywords/Search Tags:unit test, object oriented program, automatic test, test framework
PDF Full Text Request
Related items