Teaching
670 S '07
 
Projects
Presentations
Programming
 
Squadron Scramble
Aircrafts
Project 1
Project 2
Project 3
Project 4
Project 5
Project 6
Project 7
Project 8
Project 9
Project 10
Project 11
Project 12
Project 13

Project 6

Due date: 2/17 : NOON

Checking Players

Now that you have one kind of player ready to go, it is time to test it. Rigorously. To this end, we will conduct a "test fest." You will implement a test harness for players that reads test inputs from the standard file system and you will design test cases. Then we will run all test cases on all submissions. Your score depends on how well your players hold up and how well you design your test cases.

Task 1: Your task is to implement a test harness for your players. The test harness interacts with our test case administrator a via standard input and output. Each input and output message is an XML message, some simple/some complex. The following diagram demonstrates how the harness works:

Constraint: You may not modify your player's export interface as you implement this test harness. You may change only its imports: from the plain turn to th proxy-turn package/module. The latter implements the same interface as turn, but does so via I/O as indicated in the sequence diagram below. Read up on the proxy pattern.



SEQUENCE DIAGRAM

               TESTER                                                            
                  |                                                              
 <-- I/O : 1 ---> |    create()                                                 
                  |----------------------------> PLAYER                          
                  |                                |  
                  |   first-hand(List[Card])       |                             
                  |------------------------------->|
                  |                                |                             
                  |                                |                             
              t = +------> PROXY-TURN              |                             
                  |         |                      |                             
                  |         | take-turn(t)         |                             
                  +------------------------------->|                             
                  |         |                      |                             
                  |         |                      |                             
                  |         |<---------------------+  inspect-stack()            
                  |         |                      |                             
                  |         |                      |                             
                  |         |<---------------------+  card-on-deck?()            
                  |         |                      |                             
                  |         |                      |                             
                  |         |<---------------------+  get-cards-from-stack(Nat)  
 <-- I/O : 2  --------------|                      |
                  |         |<---------------------+  get-a-card-from-deck()  
 <-- I/O : 3  --------------|                      |                                
                  |         |<---------------------+  can-attack?(Alliance)      
                  |         |                      |                             
  result      =   |<===============================+ :: done                     
                  |                                                              
                  |                                                              
 <-- I/O : 4 ---->|  send : result                                               
                  |                                                              
                =====
                =====

I/O 1: TESTER reads fsth and turn from standard input 
I/O 2: PTurn  writes message for get-cards-from-stack to standard output 
       PTurn  reads okay on standard input 
I/O 3: PTurn  writes message for get-a-card-from-deck to standard output 
       PTurn  reads card from standard input 
I/O 4: TESTER writes done to standard output

Read the auxiliary file for the XML data definitions.


Task 1a: The second part of this task is to develop test cases for your player. Create a file for each test case. Remember that due to the somewhat random nature of the player, writing test cases is non-trivial and, for some things that you might imagine, impossible.

POINTS: The base score for Task 1 is 30 points. We will run our own test administrator for all test harnesses on all test cases submitted. We will then tabulate and publish the results as a matrix with links to the test cases that your player passed and failed.

(1) You will receive an additional point for each test case that discovers an error in someone else's player. (2) You will lose one point for each error that someone else's test case reveals in your player, but (3) you will not receive fewer than 30 points.


Task 2:[POINTS: 5] Your second task is to design and implement a test case administrator. It reads a test case, starts up your test harness, and writes XML messages to standard output and listens for transmissions on standard input. Finally, it reads off the final done sent and determines whether this is the expected result according to the test case.


last updated on Tue Jun 9 22:03:19 EDT 2009generated with PLT Scheme