2.6 Different Techniques for Testing and Debugging are Required

2.6 Different Techniques for Testing and Debugging are Required

When testing a sequential program the developer can trace the logic of a program in a step-by-step manner. If the developer starts with the same data and makes sure the system is in the same state, then the outcome or flow of the logic is predictable. The programmer can find bugs in the software by starting the program in the necessary state, using the appropriate input and then tracing through the logic step-by-step. Testing and debugging in the sequential model depends on the predictability of the program's initial state, and current state given the specified input.

This changes with parallel and distributed environments. It is difficult to reproduce the exact context of parallel or distributed tasks because of operating system scheduling policies, dynamic workloads on the computer, processor time slices, process and thread priorities, communication latency, execution latency, and the random chance involved in parallel and distributed contexts. To reproduce the exact state the environment was in during testing and debugging requires that every task the operating system was working on be recreated. The processor scheduling state must be known. The status of virtual memory and context switching all must be reproduced exactly. Interrupt and signal conditions must be recreated. In some cases, networking traffic would have to be recreated! Even the testing and debugging tools impact the exact environment. This means that recreating the same sequence of events in order to test or debug a program is often out of the question. The reason these things would have to be recreated is because they can all help to determine which process or thread can execute and on what processor they can execute. Moreover, it is the particular mix of executing processes and threads that could be the reason for a deadlock, indefinite postponement, data race, or another kind of problem. Although some of these issues also affect sequential programming, they don't disrupt the assumptions of the sequential model. The kind of predictability that is present in the sequential model is simply not available in concurrency programming. This forces the developer to acquire new tactics for testing and debugging programs. It also requires that the developer find new ways to prove program correctness.



Parallel and Distributed Programming Using C++
Parallel and Distributed Programming Using C++
ISBN: 0131013769
EAN: 2147483647
Year: 2002
Pages: 133

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net