Domain testing-域测试
1)AKA partitioning, equivalence analysis, boundary analysis
2)测试方法
a) Divide the set of possible values of a field into subsets, pick values to represent
each subset. The goal is to find a “best representative” for eachsubset,and to run tests with these representatives.Best representatives of ordered fields will typically be boundary values.
b) Multiple variables: combine tests of several “best representatives” and find a
defensible way to sample from the set of combinations.
3)Strengths and weaknesses
a)• Strengths
– Find highest probability errors with a relatively small set of tests.
– Intuitively clear approach, easy to teach and understand
– Extends well to multi-variable situations
b)• Blind spots or weaknesses
– Errors that are not at boundaries or in obvious special cases.The "competent programmer hypothesis" can be misleading.
– Also, the actual domains are often unknowable.
– Reliance on best representatives for regression testing leads us to overtest these cases and undertest other values that were as, or almost as, good.
测试新代码的基本方法
1)Start with obvious and simple tests.使用一些容易pass的值或case测试,如果fail,说明程序存在严重的问题.
2)Test each function sympathetically.弄懂功能存在的因由和给用户带来的价值.知道了用户希望这个feature做些什么,能够发现和解释功能错误的原因和这项功能和剩下的程序的交互性.
3)Test broadly before deeply.早期测试的目标就是尽快发现大的问题.当程序比较稳定的时候再进行更深度的测试.
4)Look for more powerful tests.系统通过简单测试之后,就要想出更强大的更系统的测试案例,头脑风暴是一种很好的集思广益的办法.
5)Pick boundary conditions.精选case,减轻测试负担.
6)Do some freestyle exploratory testing.从项目开始的第一周到最后一周,每周都应该尝试新的测试.