Summary: | 碩士 === 國立交通大學 === 資訊工程系所 === 93 === In concurrent Java program, the main() method may create one or more threads to execute the run() methods of active objects. Thus, the run() methods would be executed parallel with the main() method. There are many different combinations of paths that may be executed parallel, and a combination is named a concurrent path. In order to ensure the correctness of the main() method, it is necessary to verify the correctness of all different concurrent paths. In concurrent program testing, it is a very important issue how we select the fewest concurrent paths to test. Unfortunately, there is not a systematic measure to solve this problem. So this research is about to propose one systematic measure to solve this problem.
If we want to test all execution behaviors of a concurrent program with fewest concurrent paths, we need to ensure every run() path and every inter-thread interaction could be verified during testing. In this research, we propose that there might exist data-flows between two paths belonging to different run() methods when they call the same shared object’s functions. We also notice that a path may call different shared objects’ functions. Thus one directly data-flow may affect another. This is so-called indirectly data-flow. We can find all combinations of paths which have interactions by using data-flows, and all combinations that have been found should to be tested. These combinations and other paths without shared objects should to be tested.
The problem of finding the fewest path combinations is equivalent to the graph coloring problem. It is impossible to find the optimal solution in polynomial time. Thus, this research adopts the look-ahead policy of the Gaming Tree mechanism to find the concurrent paths, and it has time complexity of O(N^4).
Via various examples, it shows that the proposed mechanism in this research can find the optimal solution for this problem quickly and ensures the practicality and validity.
|