General Principles

l       Test anything that might break

l       Test everything that does break

l       New code is guilty until proven innocent

l       Write at least as much test code as production code

l       Run local tests with each compile

l       Run all tests before check-in to repository

Questions to Ask

l       If the code ran correctly, how would I know?

l       How am I going to test this?

l       What else can go wrong?

l       Could this same kind of problem happen anywhere else?

 

What to Test: Use Your RIGHT-BICEP

l       Are the results right?

l       Are all the Boundary conditions CORRECT?

l       Can you check Inverse relationships?

l       Can you Cross-check results using other means?

l       Can you force Error conditions to happen?

l       Are Performance characteristics within bounds?

Good tests are A TRIP

l       Automatic

l       Thorough

l       Repeatable

l       Independent

l       Professional

CORRECT Boundary Conditions

l       Conformance . Does the value conform to an expected format?

l       Ordering .    Is the set of values ordered or unordered as   appropriate?

l       Range .       Is the value within reasonable minimum and maximum values?

l       Reference .    Does the code reference anything external that isn't under direct control of the code itself?

l       Existence .    Does the value exist? (e.g., is non-null, non-zero, present in a set, etc.)

l       Cardinality .  Are there exactly enough values?

l       Time (absolute and relative) . Is everything happening in order? At the right time? In time?

评论
发表评论

您还没有登录,请登录后发表评论

rocflytosky
搜索本博客
存档
最新评论