又称为功能测试function testing、行为测试behavior testing
黑盒测试测试不知道代码细节的软件
Black box testing test software without knowing how it is coded.
测试目的:判断输入和输出是否符合软件要求
黑盒测试的特点:
- 程序被视为一个黑盒。Program is treated as a black box.
- 实现细节并不重要。Implementation details do not matter.
- 需要一个最终用户的视角。Requires an end-user perspective.
- 测试计划可以在规格说明完成后尽早开始。Test planning can begin early as soon as the specification has been finished.
优势advantage:
1. 不需要知道代码细节
2. 相互独立
3. 可以在说明书完成后就设计测试用例,不用等代码完成
缺陷disadvantages:
1. 有冗余
2. 没有说明书
3. 输出不现实
4. 很难发现错误的位置
静态黑盒测试(测试说明书)testing the spec
测试说明书是静态黑盒测试。testing the specification is static black box testing.
tips:
1. 当为给顾客考虑时,不要忘记软件安全问题
2.
怎么做
high-level
检查产品说明书(没有固定格式,实再想不出来就去和开发团队聊一聊)
原则
- Don`t start by looking for bugs in great detail
- play at being the customer
- assume nothing-question until you are
- guideline
- review
low-level
产品说明书特征检查清单specification attributes checklist:complete(内容完整), accurate(不能有歧义), precise, consistent, relevant, feasible, code-free
产品说明书术语检查清单specification terminology checklist(慎用): always, every, all, none, never\certainly, therefore, clearly, obviously\some, sometimes, often, usually, ordinarily
动态黑盒测试dynamic black-box testing
减少测试案例个数
确定哪些案例需要测试
怎么定义最糟糕情况
数据测试data testing
Boundary conditions
If software can operate on the edge of its capabilities, it will almost certainly operate well under normal conditions.
For the boundaries, partition input into:
- - Valid data inside the boundary.
- - Data just on the boundary (which may be valid or invalid).
- - Invalid data just outside the boundary limits.
Sub-boundary conditions
Nulls
Bad data
BVA(boundary value analysis)
测试案例是4n+1,n为变量
Guideline
范围
选六个(两个边界值,大于和小于边界值,最大值和最小值)
集合
布尔值
状态测试state testing
黑盒测试的一部分,测试软件的逻辑流向demonstrats logic flow of some software
重点是状态和状态的转换
手段:
1. 使用等价位划分去选择测试状态和路径
2. 通过智能选择减少案例
指导
1. 每种状态至少访问一次View each state at least once
2. 测试看起来最普通和最常见的状态转换Test state-to-state transitionns that look like the most common or popular
3. 测试状态之间最不常见的分支Test the least common papaths between states
4. 测试所有错误状态和其返回值Test all the error states and rereturning from the error states
5. 测试随机状态条件Test random state transitions
要求
1. 不要上升到代码层次
Race condition
Multiple processes racing to a finish line, not knowing which will get first
bad timing
Two or more events line up just right and confuse software that didn't expect to be
interrupted in the middle of its operation, it's bad timing.
重复测试Repetition testing
一直做同样的事情
压力测试Stress testing
“饿一饿”软件:不给必要的数据,资源
在不理想的状态时运行,例如内存不足、配置过低,cpu差
其他技术
Behave Like a Dumb User (inexxperienced user)
Throw out any preconceived iideas
Look for Bugs Where Youve A Already Found Them
the more bugs you find, the monore bugs there are
Think like a Hacker
Seek to find vulnerabilities and exexploit it& Folow Experience, Intuition, and Huncnches (预感)
Experience is the name everyone giveves to their mistakes
加载测试Load testing
与stress testing相反
给所有软件所需的资源和任务,甚至远远大于要求
文章评论