当前位置:高等教育资讯网  >  中国高校课件下载中心  >  大学文库  >  浏览文档

上海交通大学:《软件测试与质量控制》课程教学资源(课件讲稿)chapter 4 test case generation 1

资源类别:文库,文档格式:PDF,文档页数:30,文件大小:444.15KB,团购合买
1. 边界值测试 2. 路径测试与分支测试 3. 等价类划分
点击下载完整版文档(PDF)

上游充通大睾 SHANGHAI JIAO TONG UNIVERSITY 1896 1935 1987 ,2006 Chapter 4 Test case generation 1

¾1896 ¾1935 ¾1987 ¾2006 Chapter 4 Test case generation 1

1.边界值测试 2.路径测试与分支测试 3.等价类划分 >校长办公室 >Office of the President

¾校长办公室 ¾Office of the President 1. 边界值测试 2. 路径测试与分支测试 3. 等价类划分

© 1边界测试 边界值 对于函数: Y=f(x1,x2) 若 a≤x1≤b 有效输入区域 c≤x2≤d X2 d a b >校长办公室 >Office of the President

¾校长办公室 ¾Office of the President 1 边界测试 边界值 对于函数: Y = f(x1, x2 ) 若 a ≤ x1 ≤ b c ≤ x2 ≤d a b c d X1 X2 有效输入区域

图 边界值测试的取值:最小值、略高于最小值、正常值、 略低于最高值、最高值。 单缺陷假设:失效极少是由2个(或更多)缺陷同时发 生引起的。x a N个变量的测试用例数:4N+1! >校长办公室 >Office of the President

¾校长办公室 ¾Office of the President 边界值测试的取值: 最小值、略高于最小值、正常值、 略低于最高值、最高值。 单缺陷假设:失效极少是由2个(或更多)缺陷同时发 生引起的。 a b c d X1 X2 N个变量的测试用例数:4N+1!

健壮性测试 除了5个边界值,再增加一个略小于最小值(min- ),一个略大于最大值(max+)。 即:要考虑无效值的输入! 拒绝单缺陷假设,考虑全部 边界输入的组合,即各个变 量输入的笛卡儿积。 最坏情况测试:N个变量的 a b X 测试用例:5N。 健壮最坏情况测试:N个变 量的测试用例:7N >校长办公室 >Office of the President

¾校长办公室 ¾Office of the President 健壮性测试 a b c d X1 X2 除了5个边界值,再增加一个略小于最小值(min- ),一个略大于最大值(max+)。 即:要考虑无效值的输入! 拒绝单缺陷假设,考虑全部 边界输入的组合,即各个变 量输入的笛卡儿积。 最坏情况测试:N个变量的 测试用例:5N。 健壮最坏情况测试: N个变 量的测试用例: 7N

图 2路径测试与分支测试 a 国 分支覆盖: YES 1.abd A>1 and B==0 2. ace b NO X=X+A 路径覆盖: 1.abd YES A=-2 or X>1 2.abe e NO 3.acd X-X/A 4. d ace >校长办公室 >Office of the President

¾校长办公室 ¾Office of the President 2 路径测试与分支测试 分支覆盖: 1. abd 2. ace 路径覆盖: 1. abd 2. abe 3. acd 4. ace A>1 and B= =0 A==2 or X>1 a b d X=X+A X=X/A e NO YES c YES NO

③ 路径测试与分支测试 循环: 分支覆盖:2 路径覆盖:N+1 >校长办公室 >Office of the President

¾校长办公室 ¾Office of the President 路径测试与分支测试 循环: 分支覆盖:2 路径覆盖:N+1

⑧ 国DD路径 ⑧McCabe圈数V(G)计算方 A 法: V(G)=e-n+2p e:边数; n:节点数 p:连接区域数 G 对于右图:V(G)=10-7+2=5 >校长办公室 >Office of the President

¾校长办公室 ¾Office of the President DD路径 McCabe圈数V(G)计算方 法: V(G)=e-n+2p e:边数; n:节点数 p:连接区域数 对于右图: V(G)=10-7+2=5 B D E A C F G

上帝充通大¥ 旧96 SHANGHAI JIAO TONG UNIVERSITY ,1896 1935 1987 ,2006 3 Category-partition Method ·Key idea Method for creating test suites -Role of test engineer Analyze the system specification Write a series of formal test specifications -Automatic generator ●Produces test frames

¾1896 ¾1935 ¾1987 ¾2006 3 Category-partition Method • Key idea – Method for creating test suites – Role of test engineer • Analyze the system specification • Write a series of formal test specifications – Automatic generator • Produces test frames

图 Steps Decompose the functional specification into functional units -Characteristics of functional units They can be tested independently ·Examples -A top-level user command Or a function Decomposition may require several stages Similar to high-level decomposition done by software designers May be reused,although independent decomposition is recommended >校长办公室 >Office of the President

¾校长办公室 ¾Office of the President Steps • Decompose the functional specification into functional units – Characteristics of functional units • They can be tested independently • Examples – A top-level user command – Or a function • Decomposition may require several stages • Similar to high-level decomposition done by software designers – May be reused, although independent decomposition is recommended

点击下载完整版文档(PDF)VIP每日下载上限内不扣除下载券和下载次数;
按次数下载不扣除下载券;
24小时内重复下载只扣除一次;
顺序:VIP每日次数-->可用次数-->下载券;
共30页,试读已结束,阅读完整版请下载
相关文档

关于我们|帮助中心|下载说明|相关软件|意见反馈|联系我们

Copyright © 2008-现在 cucdc.com 高等教育资讯网 版权所有