黑盒测试技术(边界值分析法)——软件质量保证与测试



前言

一、边界值分析是什么?

  • 边界值分析方法是对等价类划分方法的补充。输入输出的等价类边界就是应当着重测试的边界情况。
    +使用输入变量的最小值(min),略高于最小值(min+),名义值(nom),略低于最大值(max-),以及最大值(max)
  • 在这里插入图片描述
  • 边界值分析是基于单缺陷假设single fault的。
  • 边值分析的简单推广,即考虑健壮性设计,超出有效范围的值略大于最大值(max+)和略小于最小值(min-)的值
    在这里插入图片描述

二、例题

例题一

假设GradeRecord函数能够根据输入的单科成绩,把低于60分的成绩登记为‘不及格’,大于等于60分按照实际成绩登记。试用边界值分析法为其设计测试用例。
答案:

在这里插入图片描述

例题二

在这里插入图片描述
答案

在这里插入图片描述

例题三

在这里插入图片描述答案

在这里插入图片描述

例题四

Consider a method fp, brief for findPrice, that takes two inputs code and qty. The item code is represented by the integer code and the quantity purchased by another integer variable qty. fp accesses a database to find and display the unit price, the description, and the total price of the item corresponding to code. fp is required to display an error message, and return, if either of the two inputs is incorrect. Assuming that an item code must be in the range 99…999 and quantity in the range 1…100.
Please give your test cases using boundary-value analysis.
答案

在这里插入图片描述

总结

  • 等价类测试的弱形式(单缺陷测试)不如强形式(多缺陷)测试全面。
  • 无效值会引起运行错误的时候(实现语言是强类型),则没有必要做健壮形式的测试。
  • 错误条件很重要的时候,健壮测试很重要。
  • 边界值测试是等价类测试的一种补充,两者结合可以加强测试效果。
  • 决策表技术可以解决变量之间依赖的问题。
  • 要进行多次尝试,确认最合适的等价类划分。
  • 1
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值