软件测试实验报告-使用Parasoft-C++-Test软件进行静态测试.doc

上传人:叶*** 文档编号:35244206 上传时间:2022-08-20 格式:DOC 页数:3 大小:51.50KB
返回 下载 相关 举报
软件测试实验报告-使用Parasoft-C++-Test软件进行静态测试.doc_第1页
第1页 / 共3页
软件测试实验报告-使用Parasoft-C++-Test软件进行静态测试.doc_第2页
第2页 / 共3页
点击查看更多>>
资源描述

《软件测试实验报告-使用Parasoft-C++-Test软件进行静态测试.doc》由会员分享,可在线阅读,更多相关《软件测试实验报告-使用Parasoft-C++-Test软件进行静态测试.doc(3页珍藏版)》请在得力文库 - 分享文档赚钱的网站上搜索。

1、软件测试实验报告学 号:学生姓名: 班 级: 实验6 使用Parasoft C+ Test软件进行静态测试学号 * 姓名 * 班级 * 时间 2*一实验题目在三角形问题中,要求输入三角型的三个边长:A、B 和C。当三边不可能构成三角形时提示错误,可构成三角形时计算三角形周长。若是等腰三角形打印“等腰三角形”,若是等边三角形,则打印“等边三角形”。使用Parasoft C+ Test软件对三角形问题进行静态测试(代码走查)。二实验内容1. 安装并运行Parasoft C+ Test软件,了解其基本特点和功能。2. 编写代码完成题目的功能要求,已有代码最好转成C+(或测试同学的代码),包含类的定义

2、和使用。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

3、 (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 Possi

4、ble 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 namespaces (sec-05) Coding Standards Detail

5、sC:Documents and SettingsAdministrator桌面tri.cpp3: PSV Avoid using data in 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 func

6、tion 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 u

7、sed 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 sh

8、ould 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 parent

9、hesisformat-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.“=”、“+”等双目操作符

10、前后各有一个空格;修改后的代码:#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 = B) & (A = C)printf(Equilateral_Trianglen);else if (A = B) | (B = C) | (A = C)printf(Isosceles_Trianglen);elseprintf(General_Trianglen);elseprintf(No_Trianglen);

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

当前位置:首页 > 教育专区 > 高中资料

本站为文档C TO C交易模式,本站只提供存储空间、用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。本站仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知得利文库网,我们立即给予删除!客服QQ:136780468 微信:18945177775 电话:18904686070

工信部备案号:黑ICP备15003705号-8 |  经营许可证:黑B2-20190332号 |   黑公网安备:91230400333293403D

© 2020-2023 www.deliwenku.com 得利文库. All Rights Reserved 黑龙江转换宝科技有限公司 

黑龙江省互联网违法和不良信息举报
举报电话:0468-3380021 邮箱:hgswwxb@163.com