等效类测试与边界值测试

编程入门 行业动态 更新时间:2024-10-20 15:46:55
本文介绍了等效类测试与边界值测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我了解等效测试的工作原理.

I understand how equivalence testing works.

它与边界值测试有何相同或不同?

How is it the same or different from boundary value testing?

推荐答案

等效类测试 EC测试是指您有多个要测试的测试项目(例如值),但是由于成本(时间/金钱)而您没有时间测试所有这些项目.因此,您将测试项目分组到类中,其中每个类中的所有项目都假定行为完全相同.从理论上讲,您只需测试每个项目之一即可确保系统正常运行. 示例1 2岁以下的儿童免费乘坐巴士.年轻人支付10美元,成人支付15美元,老年人支付5美元. 班级: 价格:0->年龄:0-1 价格:10->年龄:2-14 价格:15->年龄:15-64 价格:5->年龄:65-无穷大

Equivalence Class Testing EC Testing is when you have a number of test items (e.g. values) that you want to test but because of cost (time/money) you do not have time to test them all. Therefore you group the test item into class where all items in each class are suppose to behave exactly the same. The theory is that you only need to test one of each item to make sure the system works. Example 1 Children under 2 ride the bus for free. Young people pay $10, Adults $15 and Senior Citizen pay $5. Classes: Price:0 -> Age:0-1 Price:10 -> Age:2-14 Price:15 -> Age:15-64 Price:5 -> Age:65-infinity

示例2(多个参数) 手机K80,J64和J54运行Java5.K90和J99运行Java6.但是有两种可能的浏览器是FireFox和Opera,J模型运行FF,K模型运行O. 班级: 浏览器:FF,Java:5->电话:J64,J54 浏览器:FF,Java:6->电话:J99 浏览器:O,Java:5->电话:K80 浏览器:O,Java:6->电话:K90

Example 2 (more than one parameter) Cellphones K80, J64 and J54 run Java 5. K90 and J99 run Java 6. But there are two possible browsers FireFox and Opera, J models run FF and K models run O. Classes: Browser:FF, Java:5 -> Phones:J64,J54 Browser:FF, Java:6 -> Phones:J99 Browser:O, Java:5 -> Phones:K80 Browser:O, Java:6 -> Phones:K90

等效类测试的危险 使用EC测试的危险在测试书中很少提及,但要记住非常重要. 仅仅因为两个项目/值假定在同一类中并且表现相同,并不意味着它们确实表现相同. 这意味着仅仅因为您在类中测试一个值,该类中的所有值都表现相同.我的现实世界的例子是拥有特定Java平台的手机.他们假定所有工作都相同,但实际上并非如此.因此,仅在一个类中测试一个值是好的,但还不够好. EC测试是一个很好的工具,但并不是万无一失,请谨慎使用.如果测试用例既便宜又快速(例如自动化),则可以进行更多测试,或者为什么不对它们全部进行测试!

Dangers Of Equivalence Class Testing There is a danger of using EC Testing that is rarely mentioned in the testing books but is very important to remember. Just because two items/values are suppose to be in the same class and behave the same, does not mean they DO behave the same. That means that just because you test one value in the class that ALL values in the class behave the same. Real world example of mine is with cell phones that all had a certain Java Platform. They were suppose to all work the same but they didn't in reality. So testing just one value in a class is good, but not good enough. EC Testing is a good tool, but it's not fool proof and be careful with it. If test cases are cheap and fast (like automation), test more, or why not test them all!

边值测试 BV测试是您决定测试已识别的每个类边缘的值时.从理论上讲,大多数缺陷都在类的边缘. 示例 班级: 价格:0->年龄:0-1(边界值0、1) 价格:10->年龄:2-14(边界值2、14) 价格:15->年龄:15-64(边界值15,64) 价格:5->年龄:65-无穷大(边界值65)

Boundary Value Testing BV Testing is when you decide to test the values on the edge of each Class you have identified. The theory is that most defects is around the edges of a class. Example Classes: Price:0 -> Age:0-1 ( Boundary values 0, 1) Price:10 -> Age:2-14 ( Boundary values 2, 14) Price:15 -> Age:15-64 ( Boundary values 15, 64) Price:5 -> Age:65-infinity ( Boundary values 65)

边界值测试评论 1)我和我参加过课程的其他测试专业人​​员都不相信大多数缺陷都隐藏在每个班级的边缘.而且我从未见过任何研究可以证明是这种情况. 2)您需要使用BV测试这一事实证明EC测试存在缺陷,因为您测试了每个类别的多个值. 3)使用整数等值时很容易使用.但是,手机型号或浏览器版本类别的边界值是什么?

Critique of Boundary Value Testing 1) I, and other test professionals I have taken courses from, are not convinced that most defects are hidden around the edges of each class. And I have never seen any studies that proves this to be the case. 2) The fact that you need to use BV Testing proves that EC Testing is flawed since you test more than one value of each class. 3) It's easy to use when using values like integers. But what is a boundary value of class of phones models or browsers versions?

隐藏边界值测试 类的边界值通常基于系统应如何工作的规范.一切都很好,但是大多数系统都包含任何规范中都没有说明的边界,您需要自己寻找.例如. 在系统出现故障并损坏之前,我可以在测试字段中放入多少个字符.",在如此缓慢的读取速度之前,数据文件会变得多大烦人". 现实世界中的例子 -在Win 7上将100万个字符粘贴到FireFox 3.5的文本区域中会使其崩溃 -ReCaptcha限制为16003个字符,如果有人在字段中输入了16004个以上的字符,则系统是否处理传递回它的413.还是坏了

Hidden Boundary Value Testing The boundary values of a class is often based on the specification of how the system should work. This is all good and well but most systems contain boundaries that are not explained in any spec and you will need to look for yourself. E.g. 'How many characters can I put into the test field before the system fails and breaks.','How big can the data file become before it so slow to read it gets annoying'. Real world examples - Pasting one million characters into a text area in FireFox 3.5 on win 7 crashes it - ReCaptcha has a limit of 16003 characters, does your system handle the 413 that it passes back to it if somebody puts 16004+ characters in field. Or does it break

摘要 EC测试和BV测试是很好的工具,您应该使用它们,但是它们并不是完美的,不要期望使用它们发现所有缺陷.使用您对系统的专业知识以及您的智慧和直觉来尝试更多的项目,并寻找可能导致失败的其他方式.并寻找隐藏的边界!

Summary EC Testing and BV Testing are great tools and you should use them but they are not perfect and don't expect to find all defects using them. Use your know-how about the system and your intelligence and intuition to try more items and looks for other ways it could fail. And look for the hidden boundaries!

更多推荐

等效类测试与边界值测试

本文发布于:2023-11-30 04:18:46,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1648696.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:测试   边界

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!