软件测试实验报告-使用Parasoft-C++-Test软件进行静态测试.doc_第1页
软件测试实验报告-使用Parasoft-C++-Test软件进行静态测试.doc_第2页
软件测试实验报告-使用Parasoft-C++-Test软件进行静态测试.doc_第3页
软件测试实验报告-使用Parasoft-C++-Test软件进行静态测试.doc_第4页
全文预览已结束

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

软件测试实验报告 学 号:学生姓名: 班 级: 实验6 使用Parasoft C+ Test软件进行静态测试学号 * 姓名 * 班级 * 时间 2*一实验题目在三角形问题中,要求输入三角型的三个边长:A、B 和C。当三边不可能构成三角形时提示错误,可构成三角形时计算三角形周长。若是等腰三角形打印“等腰三角形”,若是等边三角形,则打印“等边三角形”。使用Parasoft C+ Test软件对三角形问题进行静态测试(代码走查)。二实验内容1. 安装并运行Parasoft C+ Test软件,了解其基本特点和功能。2. 编写代码完成题目的功能要求,已有代码最好转成C+(或测试同学的代码),包含类的定义和使用。3. 使用C+ Test软件对程序源代码进行静态测试1,生成测试报表。静态测试1报表:Coding StandardsFile: tri.cppI=0 PV=0 V=12 PSV=3 SV=0 / total=1512 Violations (V) 1 An explicit logical comparison should be used in conditional expression (coding-24) 2 If, else, while and do statements shall be followed by a block, even if it is empty (coding-34) 6 Logical parts of a conditional expression shall be grouped with parenthesis even if not logically required (format-06) 2 Parenthesis shall be used with the return and sizeof statements (format-17) 1 There shall be a single ASCII space character following all commas (format-13) 3 Possible Severe Violations (PSV) 1 All condition statements shall use and to identify the body of code associated with the condition (coding-12) 1 Avoid use scanf and fscanf functions without describing size of variables in format (sec-16) 1 Avoid using data in file outside namespaces (sec-05) Coding Standards DetailsC:Documents and SettingsAdministrator桌面tri.cpp3: PSV Avoid using data in file outside namespacessec-055: PSV Condition statement if should use and to identify the body of code associated with the condition.coding-125: V If, else, while and do statements shall be followed by a block, even if it is empty. In function IsTriangle.coding-345: V Logical parts of a conditional expression should be grouped with parenthesisformat-065: V Logical parts of a conditional expression should be grouped with parenthesisformat-066: V return statement should be used with parenthesisformat-178: V return statement should be used with parenthesisformat-1714: PSV After % on position number: 1 sholud be number describing size of variablesec-1614: V No single ASCII space character following commaformat-1316: V Logical tests should be explicit in condition expressioncoding-2419: V Logical parts of a conditional expression should be grouped with parenthesisformat-0619: V Logical parts of a conditional expression should be grouped with parenthesisformat-0623: V Logical parts of a conditional expression should be grouped with parenthesisformat-0623: V Logical parts of a conditional expression should be grouped with parenthesisformat-0633: V If, else, while and do statements shall be followed by a block, even if it is empty. In function main.coding-344. 针对静态测试结果,对源程序进行修改,修改完成后再次进行静态测试2,根据结果检查之前的问题解决情况。静态测试2报表:5. 实验报告:贴出静态测试1的测试报表,逐条对测试结果进行解释和分析。然后贴出修改后的静态测试2的测试报表。主要涉及到的问题:1.“”、“”占据一行;2if、while等关键字后有空格;3.“=”、“+”等双目操作符前后各有一个空格;修改后的代码:#include stdio.hvoid Judge(int A,int B,int C);void main()int A = 0, B = 0, C = 0;scanf(%ld %ld %ld, &A, &B, &C);Judge(A, B, C);void Judge(int A,int B,int C)/注意:该函数内不能有scanf()语句,否则会无法测试/if (scanf(%ld %ld %ld, &A, &B, &C) != EOF)if (A + B) C) & (A + C) B) & (B + C) A)printf(Girth is : %d , A + B + C);if (A =

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论