CSC 148H - Fall 2000 University of Toronto - Fall 2000
Department of Computer Science

CSC 148H - INTRODUCTION TO COMPUTER SCIENCE

Testing Strategy for the Project

We ran your project through four phases of testing. The correct output for every test case is available here

Phase 1

In this phase, we ran all of your code, and used the input values shown below. The two text input files we used were jabberwalrus and shake.
  1. Test 1:
    context size:    0
    source file:     jabberwalrus
    initial context: ""
    seed:            5
    lines of output: 5
    
  2. Test 2:
    context size:    1
    source file:     shake
    initial context: "W"
    seed:            300
    lines of output: 5
    
  3. Test 3:
    context size:    2
    source file:     shake
    initial context: "IS"
    seed:            300
    lines of output: 5
    
  4. Test 4:
    context size:    3
    source file:     jabberwalrus
    initial context: "WHA"
    seed:            300
    lines of output: 5
    
  5. Test 5:
    context size:    15
    source file:     shake
    initial context: "DENY THY FATHER"
    seed:            5
    lines of output: 5
    

Phase 2

In this phase, we ran your driver (Jabtalk), but for the rest of the program, plugged in our own correct code. This allows a student whose driver is correct, but who has problems in the rest of the program, to get some marks for correctness.
  1. Test 1:
    context size:    0
    source file:     jabberwalrus
    initial context: ""
    seed:            5
    lines of output: 5
    
  2. Test 2:
    context size:    1
    source file:     shake
    initial context: "Z"
    seed:            300
    lines of output: 5
    
  3. Test 3:
    context size:    2
    source file:     shake
    initial context: "WI"
    seed:            300
    lines of output: 5
    
  4. Test 4:
    context size:    3
    source file:     jabberwalrus
    initial context: "UFF"
    seed:            300
    lines of output: 5
    
  5. Test 5:
    context size:    15
    source file:     shake
    initial context: "THEREFORE THY K"
    seed:            5
    lines of output: 5
    

Phase 3

In this phase, we ran our own correct driver (Jabtalk), but for the rest of the program, plugged in your code. This allows a student whose program has a problem in the driver, but is otherwise correct, to get some marks for correctness.
  1. Test 1:
    context size:    0
    source file:     jabberwalrus
    initial context: ""
    seed:            5
    lines of output: 5
    
  2. Test 2:
    context size:    1
    source file:     jabberwalrus
    initial context: "L"
    seed:            300
    lines of output: 5
    
  3. Test 3:
    context size:    2
    source file:     shake
    initial context: "BU"
    seed:            5
    lines of output: 5
    
  4. Test 4:
    context size:    3
    source file:     shake
    initial context: "DEA"
    seed:            300
    lines of output: 5
    
  5. Test 5:
    context size:    15
    source file:     shake
    initial context: "STAY BUT A LITT"
    seed:            5
    lines of output: 5
    
In the second part of Phase 3, we forced the various kinds of exception to occur:
  1. Test 1: Jabtalk1.java forces a StringLengthException in generateChar().
  2. Test 2: Jabtalk2.java forces a ContextNotFoundException in generateChar().
  3. Test 3: Jabtalk3.java forces an IllegalCharException in generateChar().
  4. Test 4: Jabtalk4.java forces a StringLengthException in tally().
  5. Test 5: Jabtalk5.java forces an IllegalCharException in tally().

Phase 4

In this phase, we again used our own driver with your code for the rest of the program. But this time the driver was not JabTalk. It was a driver that made hard-coded calls to tally() to force a certain shape of trie to be built, and then make a single call to generateChar(). This allows a student whose program produces the correct first character of output, but then goes wrong later, to get some marks for correctness.

We did this 10 times, with 10 different drivers, each creating a trie with a different shape or different frequency values:

  1. Test 1: Jabtalk1Spec.java
  2. Test 2: Jabtalk2Spec.java
  3. Test 3: Jabtalk3Spec.java
  4. Test 4: Jabtalk4Spec.java
  5. Test 5: Jabtalk5Spec.java
  6. Test 6: Jabtalk6Spec.java
  7. Test 7: Jabtalk7Spec.java
  8. Test 8: Jabtalk8Spec.java
  9. Test 9: Jabtalk9Spec.java
  10. Test 10: Jabtalk10Spec.java