< Day Day Up > |
In pre-object days, I was adamant about having only a single return point for a routine. The return value could be logged before exiting the routine. With object-oriented code, my adamancy for a single return has dissipated. I can always add logging to a method with a proxy, as shown in this chapter. The calls to logging do not then intrude upon the logic for normal operations. The logging proxy can record the values of the input parameters and the return value.
Unit tests, or system use case tests, can check a system's functionality. However, these tests do not check a system in real life. Real users can generate sequences of operations or values of data not covered by automated tests. The interaction of modules in a multithreaded or multiprocess environment can be difficult to determine. Logging at major interfaces can provide the information needed to debug errors.
|
< Day Day Up > |