CMSC 22001: Software Construction Assignment 4: Test suites

Due: Feb 4, 2008 @ noon

Implement test suite infrastructure for your Scrabble rules checker. In particular:

  1. Develop a test harness that parses files in the format below, runs the specified tests, and prints the results of the tests as specified (also below).
  2. Develop your own file of at least 15 interesting test cases.

In addition to handing in your code, you must also provide a script that runs your program, accepting a test input file on standard input and producing the output on standard output. This program must be called run-stdin-test. Be sure to supply instructions about platform, etc so we can run your program.

To get you started, we have turned the example transcript from the rules into a series of test cases.

Input test fileExpected output
robby.in      robby.out

To grade this assignment, we will collect everyone test cases and run them in all implementations in a mini-tournament. You will get 1 point for each of your classmate's test cases your implementation passes and you will get 1 point for each of your test cases that fails in another's implementation (including your instructor's implementation).

We will post the results of this mini-tournament for everyone to see, and everyone will get all of the test files to help improve their implementations as the quarter progresses. Of course, Each time you find a bug in your code (in this or in future assignments), add a test case to your test file so everyone benefits from your experience.

Note that your submitted test file must match the specification below. You are not trying to test the test harness, but instead test the rules implementation.

Test case file specification

A test case file consists of a series of boards, each followed by a sequnece of placements (wrapped in parenthesis). Your test infrasture must read in the board specification, read in the play specification, construct the board, and then test to see if the move is legal. If the move is legal it should print out the point value of the board (on a single line) and if the move is illegal it should print illegal (also on its own line). Each test case in the file should produce a single line of output.

Your implementation can assume that the board is a valid board and that the tiles have been played from an existing rack. (Thus, when making your test suites, you must construct boards that could have arisen from a legal series of moves and plays that could have come from a player's rack.)

The precise specification is give in the Scrabble Data page. (It defines "board" and "placement", used above). Note that whitespace in the top-level file is treated just like whitespace elsewhere in the spec (ie, do not rely on the fact that there is a blank line between test cases).



CMSC 22001: Software Construction