Page 54 - SOFTWARE TESTING & QUALITY ASSURANCE
P. 54
Unit 4: White Box Testing
Using < instead of <=
(b) Check whether there are any comparisons between floating-point values
Checking for precision problems when comparing.
(It is similar to checking whether 7.00000007 is close enough to 7.00000008 to
be considered equal)
(c) Check whether the operands of a Boolean operator are correct
Checking, if an integer variable containing integer values is used in a Boolean
calculation
In the ‘C’ language, zero is considered as true and non-zero is considered as
false.
(d) Check if each Boolean expression states what it is supposed to state, works as expected and
if there are any doubts about the order of evaluation
5. Control Flow Errors: Control flow errors arise due to improper behavior of loops and control
structures in a language. They are caused by direct or indirect computational or comparison
errors.
Some of the points to be analyzed while checking for control flow errors are:
(a) Check whether each switch statement has a default clause
(b) Check if the nested switch statements are in loops
(c) Check the possibility of a loop not executing
(d) Check if the compiler supports short-circuiting expression in evaluation
(e) Check if the language contains statement groups such as begin...end and do...while, are the
‘end’s explicit and do they match their appropriate groups
(f) Check if there is a possibility of premature loop exit
(g) Check if there are any “off by one” errors which may cause unexpected flow through the
loop
6. Subroutine Parameter Errors: Subroutine parameter errors occur when incorrect data is passed to
and from subroutines.
The following are the points to be noted while checking for subroutine parameter errors:
(a) Check if constants are passed to the subroutine as arguments or are they accidentally
changed in the subroutine
(b) Check whether the units of each parameter matches with the units of each corresponding
argument
(c) Check the types and sizes of the parameters received by a subroutine match with those sent
by the calling code
(d) Check if a subroutine alters a parameter that's intended only as an input value
7. Input/Output Errors: Input/output errors relate to errors such as reading from a file, accepting
input from a keyboard or mouse, and writing to an output device such as a file or screen.
The points to be analyzed while checking for input/output errors are:
(a) Check whether the software strictly adheres to the specified format of the data being read
or written by the external device
LOVELY PROFESSIONAL UNIVERSITY 47