******************************************************************************* README.txt FOR Testing kocos.pl Version 0.01 Copyright (C) 2002-2004 Ted Pedersen, tpederse@umn.edu Amruta Purandare pura0010@d.umn.edu University of Minnesota, Duluth http://www.d.umn.edu/~tpederse/code.html ******************************************************************************* Testing for kocos.pl -------------------- AMRUTA PURANDARE pura0010@umn.edu 1/10/2003 1. Introduction: ---------------- This program is a component of a NSP package which finds the kth order co-occurrences of a given word. The scripts and files provided here could be used to test the correct behaviour of the program and backward compatibility. 2. Phases of Testing: --------------------- We have divided the testing into two main phases: Phase A: Testing kocos.pl's behaviour under normal conditions. Phase B: Testing kocos.pl's response to erroneous conditions. 2.1. Phase A: Testing kocos.pl's behaviour under normal conditions. ------------------------------------------------------------------- A Single test script normal-op.sh runs all tests written as testA*.sh. To run any of these tests individually, type testA*.sh on the command line. Following tests are called by normal-op.sh 2.1.1 Tests A1: --------------- Checks if the program finds the co-occurrences of a given order when the co-occurrence graph as a tree form. ------ Input test-A1.count ------ ----------------- Expected Output ----------------- order 1 => test-A1a.reqd order 2 => test-A1b.reqd order 3 => test-A1c.reqd order 4 => test-A1d.reqd ---------------- Obtained Output test-A1[a-d].output ---------------- 2.1.2 Tests A2: --------------- Checks if the program finds the co-occurrences of a given order when the co-occurrence graph has loops. ------ Input test-A2.count ------ ----------------- Expected Output ----------------- order 1 => test-A2a.reqd order 2 => test-A2b.reqd order 3 => test-A2c.reqd order 4 => test-A2d.reqd ---------------- Obtained Output test-A2[a-d].output ---------------- 2.1.3 Tests A3: --------------- Checks if the program finds the co-occurrences of a given order when the co-occurrence graph has a form like a square folded 4 times. ------ Input test-A3.count ------ ----------------- Expected Output ----------------- order 1 => test-A3a.reqd order 2 => test-A3b.reqd order 3 => test-A3c.reqd order 4 => test-A3d.reqd order 5 => test-A3e.reqd ---------------- Obtained Output test-A3[a-e].output ---------------- 2.1.4 Tests A4: --------------- Checks if the program finds the co-occurrences of a given order when the co-occurrence graph is a complete bipartite of order 3. ------ Input test-A4.count ------ ----------------- Expected Output ----------------- order 1 => test-A4a.reqd order 2 => test-A4b.reqd order 3 => test-A4c.reqd order 4 => test-A4d.reqd order 5 => test-A4e.reqd order 6 => test-A4f.reqd ---------------- Obtained Output test-A4[a-f].output ---------------- 2.1.5 Tests A5: --------------- Checks if the program finds the co-occurrences of a given order when the co-occurrence graph is a cycle. ------ Input test-A5.count ------ ----------------- Expected Output ----------------- order 1 => test-A5a.reqd order 2 => test-A5b.reqd order 3 => test-A5c.reqd order 4 => test-A5d.reqd order 5 => test-A5e.reqd ---------------- Obtained Output test-A5[a-e].output ---------------- 2.1.6 Tests A6: --------------- Checks if the program finds the co-occurrences of a given order when the co-occurrence graph is a chain with 2 loops. ------ Input test-A6.count ------ ----------------- Expected Output ----------------- order 1 => test-A6a.reqd order 2 => test-A6b.reqd order 3 => test-A6c.reqd order 4 => test-A6d.reqd order 5 => test-A6e.reqd ---------------- Obtained Output test-A6[a-e].output ---------------- 2.1.7 Tests A7: --------------- Checks if the program finds the co-occurrences of a given order when the co-occurrence graph has a zigzag shape. ------ Input test-A7.count ------ ----------------- Expected Output ----------------- order 1 => test-A7a.reqd order 2 => test-A7b.reqd order 3 => test-A7c.reqd order 4 => test-A7d.reqd order 5 => test-A7e.reqd ---------------- Obtained Output test-A7[a-e].output ---------------- 2.2 Phase B: Testing kocos.pl's behaviour under error conditions. ------------------------------------------------------------------- A single test script error-op.sh runs the tests writtn in testB*.sh. Following tests are run by error-op.sh 2.2.1 Tests B1: --------------- Checks the error condition when the order < 0. ------ Input test-B.count ------ ----------------- Expected Output test-B1.reqd ----------------- ---------------- Obtained Output test-B1.output ---------------- 2.2.2 Tests B2: --------------- Checks the error condition when the specified word is not found in the input file. ------ Input test-B.count ------ ----------------- Expected Output test-B2.reqd ----------------- ---------------- Obtained Output test-B2.output ---------------- 3. Conclusions: --------------- We have tested program kocos.pl and conclude that it runs correctly. We have also provided the test scripts so that future versions of kocos.pl can be compared to the current version against these scripts.