c++test

上传人:小** 文档编号:54898070 上传时间:2018-09-21 格式:PPT 页数:30 大小:871.50KB
返回 下载 相关 举报
c++test_第1页
第1页 / 共30页
c++test_第2页
第2页 / 共30页
c++test_第3页
第3页 / 共30页
c++test_第4页
第4页 / 共30页
c++test_第5页
第5页 / 共30页
点击查看更多>>
资源描述

《c++test》由会员分享,可在线阅读,更多相关《c++test(30页珍藏版)》请在金锄头文库上搜索。

1、C Test Install Manual,目录,C+ Test的简介 3 C+ Test的安装说明 8 10种简单bug的摘出 11 C+ Test的使用 21 关于Bounds Checker 27,一、C+ Test的简介,包括下面的内容: 使用C+ Test的优点; 支持的平台; 提供的IDE插件; 宿主编译器。,1.使用C+ Test的优点,提高团队的开发效率 应用最全面的最佳实践集合以缩减测试时间,降低测试难度,减少QA阶段遇到的问题。在现有的开发资源下完成更多的任务 自动解决琐碎的编码问题从而更多的时间可被分配到需要人来解决的问题上。可靠的构件代码 高效的构造,可持续执行和全面的

2、回归测试套件以检测版本更新是否破坏既有功能。提供C/C+代码质量完成状态的可视化报告 按需访问目标代码的评估,并跟踪其过程以提高质量和完成预期目标。削减支持成本 自动对广泛的潜在用户路径进行负面测试以查找出只有在真正使用时才会出现的问题。,2.支持的平台,Windows 2000/2003/XP Linux。 Solaris。,3.提供的IDE插件,Eclipse 3.1, 3.2(32-bit),3.3(33-bit) Visual Studio .NET 2003 and 2005 Wind River Workbench 2.6(for embedded development) ARM

3、 RVDS 3.x(for embedded development),4. 宿主编译器,Windows:Microsoft Visual C+ 6.0,.NET,.NET2003,.NET2005. Linux。 Solaris。,二、C+ Test的安装说明,安装源程序:cpptest_win32_6.7.13.0.exe 操作系统:Win XP日文版打开安装源程序,同普通的windows应用程序一样,选择安装路径,完成安装。注:在安装过程中确保VS.NET已经关闭掉。,1. 打开安装源程序,同普通的windows应用程序一样,选择安装路径,完成安装,三、10种简单bug的摘出,在安装完成

4、C+ test后我们需要进行一些设置,首先要添加10种简单bug。,1、 10種類簡単撲滅方法,2、 10種類簡単撲滅方法,3、 10種類簡単撲滅方法,Coding Rule(Initialization) -Do not initialize unsigned integer variables with signed constants. (ImplicitUnsignedInit.rule) -Initialize all pointer variables. (InitPointerVar.rule) -Initialize all variables. (InitializeVari

5、ables.rule) Coding Rule(Ellemtel) -All automatic variables shall have been assigned a value before being used (ellemtel_rule-40_VariablesValueBeforeUsed.rule) -Always assign a new value to a pointer that points to deallocated memory (ellemtel_rec-59_AssignValueToDeletedPointers.rule) -Initialize all

6、 variables. (ellemtel_rule-41_1_VariableInitializedBeforeUsed.rule),4、 10種類簡単撲滅方法,Coding Rule(Ellemtel) -Default branch in switch statement (ellemtel_rule-48_SwitchDefaultBranch.rule) Coding Rule(Coding Conventions) -“#define“ or enum constants should be used instead of hard coded values whenever po

7、ssible (HardCodeValue.rule) Coding Rule(Ellemtel) -Do not use magic numbers (ellemtel_rule-37_AvoidNumericValues.rule) Coding Rule(Ellemtel) -Be careful not to make type conversions from a “shorter“ type to a “longer“ one (ellemtel_port_rec-06_1_ShorterTypeToLongerConversion.rule) -Use explicit type

8、 conversions for arithmetic using signed and unsigned values (ellemtel_port_rec-08_SignedUnsignedValuesArithmetic.rule),5、 10種類簡単撲滅方法,Coding Rule(Possible Bugs) -Do not assign incompatible variable types (DiffTypeAssign.rule) -Do not cast an signed char to an unsigned int. (CastUnsigned.rule) -Do no

9、t cast pointers to non-pointers (CastPointer.rule) -Do not compare chars to constants out of char range (CharCompareRight.rule) -Do not compare chars to constants out of char range (CharCompareLeft.rule) Coding Rule(Misra*) -Provisions should be made for appropriate run-time checking (ArrayIndexOutO

10、fBounds_MISRA_004.rule) Coding Rule(Possible Bugs) -Avoid assignment in if statement condition (IfAssign.rule),6、 10種類簡単撲滅方法,Coding Rule(Initialization) -The pointer shall not be dereferenced without checking against NULL value (DereferencedPointerTypeExpression2.rule) Coding Rule(Misra2004) -If a f

11、unction returns error information, then that error information shall be tested (misra2004_16_10_UsageOfFunctionReturnValue.rule),7、Coding Rule導入,CodingRule(*.tcfg)入手、下記場所格納。 C+Test再起動 TestTestConfigurationUser入手CodingRule選択可,8、CodingRuleCustomize,Informational (I) Possible Violation (PV) Violation (

12、V) Possible Severe Violation (PSV) Severe Violation (SV),9、CodingRule結果,実行,四、C+ Test的使用,C+ Test在安装完成后会自动我们的VS.NET中生成IDE插件,我们通过IDE插件上的个快捷键便可以对我们现在代码进行测试。,1、 C+ Test的使用,2、 C+ Test的使用,当点击分析以后会弹出以下界面:,3、C+ Test的运行界面,4、C+ Test的运行结果,当运行结束后这里会显示总共的测试数和出现的错误总数。,5、C+ Test的运行结果,这里会显示具体的每一个错误的代码行数和错误原因。,五、关于Bounds Checker,我们在用Bounds Checker进行内存泄露测试时,总结了Bounds Checker的使用时遇到的问题。 1、要测试的全部Source的添加; 2、在编译程序时的注意事项。,1、要测试的全部Source的添加,2、要测试的全部Source的添加,3、在编译程序时的注意事项,致谢:,

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 商业/管理/HR > 经营企划

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号