Page 228 -
P. 228

8.1   Development testing  211




                               Debugging

                        Debugging is the process of fixing errors and problems that have been discovered by testing. Using information
                        from the program tests, debuggers use their knowledge of the programming language and the intended
                        outcome of the test to locate and repair the program error. This process is often supported by interactive
                        debugging tools that provide extra information about program execution.

                                     http://www.SoftwareEngineering-9.com/Web/Testing/Debugging.html

                                       programmer has an associated tester who develops tests and assists with the testing
                                       process. For critical systems, a more formal process may be used, with a separate
                                       testing group within the development team. They are responsible for developing tests
                                       and maintaining detailed records of test results.
                                         During development, testing may be carried out at three levels of granularity:

                                       1.  Unit testing, where individual program units or object classes are tested. Unit
                                           testing should focus on testing the functionality of objects or methods.
                                       2.  Component testing, where several individual units are integrated to create com-
                                           posite components. Component testing should focus on testing component
                                           interfaces.

                                       3.  System testing, where some or all of the components in a system are integrated
                                           and the system is tested as a whole. System testing should focus on testing com-
                                           ponent interactions.

                                         Development testing is primarily a defect testing process, where the aim of testing
                                       is to discover bugs in the software. It is therefore usually interleaved with debugging—
                                       the process of locating problems with the code and changing the program to fix these
                                       problems.


                                8.1.1 Unit testing
                                       Unit testing is the process of testing program components, such as methods or object
                                       classes. Individual functions or methods are the simplest type of component. Your
                                       tests should be calls to these routines with different input parameters. You can use
                                       the approaches to test case design discussed in Section 8.1.2, to design the function
                                       or method tests.
                                         When you are testing object classes, you should design your tests to provide cov-
                                       erage of all of the features of the object. This means that you should:
                                       • test all operations associated with the object;

                                       • set and check the value of all attributes associated with the object;
                                       • put the object into all possible states. This means that you should simulate all
                                         events that cause a state change.
   223   224   225   226   227   228   229   230   231   232   233