Page 53 - SOFTWARE TESTING & QUALITY ASSURANCE
P. 53

Software Testing and Quality Assurance



                           2.   Data Declaration Errors: Data declaration errors occur due to improper declaration of variables
                               and constants.
                              Some of the common points to ponder on while checking for data declaration errors are:

                               (a)  Check if the variables are assigned the correct length, type, storage class

                                             A variable that is incorrectly declared as an array instead of a string.

                               (b)  Check if a variable is initialized at the time of declaration, and also analyze if it is properly
                                    initialized and consistent with its type
                               (c)   Check if there are any variables with similar names
                               (d)  Check if there are any variables declared which are never referenced or just referenced once
                                    (should be a constant)
                               (e)  Check if all variables are explicitly declared within a specific module

                           3.   Computation Errors:  Computational errors arise due to  errors in calculations  --  where the
                               expected results are not obtained due to erroneous calculations.
                                Some of the questions pertaining to computational errors are:
                               (a)  Check if any calculations use variables which have different data types

                                             Adding integers and floating point numbers


                               (b)  Check if any calculations use variables which have the same data type but vary in size

                                             Adding long integers to short integers


                               (c)   Check if the  compiler’s conversion rules for variables of inconsistent type or size
                                    understood and considered while calculating
                               (d)  Check if overflow or underflow in the middle of a numeric calculation possible
                               (e)  Check if it is ever possible for a divisor/modulus to be zero

                               (f)   Check if a variable’s value goes outside its meaningful range
                                             The probability of  a result being less than zero percent or greater than  100
                                             percent.

                               (g)  Check if the target variable of an assignment is smaller than the right-hand expression
                               (h)  Check if parentheses are needed for clarification

                                             For expressions containing multiple operators, there is confusion about the
                                             order of evaluation.

                               (i)   Check if for cases of integer arithmetic,  the code handles some calculations, particularly
                                    division, which results in loss of precision
                           4.   Comparison Errors:  Comparison errors occur during boundary conditions such  as ‘less than,
                               greater than, equal, not equal, and true or false’.
                                  Some of the common points to be analyzed for comparison errors are:
                               (a)  Check if the comparisons are correct






                          46                      LOVELY PROFESSIONAL UNIVERSITY
   48   49   50   51   52   53   54   55   56   57   58