最近在做单元测试的工作,以前还没有真正接触测试工作,对测试的一些基本概念都不知道,哎,真是惭愧。
1. 静态代码检测
测试之前最好做一些静态代码的分析,Linux下选用的工具是cppcheck(编译源码后既有命令行工具又有GUI工具,不错)。相关代码和doc都可以在下面网址找到:
http://sourceforge.net/apps/mediawiki/cppcheck/index.php?title=Main_Page
2. Unit Test
Google一下,发现Unit Test工具还真是不少:CPPUnit(来自JUnit)——〉CXXTest,UnitTest++,GTest等。目前正在看GTest和GMock代码。。。
先记下几个好的文章:
CPPUnit:http://morningspace.51.net/resource/cppunit/cppunit_anno.html
http://www.ibm.com/developerworks/cn/linux/l-cppunit/
CXXTest:http://cxxtest.tigris.org/
UnitTest++:http://sinojelly.blog.51cto.com/479153/200792
GTest系列:http://www.cnblogs.com/coderzh/archive/2009/04/06/1426755.html
http://code.google.com/p/googletest/wiki/Documentation
GMock:http://blog.csdn.net/learnhard/article/details/5757461
研究透后再写写对GTest和GMock的总结