as shown in Figure 4.59. F. Save the SDL model. Interactive Simulation 93 L EstabReg (DLCnum) (DLCnum) ( NULL) DLCnumnot used, we create (DLCnum, True) an instance of L_Releaselnd process DLC (DLCnum) We store into the DLCs(DLCnum) table the PID of := OFFSPRING the new instance waitUA Figure 4.59 After the bug correction G. Simulate again to check that the bug has disappeared: replay the scenario cnx2.scn, and execute the transition dlca!dispatch: from_ready_input_l_estabreq with l_estabreq(0) from env_dlcasu: process dispatch now stays in state ready. 4.3.6 Write a script for automatic validation In an actual project, to test a more complex SDL model, you would produce, for example, 40 simulation scenarios. After a change in the SDL model, you must check that it still works correctly (nonregression) : the Simulator command language enables you to write a script to automatically replay the 40 scenarios (stored in .scn files) and write the test results into a file. By just looking if the file contains TEST FAILED or TEST PASSED, you will know if the 40 scenarios replayed correctly or not. Here is a Simulator script to replay three of our scenarios: This geodesim script replays 3 scenarios to test V.76 - - and writes the results into test_resl.wri define test_failed False 6 echo / 7 echo Execution of script1.wri: test resl.wri echo " test_resl.wri init - - return to step 0 source test1.scn - - replays test1.scn -- now check that test1.scn executed till the end (step 41) and that both DLCs arrays contain Null: if (step=41) and (dlca!dispatch ! dlcs = (. Null . .)) and (dlcb!dispatch ! dlcs = (. Null .)) echo 'Replay test1.scn OK' III test_resl.wri; 94 Validation of Communications Systems with SDL else ; define test failed True; echo 'Error found in test1.scn test_resl.wri; init return to step 0 source cnx2 . scn -- now check that cnx2.scn executed till the end (step 32) and that the 4 inst. of process DLC are in state connected: if (step=32) and (dlca!dlc (1) !state = connected) and (dlca!dlc (2) !state = connected)