当前位置:网站首页>测试用例设计方法之等价类划分方法
测试用例设计方法之等价类划分方法
2022-06-29 12:44:00 【51CTO】
一.方法简介
划分等价类: 1)有效等价类 2)无效等价类
划分等价类的标准:
1)完备测试、避免冗余;
2)划分等价类重要的是:集合的划分,划分为互不相交的一组子集,而子集的并是整个集合;
3)并是整个集合:完备性;
4)子集互不相交:保证一种形式的无冗余性;
5)同一类中标识(选择)一个测试用例,同一等价类中,往往处理相同,相同处理映射到"相同的执行路径"。

划分等价类的方法
1)在输入条件规定了取值范围或值的个数的情况下,则可以确立一个有效等价类和两个无效等价类。
2)在输入条件规定了输入值的集合或者规定了"必须如何"的条件的情况下,可确立一个有效等价类和一个无效等价类;
3)在输入条件是一个布尔量的情况下,可确定一个有效等价类和一个无效等价类。
4)在规定了输入数据的一组值(假定n个),并且程序要对每一个输入值分别处理的情况下,可确立n个有效等价类和一个无效等价类。
例:输入条件说明学历可为:专科、本科、硕士、博士四种之一,则分别取这四种这四个值作为四个有效等价类,另外把四种学历之外的任何学历作为无效等价类。
5)在规定了输入数据必须遵守的规则的情况下,可确立一个有效等价类(符合规则)和若干个无效等价类(从不同角度违反规则);
设计测试用例
在确立了等价类后,可建立等价类表,列出所有划分出的等价类输入条件:有效等价类、无效等价类,然后从划分出的等价类中按以下三个原则设计测试用例:
1)为每一个等价类规定一个唯一的编号;
2)设计一个新的测试用例,使其尽可能多地覆盖尚未被覆盖地有效等价类,重复这一步,直到所有的有效等价类都被覆盖为止;
3)设计一个新的测试用例,使其仅覆盖一个尚未被覆盖的无效等价类,重复这一步,直到所有的无效等价类都被覆盖为止。
如需了解更多测试技术信息请关注:深圳多测师软件与技术服务有限公司
边栏推荐
- Win32 Tetris (essential for learning MFC)
- What if the excel table exported from the repair record is too large?
- Appkey when applying for offline packaging of uniapp
- Cisco simulator simple campus network design, final assignment difficulty
- 【系统设计】邻近服务
- 想做个答题类的微信小游戏?读这篇文章就够了
- Hash hash game system development explanation technology -- hash game system development solution analysis
- LeCun用62页论文公布未来十年研究计划:AI自主智能
- grep 精确匹配
- Solution to inconsistency between RTC time and world time on the server
猜你喜欢

Imile uses Zadig's multi cloud environment to deploy thousands of times a week to continuously deliver global business across clouds and regions

别再重复造轮子了,推荐使用 Google Guava 开源工具类库,真心强大!

在线文本过滤小于指定长度工具

Autonomous and controllable city! Release of the first domestic artiq architecture quantum computing measurement and control system

Lecun published a research plan for the next decade: AI autonomous intelligence with a 62 page paper

Korean AI team plagiarizes the shock academic world! One tutor with 51 students, or plagiarism recidivist

高校女生穿旗袍答辩!网友:导师说论文要是和旗袍一样漂亮就好了

Koa2+better-sqlite3 to add, delete, change and query

记一次 .NET 某物管后台服务 卡死分析

Leetcode game 299
随机推荐
【云驻共创】通过Rust语言计算加速技术突破图片识别性能瓶颈
Review questions of project management
grep 精确匹配
Huawei machine learning service speech recognition function enables applications to paint "sound" and color
Game development of contract quantitative trading system (ready-made case analysis)
Windbg调试工具介绍
Return value‘s Lifetime
How to install MySQL 8.0 on rocky Linux and almalinux
Introduction to esp8266: three programming methods "suggestions collection"
Ordinary users use vscode to log in to SSH and edit the root file
Getting started with mybaits (including example tutorial and source code)
Gee - American landfire fire fire data set
极光 · 哈夫曼树の生成(线段树结构 非指针)(仿邻接表)
思科模拟器简单校园网设计,期末作业难度
Autonomous and controllable city! Release of the first domestic artiq architecture quantum computing measurement and control system
C language character function
C language memory function
MySQL intercepts the string to remove duplication, and MySQL intercepts the string to remove reassembly
Pod security policy (PSP)
urllib urllib2