Desktop User Guides > Professional > Interview scripting > Sample management > Sample management facilities > Debugging and testing scripts > Debugging scripts
 
Debugging scripts
The UNICOM Intelligence Developer Documentation Library installs framework scripts that you can use for testing and debugging any sample management scripts that you write or customize yourself.
The scripts are in:
[INSTALL_FOLDER]\IBM\SPSS\DataCollection\7\DDL\\Scripts\Interview\Sample Management – Scripts\Debugging
basic_example.mrs
Use this script to debug scripts that cater for inbound calls only (web interviews).
multimode_example.mrs
Use this script to debug telephone interviewing scripts.
SMDebugging.mrs
This file is included in the other scripts, and contains common helper functions and other settings. Do not change this file.
The two _example files are designed to be run in UNICOM Intelligence Professional and mimic the behavior of the interviewing engine that runs interviews in UNICOM Intelligence Interviewer - Server. Edit one of the files so that it refers to your project and sample management script, and then run it against your project to test that your script performs as intended.
How to use the debugging framework
1 Write or edit your sample management script.
2 Create a project and use the Participants activity to upload some sample records.
3 Activate the project using a sample management script that you know works. It doesn't matter which script this is as you won't be running interviews using this script. The reason you are activating the project is to populate the project's properties and the sample management tables so that the debugging framework can access them later.
4 In [INSTALL_FOLDER]\IBM\SPSS\DataCollection\7\DDL\Scripts\Interview\Sample Management – Scripts\Debugging, make a back-up copy of the debugging script you want to use.
5 Using UNICOM Intelligence Professional, open the original version of the example script and replace the value of the PROJECT_NAME constant with the name of your project. A few lines under this is a #include line that reads a .mrs file. Replace the name with the name of your sample management script file, and then save the changes.
6 Run the example script in UNICOM Intelligence Professional. Since this script contains a #include statement to read the script that you want to debug, you can set breakpoints in your script and single-step through it looking at the parameters that come in from the framework. See Setting breakpoints and Stepping through the code for details. Test as many paths through your script as possible using UNICOM Intelligence Professional.
Use the helper functions in basic_example.mrs and multimode_example.mrs to get some ideas of what you might try.
Check that the logging (in the output window) is as expected.
Check that the records in the sample table are as expected.
Refer to the comments in the example scripts for tests that you can run to simulate authenticating and returning records or getting and returning records.
7 When you are sure that your sample management script functions as intended, return to UNICOM Intelligence Interviewer - Server Admin and reactivate the project, this time using your sample management script.
8 Run test interviews.
See also
Debugging and testing scripts