This is what I have previously served as the project manager, and the work instructions on unit tests are prepared, and the unit testing and environmental configuration is made for a variety of development environment narratives. Now it is sorted out. It should be helpful to everyone.
This is the first part, mainly for C and C items (including Windows Environment and Linux Environments), and the lower part will be for Java and J2EE projects.
1. Purpose
In order to reduce the number of errors in the code, reduce the time and energy of debugging, improve software quality, reduce development and maintenance time and cost.
2. Scope of application
Suitable for all products of C and C .
3. Applicable content
3.1 C standard
3.1.1 Test Environment Use Visual C , Windows Window Applications
3.1.1.1 For the Former Project: After using the CPPUnit1.6.2, after decompression, the path is x: //cppunit-1.6.2;
Configuring a test framework in an engineering document: Add to the path of the executive header x: //cppunit-1.6.2/include, add the path of the import library file x: //cppunit-1.6.2/lib;
Configure the Debug (Test) version environment:
Join the static test box module Testrunnercd.lib (Select dialog box for running test case) and cppunitcd.lib (test framework);
Add Test Add-Ins, the library is x: //cppunit-1.6.2/lib/testrunnerdsplugind.dll;
Enable RTTI in Project Settings / C / C Language;
3.1.1.2 Establish test cases:
1. Take the Test "name test unit file name, such as the" CMAbstring "class name, such as the" cmabstring "class, named MabString.cpp, the test unit file is named TestMabString.cpp;
2, join the test frame header file and the unit header to test, take TestMabString as an example:
Header file: TestmabString.h
#ifndef cpp_unit_testnode_h # define cpp_unit_testnode_h // Contains the header file #include