网站大量收购独家精品文档,联系QQ:2885784924

New 9第五章--结构化实现(2)(1).ppt

  1. 1、本文档共35页,可阅读全部内容。
  2. 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
4、流图 将程序流程图转化为程序图(Control Flow Graph) 4.设计基本集合中每条路径的测试用例 将步骤4中的各测试用例具体化。 路径 测试用例 期望结果 路径2 value[1]= -999 minimum=12 maximum=555 average= -999 total.input=0 total.valid=0 路径6 value[1]= 100, value[2]=11 value[3]= 300, value[4]= -999 minimum=12 maximum=555 average= 200 total.input=3 total.valid=2 …… …… …… 在测试过程中,执行每个测试用例并把实际输出结果与预期结果相比较 某些独立路径不能以独立的方式测试,也就是说,程序的正常流程不能形成独立执行该路径所需要的数据组合。 在这种情况下,这些路径必须作为另一个路径的一部分来测试 5.4.4 循环测试 循环测试是一种白盒测试技术,它专注于测试循环结构的有效性 三种循环,分别是简单循环、串接循环和嵌套循环 1.简单循环 ·跳过循环。 ·只通过循环一次。 ·通过循环两次。 ·通过循环m次,其中m<n-1。 ·通过循环n-l,n,n+1次。 3.串接循环 各个循环彼此独立,使用前述的测试简单循环的方法来测试串接循环。当循环不独立时,使用测试嵌套循环的方法来测试串接循环。 2.嵌套循环 ·最内层循环开始,其他设为最小值。 ·对最内层循环使用简单循环法,外层迭代参数取最小值,并为越界值或非法值增加一些额外的测试。 ·由内向外,对下一个循环进行测试,保持所有其他外层循环为最小值,其他嵌套循环为“典型”值。 ·继续进行下去,直到测试完所有循环。 巩固加深answer A:(4) B:(1) C:(4) D:(5) E:(8) 第五章 结构化实现 yangbin@mail.hbut.edu.cn 5.1 编码 所谓编码就是把软件设计翻译成计算机可以理解的形式——用某种程序设计语言书写的程序。 所选用的程序设计语言的特点和编码风格也会对程序的可靠性、可读性、可测试性和可维护性产生深远的影响。 自习P87-90 编码规范 5.2 软件测 试 (Testing)基础 防不胜防的软件错误 —— 例1:1963年, 美国, 飞往火星的火箭爆炸, 损失$ 10 million. 原因: FORTRAN循环 DO 5 I = 1, 3 误写为 DO 5 I = 1.3 例2:1996年,美国 Washington Post 报导 Dallas, Aug. 23 — The captain of an American Airlines jet that crashed in Colombia last December entered an incorrect one-letter computer command that sent the plane into a mountain, the airline said today. 编码规范 The crash killed all but four of the 163 people aboard. American’s investigators concluded that the captain of the Boeing 757 apparently thought he had entered the coordinates for the intended destination, Cali. But on most South American aeronautical charts, the one-letter code for Cali is the same as the one for Bogota, 132 miles in the opposite direction. The coordinates for Bogota directed the plane toward the mountain, according to a letter by Cecil Ewell, American’s chief pilot and vice president for flight. The codes for Bogota and Cali are different in most computer databases, Ew

文档评论(0)

好文精选 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档