Laserfiche WebLink
Quality Control TSTool Documentation <br />9.3 Quality Control for TSTool Software <br /> <br />TSTool software provides many data processing co mmands. Each command typically provides multiple <br />parameters. The combination of commands and parame ters coupled with potential data changes and user <br />errors can make it difficult to confirm that TSTool so ftware is itself performing as expected. To address <br />this quality control concern, several commands have been built into TSTool to facilitate using TSTool <br />itself to test functionality. Test cases can be defined for each command, with test cases for various <br />combinations of parameters. The suite of all the test cases can then be run to confirm that the version of <br />TSTool does properly generate expected results. This approach performs regression testing of the <br />software and utilizes TSTool’s error-handling featur es to provide visual feedback during testing. <br /> <br />Test cases are developed by software developers as new features are implemented, according to the <br />following documentation. However, users can also deve lop test cases and this is encouraged to ensure <br />that all combinations of parameters and input data are tested. Providing verified test data and results prior <br />to new development will facilitate the new development. <br /> <br />9.3.1 Writing a Single Test Case <br /> <br />A single test case is illustrated by the following example (indented lines indicate commands that are too <br />long to fit on one line in the documentation). <br /> <br /># Test filling with interpolation where maximum gap interval to fill is 2. <br />StartLog(LogFile="Results/Test_FillInterpolate_MaxIntervals=2.TSTool.log") <br />RemoveFile(InputFile="Results/Test_FillInterpolate_MaxIntervals=2_out.dv", <br /> IfNotFound=Ignore) <br />NewPatternTimeSeries(Alias="ts1_day",NewTSID="ts1...Day",Description="test data 1", <br /> SetStart="2000-01-01",SetEnd="2003-05-13", <br /> PatternValues="1,2,3,2,1,-999,5,1,-999,-999,-999,1,3,5") <br />FillInterpolate(TSList=AllMatchingTSID,TSID="ts1_day",MaxIntervals=2) <br /># Uncomment the following command to regenerate expected results. <br /># WriteDateValue(OutputFile="ExpectedResults/Test_FillInterpolate_MaxIntervals=2_out.dv") <br />WriteDateValue(OutputFile="Results/Test_FillInterpolate_MaxIntervals=2_out.dv") <br />CompareFiles(InputFile1="ExpectedResults/Test_FillInterpolate_MaxIntervals=2_out.dv", <br /> InputFile2="Results/Test_FillInterpolate_MaxIntervals=2_out.dv",IfDifferent=Warn) <br /> <br /> <br />Example Test Case Command File <br /> <br />The purpose of the test case command file is to rege nerate results and then compare the results to <br />previously generated and verified expected results. The example illustrates the basic steps that should be <br />included in any test case: <br /> <br />1. Start a log file to store the results of the specific test case. The previous log file will be closed <br />and the new log file will be used until it is closed. The log file is not crucial to the test but helps <br />with troubleshooting if necessary (for example if eval uating the test case output when run in a test <br />suite, as explained later in this chapter). <br />2. Remove the results that are to be generated by the test . This is necessary because if the <br />software fails and old results match expected results, it may appear that the command was <br />successful. Using the IfNotFound=Ignore parameter is useful because someone who is <br />running the tests for the first time may not have previous results. Test developers should use <br />IfNotFound=Warn when setting up the test to confirm that the results being removed match <br />the name that is actually generated in a later command, and then switch to <br />IfNotFound=Ignore . <br />Quality Control - 2 118