Effective unit testing : Unit Testing: What to Test? Right-BICEP and CORRECT

Two handy reminders when you are thinking about what to test in your unit tests are:

Right-BICEP
  • Right - Are the results right?
  • B - are all the boundary conditions correct?
  • I - can you check the inverse relationships?
  • C - can you cross-check results using other means?
  • E - can you force error conditions to happen?
  • P - are performance characteristics within bounds?
CORRECT
  • C - Conformance - does the value conform to an expected format?
  • O - Ordering - is the set of values ordered or unordered as appropriate?
  • R - Range - is the value within reasonable minimum and maximum values?
  • R - Reference - does the code reference anything external that isn't under direct control of the code itself?
  • E - Existence - does the value exist (e.g. is not null, non-zero, present in a set)?
  • C - Cardinality - are there exactly enough values?
  • T - Time (absolute and relative) - is everything happening in order? At the right time? In time?
  •  
  •  
 Also some time we can also use FIRST as
F: Fast
I: Isolated
R:Repeateble
S; Self-Tested
T: Timely

 

Comments

Popular posts from this blog

How to calculate maximum number of concurrent users using littile law formula

How to develop a security test strategy

Singleton Design Pattern using Page Factory