The Study and Implementation of Unit Test System for C++ Programs
- Author
- LiYan
- Advisor
- WangXiBo
- School
- Shenyang University of Technology
- Major
- Applied Computer Technology
- Classification
- TP311.52 Software Development
- Degree
- Master's thesis
- Year
- 2007
- Downloads
- 309
- Citations
- 1
Abstract
With the rapid development of computer technology, computer software is applied in every aspect of national economy and social life increasingly. Quality of software has become the focus to which is paid attention by those people who use or develop software. As the software is man-made, it is unavoidable that errors exist in software. Testing is the important way to ensure software quality. The purpose of software test is to find errors in the programs as early and more as possible so as to improve the quality of software. Unit test is to test the least units of software and to find if these least units are right. Unit test is the foundation of other level test, thus it must be tested after code are finished. The article puts forward a scheme of unit test system for C++ program and realizes it.Firstly, this article studies present situation and development tendency and introduces the basic theories of software test. Secondly, the article puts forward four steps to realize the unit test system. From them, the article designs a scheme to realize the unit test system for C++ program and establishes the system model. Thirdly, the article realizes unit test system by analyzing a C++ program in static and dynamic respects. Lastly, the article reports the unit test results.In static respect, the article realizes the test process from lexical and syntax analysis through C++ lexical and syntax rules. In static test respect, in consideration that the key of dynamic test is to design test cases, the article uses multiple different methods to construct test cases in order to produce better effect from fewer test cases. For example, equal-dividing method both assures complete test and reduces redundant test cases. Boundary-analyzing method is used to find boundary errors. Perpendicular experiment method is used to optimize test cases. The method of basic path test is used to ensure every basic path has been tested in order to reach sentence and path cover standard. Furthermore the article analyses emphatically object-oriented automatic test frame which is called Cppunit whose compilation regulation and realization mechanism, making use of this frame to run program and gaining unit test report. At last, the article carries on test for C++ program which is called Getting Next Date. The whole process and experiment result proves that unit test system is feasible and effective.
Table of contents
Abstract 5-6
Abstract 6-10
1 Introduction 10-13
1.1 Background topics 10-11
1.2 topics to be covered
1.3 topics sense 11-13
2 Research and development trend 13-16
2.1 the research status and development trend 13-14
2.2 software testing tools 14-16
the basis of the theory of software testing 16-28
3.1 software testing and classification 16-18
3.2 object-oriented software unit testing 18-19
3.3 of object-oriented software testing 19-22
3.4 automated test 22-23
3.5 Orthogonal Test 23-28
4 C unit test system design 28-32
4.1 unit testing of concrete steps 28-29
4.2 C unit test program 29-32
5 C unit test system implementation 32-67
5.1 for C programs for static testing 32-44
5.1.1 static object-oriented testing strategy 33-35
5.1.2 lexical analysis and parsing 35-41
5.1.3 expansion static test 41-42
5.1.4 save test results 42-44
5.2 design test cases 44-59
5.2.1 Equivalence Class Partitioning Method design test cases 46-49
5.2.2 boundary value method to design test cases 49-51
5.2.3 orthogonal experiment method to design test cases 51-55
5.2.4 Basic path testing 55-59
5.3 execute test 59-65
5.3.1 Cppunit integration in Visual C 6.0 60
5.3.2 to write test code 60-65
5.4 unit test reports 65-66
5.5 summarizes 66-67
6 Conclusion 67-68
the
References 68-71
Appendix A commonly used orthogonal table 71-73
Appendix B part of the program code 73-76
B.1 lexical analysis program header file 73-75
the
B.2 lexical analysis of the main program 75-76
learn research 76-77
Acknowledgements 77
Related dissertations
- Research and Implementation of Automatic Stub Generation Technology in Unit Test
- The Analysis and Design of Government Auto Office System Based SSH Framework
- Automated Test Case Generation System and Implementation
- Research of Software Unit Test
- Design and Implemention for Large Database Application Test
- Unit testing and continuous integration in enterprise software development Design and Implementation
- The Research of Schedule Management in TV-financial Application Project of Shanghai Orientpay
- Development of Wet Gas Flow Measurement System
- Design and Implementation of Hubei Extreme Meteorological Events Monitor System
- The Design and Implementation of Shenyang Unicom Office Automation System Based on Web
- The Network System of Measurement and Testing Equipment Management Information
- The Design and Implementation of Flight Information Query Systems
- Research and design of on-board control universal testing platform software
- Design and Implementation of Automatic Audit System for Telecommunication Business in ZiBo
- The Design and Implementation of Grain Trading Management Information System
- Software Engineering Professional Core Courses Online Learning Platform Design and Implementation
- Design and Implementation of Automated Test Case Generator
- Analysis and design of enterprise network shopping system
- Workshop Assembly Line Material Distribution Automation Software Platform Design and Implementation
- Based on the Struts2Employment System Development of IT Industry in Jiangsu Province