CS 235 Project Testing
You are required to make your code pass each of the tests provided below before you submit.
The tests provided here are not sufficient to thoroughly test your program. The tests we use for project pass-off are different from the tests given here. Your project may pass all the tests given here and still not pass all the tests used for project pass-off. You need to create your own additional tests to ensure that your code is working properly in all possible input scenarios.
Project 1 Tests
Test | Files | Description |
---|---|---|
Test 10 | in10a.txt in10b.txt in10c.txt out10.txt | Example from project description. |
Test 11 | in11a.txt in11b.txt in11c.txt out11.txt | Empty student file. |
Test 12 | in12a.txt in12b.txt in12c.txt out12.txt | Empty grade file. |
Test 15 | in15a.txt in15b.txt in15c.txt out15.txt | Repeated student in student file. |
Test 16 | in16a.txt in16b.txt in16c.txt out16.txt | Queries in different order. |
Test 18 | in18a.txt in18b.txt in18c.txt out18.txt | A larger test. |
Test 19 | in19a.txt in19b.txt in19c.txt out19.txt | A larger test. |
Project 2 Tests
Test | Files | Description |
---|---|---|
Test 20 | in20a.txt in20b.txt out20.txt | Example from project description. |
Test 22 | in22a.txt in22b.txt out22.txt | Empty dictionary file. |
Test 23 | in23a.txt in23b.txt out23.txt | Empty document file. |
Test 25 | in25a.txt in25b.txt out25.txt | Dictionary with upper-case letters. |
Test 26 | in26a.txt in26b.txt out26.txt | Misspelled word twice on one line. |
Test 27 | in27a.txt in27b.txt out27.txt | A larger test. |
Test 28 | in28a.txt in28b.txt out28.txt | A larger test. |
Test 29 | in29a.txt in29b.txt out29.txt | A larger test. |
Project 3 Tests
Test | Files | Description |
---|---|---|
Test 30 | in30a.txt in30b.txt out30.txt | Example from project description. |
Test 31 | in31a.txt in31b.txt out31.txt | A board and dictionary with short words. |
Test 32 | in32a.txt in32b.txt out32.txt | A board with a two-letter tile. |
Test 33 | in33a.txt in33b.txt out33.txt | The word 'rotor' can be formed by reusing tiles, skipping tiles, or wrapping at the edge of the board. (none of these are valid) |
Test 34 | in34a.txt in34b.txt out34.txt | Dictionary is not sorted and has duplicate words. |
Test 35 | in35a.txt in35b.txt out35.txt | A 4x4 board. |
Test 37 | in37a.txt in37b.txt out37.txt | 10x10 board, 1200-word dictionary. |
Test 38 | in38a.txt in38b.txt out38.txt | 20x20 board, 3500-word dictionary. |
Project 5 Tests
Test | Files | Description |
---|---|---|
Test 50 | in50.txt out50.txt | Example from project description. |
Test 51 | in51.txt out51.txt | Insert at front/middle/end of list. |
Test 52 | in52.txt out52.txt | Remove at front/middle/end of list. |
Test 53 | in53.txt out53.txt | Find at front/middle/end of list. |
Test 54 | in54.txt out54.txt | 10 inserts, 10 removes. |
Test 55 | in55.txt out55.txt | 20 inserts, 20 removes. |
Test 56 | in56.txt out56.txt | 40 inserts, 40 removes. |
Test 57 | in57.txt out57.txt | 40 random commands. |
Test 58 | in58.txt out58.txt | 80 random commands. |
Test 59 | in59.txt out59.txt | 160 random commands. |
Project 6 Tests
Test | Files | Description |
---|---|---|
Test 60 | in60.txt out60.txt | Example from project description. |
Test 64 | in64.txt out64.txt | Add a duplicate item. |
Test 65 | in65.txt out65.txt | Find at every position in the tree. |
Test 66 | in66.txt out66.txt | Remove a 2-child node (no rotate). |
Test 67 | in67.txt out67.txt | Rotate with equal-height grandchildren. |
Test 68 | in68.txt out68.txt | Remove a 2-child node followed by a rotate. |
Test 69 | in69.txt out69.txt | Double rotate to the right. |
Test 81 | in81.txt out81.txt | 10 adds, 10 removes. |
Test 82 | in82.txt out82.txt | 20 adds, 20 removes. |
Test 83 | in83.txt out83.txt | 40 adds, 40 removes. |
Test 91 | in91.txt out91.txt | 40 random commands. |
Test 92 | in92.txt out92.txt | 80 random commands. |
Test 93 | in93.txt out93.txt | 160 random commands. |
Project 7 Tests
Test | Files | Description |
---|---|---|
Test 70 | in70.txt out70.txt | Example from project description. |
Test 72 | in72.txt out72.txt | Add a duplicate item. |
Test 73 | in73.txt out73.txt | Add 2 items to the same bucket. |
Test 74 | in74.txt out74.txt | Remove an item not in the table. |
Test 75 | in75.txt out75.txt | Find 2 items in the same bucket. |
Test 76 | in76.txt out76.txt | Add a duplicate item (don't rehash). |
Test 77 | in77.txt out77.txt | Add longer strings. |
Test 78 | in78.txt out78.txt | Remove items to shrink the table. |
Test 79 | in79.txt out79.txt | Rehash a bucket with two items. |
Test 81 | in81.txt out81.txt | 10 adds, 10 removes. |
Test 82 | in82.txt out82.txt | 20 adds, 20 removes. |
Test 83 | in83.txt out83.txt | 40 adds, 40 removes. |
Test 91 | in91.txt out91.txt | 40 random commands. |
Test 92 | in92.txt out92.txt | 80 random commands. |
Test 93 | in93.txt out93.txt | 160 random commands. |
How to Run a Test
Consider test 10 for project 1. This test has three input files (in10a.txt, in10b.txt, and in10c.txt) and an expected-output file (out10.txt).
Run the test by giving the name of the executable file for the project, followed by the names of the test input files, and finally the name of the actual-output file. For example, the command for running test 10 on project 1 could look like this:
$ ./lab1 in10a.txt in10b.txt in10c.txt actual.txt
When the program completes, the file 'actual.txt' will contain the actual output from the program.
Now you need to compare the expected output with the actual output to determine whether the program is working correctly. The linux 'diff' command is well suited for this purpose. You can run the 'diff' command with two filenames and it will report any differences between the two files. The 'diff' command gives no output when the files are the same. Run the 'diff' command like this:
$ diff out10.txt actual.txt
The file 'out10.txt' contains the expected output. The file 'actual.txt' contains the actual output. If the 'diff' command gives any output you need to modify the program so that the actual output matches the expected output. If the 'diff' command gives no output the program is working correctly for this test.
Test File Naming
Each test is a collection of text files.
Filenames that begin with 'in' provide the inputs for the program. The filename for an input file has the form 'inXXy.txt' where XX is a two-digit number and y is a lowercase letter (a, b, c, ...). The input file with letter 'a' is given first on the command line, the one with letter 'b' is given second, and so on.
A filename that begins with 'out' provides the expected output. The filename for an expected-output file has the form 'outXX.txt' where XX is a two-digit number.
The number XX is the same number for all the files that are part of the same test.