Testing of the parallel software becomes more difficult because of the state space explosion. In theory, all possible input should be considered when testing. However, in actual, completely test is impossible, so we should carry on the targeted test rather than blindly choose test cases.
Colored Petri Net (CPN) is an excellent language to describe parallel system. But, testing based on this method couldn’t complete efficiently when the state space is huge. A new automation algorithm which based on CPN is proposed in this paper. This method could generate the condition expressions automatically. The conditional expressions are a combination of the conditions on all feasible paths which from the initial place to the tested behaviors. First, all paths from current initial place to tested behaviors are found in this method. Second, all the pending arc expressions and guard expressions that obtained from these paths are extracted and processed, especially, the equivalence problem of the namesake variable of the key nodes would be resolved, and these key nodes mainly contain synchronous transition and synchronous concurrency transition. Besides, the substitution problem between different variables also is considered in this process. Finally, we obtain the conditional expressions by integrating all the pending expressions, these expressions are all about the initial position output variables. Test data that meet these conditions could reach the test target.
These expressions could guide tester to choose the appropriate test case and remove redundancy data from testing data set. It can also be used to implement boundary value analysis, equivalence class division, and system model analysis. At the end of the paper, we give the instance to show this method is reasonable and effective.