Académique Documents
Professionnel Documents
Culture Documents
Welcome to the JAMS workshop! This document contains useful reference information for the
workshop, including schedule, team assignment, and team evaluation criteria. This document, as well as
all of the PowerPoint presentations that will be used throughout the week, may be found at
http://lawolf.net/jams.
SCHEDULE.......................................................................................................................................................................3
TEAM ASSIGNMENT............................................................................................................................................ 5
PROJECT DESCRIPTION...................................................................................................................................................5
DELIVERABLES & DUE DATES..........................................................................................................................................5
EVALUATION................................................................................................................................................................ 6
DOCUMENT TEMPLATES...................................................................................................................................... 6
SAMPLES............................................................................................................................................................. 7
FUNCTIONAL SPECIFICATION...........................................................................................................................................7
Overview................................................................................................................................................................7
Goals and Non-Goals.............................................................................................................................................7
Goals.................................................................................................................................................................................. 7
Non-Goals.......................................................................................................................................................................... 8
Scenarios................................................................................................................................................................8
Functional Design...................................................................................................................................................8
User Interface.................................................................................................................................................................... 8
Game Play.......................................................................................................................................................................... 9
Player Management........................................................................................................................................................... 9
Game Statistics.................................................................................................................................................................. 9
Computer Player.............................................................................................................................................................. 10
Security................................................................................................................................................................10
Implementation Plan...........................................................................................................................................10
Deployment Plan..................................................................................................................................................11
Implementation Details.......................................................................................................................................11
Namespace...................................................................................................................................................................... 11
Gameboard...................................................................................................................................................................... 11
Player............................................................................................................................................................................... 11
Game............................................................................................................................................................................... 11
Open Issues..........................................................................................................................................................11
TEST PLAN................................................................................................................................................................ 12
Test Plan Objectives.............................................................................................................................................12
Scope....................................................................................................................................................................12
Features to be tested.......................................................................................................................................................12
1
Features NOT to be tested...............................................................................................................................................12
Test Strategy........................................................................................................................................................12
Test Cases.............................................................................................................................................................12
Feature 1: Alternate between Players..............................................................................................................................12
Feature 2: Validate Basic Moves (legal moves only).........................................................................................................13
Feature 3: Declare the Winner or a Tie............................................................................................................................13
Feature 4: Statistics Table................................................................................................................................................14
Feature 5: Play Timer.......................................................................................................................................................14
Feature 6: Machine Player...............................................................................................................................................14
Open Issues..........................................................................................................................................................15
2
Schedule
3
9:00 Introduction: Expectations Morning Session: Project Morning Session: AppLab Holiday / Facilitator Office Team Presentations (15 x 8
for the Week, Software Management (Lauren & Community Knowledge Hours minutes each)
Lifecycle (Kenny Wolf & Lavoie) Worker (Luke Kyohere)
9:30 Lauren Lavoie)
10:00 Writing Functional Group Work Session Group Work Session Awards
10:30 Specifications (Kenny Wolf)
11:00 Test-Driven Development
(Lauren Lavoie)
11:30
12:00 Object-Oriented Design
12:30 (Kenny Wolf)
1:00 Lunch Break
1:30 Facilitator Office Hours Facilitator Office Hours
2:00 Introduction to the group
2:30 activity (Kenny Wolf &
Lauren Lavoie)
3:00 Initial group work session:
3:30 setup, assign roles, start
4:00 working
4:30
5:00
5:30
4
Team Assignment
Project Description
Implement a computer game version of your favorite board or card game
o For example: Checkers, Omweso, Boggle, Hearts, Blackjack, Othello, Scrabble, Yahtzee
o The game must have at least two players
o The game must have a basic visualization
The program must implement the rules of the game being implemented
o Only allow valid “moves”
o Keep score if appropriate
o Determine the winner and end the game
There are a number of optional enhancements that will help improve your score, such as:
o Networked play
o Computer player
Use whatever technology you want
o All of our examples have been in Java and VB
o You are welcome to implement your game as a website or a desktop application
o The machines in the lab are pre-installed with:
JCreator, Eclipse (Java)
Visual Studio (Visual Basic, C#, ASP.NET)
WAMP Server
Dreamweaver
You are required to implement some visual representation of the game
o In order to meet the baseline requirements, the visuals need not be sophisticated
o A range of options exist for visual representation:
HTML
.Net Winforms (Visual Basic or C#)
Java Swing
Console UI (ASCII art)
Evaluation
All projects will be evaluation by JAMS facilitators. There are two components to evaluation:
Baseline criteria. These criteria are required to completed by all teams, and comprise the baseline score. Up to
100 points may be earned for satisfying the baseline criteria.
Optional criteria. These criteria are optional, and will allow teams to differentiate themselves by implementing
more advanced features. They should only be attempted by teams who are confident that they will satisfy all of
the baseline criteria. Teams may earn bonus points by implementing the optional criteria, as a percentage of
their baseline score.
Baseline Criteria: Required Max Points Additional Criteria: Optional Max Bonus
Functional specification 15 Application has relatively complex 20%
rules/game play
Test Plan 15 Application has sophisticated 30%
graphics/UI
Application compiles & runs 10 Application implements a computer 30%
player (max points awarded only for a
very “smart” AI implementation)
Application adheres to the spec, 25 Networked game play 20%
and implements the rules of the
game, including scoring (if
appropriate) and ending the game
Demo of working test cases for 20 Other cool features 30%
facilitators
Presentation & demo for 15
workshop attendees
Document Templates
You may download templates from the following locations:
6
Samples
Functional Specification
The following is a sample functional specification for a Tic-Tac-Toe game.
Overview
Tic-tac-toe is a game for two players, X and O, who alternate marking spaces in a 3x3 grid with their symbol. The player
who successfully places a set of three marks in a horizontal, vertical, or diagonal row wins the game. If no player can
create a horizontal, vertical, or diagonal row then the game is a draw. Player X goes first. As it has a simple set of rules, tic
tac toe provides leisure entertainment for people of all ages.
Goals
[P1] Support two human players in a game that is run as a client application
[P1] Use a graphical representation of the players and game board
[P1] Alternating turns between the players starting with X
[P1] Declare a winner when a player has successfully placed three marks in a row
[P1] Declare a tie when no player can make a winning move
[P1] Support for starting a new game after the initial game has completed
[P2] Allow the game to be run inside a web-browser
[P2] Use multi-colored graphics in the game visuals
[P2] Support custom player names
[P2] Tabulate, store, and display statistics on players’ performance
[P2] Support menu-based commands for new game and quit
[P3] Add a timer to limit the amount of time a player is allowed to spend on a turn
[P3] Allow for the two players to be on separate machines and play through the network
[P3] All the user to save in-progress games
[P3] Have one player be a computer-based (AI) player
[P3] Allow player O to start a game
7
Non-Goals
Support for any grids larger than 3x3
Support for non-grid shaped game boards
Animation of game play
Scenarios
Richard has an afternoon free. He calls up his friend Joseph and invites him over to play tic-tac-toe. Richard launches tic-
tac-toe and a 3x3 grid appears on the screen. They play a game, Joseph connects three Os on the right-most column and
is declared the winner.
Lydia has tic-tac-toe installed on her machine and wants to know how many games she has won so far. She launches tic-
tac-toe, chooses Player Performance, and enters her name into the edit box. The system tells her that she has won 32
games so far, lost 2 games and tied 19 games.
Functional Design
User Interface
Main Window
The UI for tic-tac-toe is a Windows Form that consists of line and button controls arranged in a 3 x 3 grid:
Players alternatively interact with the grid by clicking on an available button. A label on the upper-left corner identifies
the current player that needs to make a move.
When a player wins, or no player is able to win, the label is updated with the appropriate game conclusion text.
High Scores
8
[TODO: insert screenshot of side pane that shows top-10 scores + timer]
Menus
File->New Game…
At any point, a user can select this option to start a new game. If a game is in progress, then a dialog will appear
to confirm that they want to abandon their current game.
File->Exit
At any point, a user can select this option to exit the application. If a game is in progress, then a dialog will
appear to confirm that they want to abandon their current game.
Game Play
Game play for tic-tac-toe should conform to the following flowchart:
1. A player completes a row of three squares with their mark – that player is declared the winner.
9
2. There are no possible ways for either player to create a row of three squares with their mark – the game is
declared a tie.
Player Management
[TODO: Add details about player names, preferences, etc.]
Game Statistics
At the conclusion of each game, tic-tac-toe records the following information:
With this information, tic-tac-toe displays the top players and other statistics about the game.
stores information about how many games each player wins and loses. It also stores information about how many games
have been won overall by X or O.
Storage Format
In order to report on high scores, player statistics, and game statistics, a log of the results for all games that are played
are stored on disk in the following format:
<?xml version="1.0"?>
<GameHistory xmlns="http://schemas.samples.jams/tictactoe">
<PlayerStatistics>
<Player name="richard" winsAsX="10" winsAsO="5" lossesAsX="4" lossesAsO="9" />
</PlayerStatistics>
<GameStatistics>
<Game startTime="2010-08-29 20:01:04" endTime="2010-08-29 20:23:52" winner="O" />
</GameStatistics>
</GameHistory>
While using a database with Player and Game tables would allow for richer data management and queries, as well as
avoid redundancy in the above XML format, we have prioritized installation simplicity and do not want to require a
database to be available for playing tic-tac-toe.
Computer Player
If we have time to implement a computer player, we will need to calculate a game tree based on the status of the game
after each move. The game tree tracks the possible legal moves and whether they are favorable for the computer player
or not.
10
The most straightforward algorithm to calculate our next move is minimax.
Security
Priority Security Concern Mitigation
2 If we decide to implement a web-based version of the game, Add encryption (https) and HTTP
then we need to account for denial of service attacks. authentication
Implementation Plan
To implement tic-tac-toe in such a way as to address the goals in priority order, the game will be implemented in the
following phases:
4. Advanced features, such as customized player names, timing moves, and showing high scores
Deployment Plan
Tic-tac-toe will be packaged as a single Windows executable. There are no features that require special setup tasks.
11
Implementation Details
Internally, tic-tac-toe has a few major concepts that we represent through objects. These include the game board,
players, and games.
Namespace
All of the classes in our implementation will use a namespace of Jams.Samples.TicTacToe
Gameboard
[TODO: insert details on Gameboard object]
Player
[TODO: insert details on Player object]
Game
[TODO: insert details on Game object]
Open Issues
1. Should we use Windows Forms or WPF for the UI?
2. Should we secure the high-score file, or at least obfuscate it?
12
Test Plan
The following is a sample test plan for the Tic-Tac-Toe game specified above.
Scope
Features to be tested
Basic game play
o The game alternates between players
o Players can place moves
o Only legal moves are allowed
Ending the game
o The game can declare a winner
o The game can declare a tie
Player statistics table (if implemented)
Timer (if implemented)
Machine player (if implemented)
Test Strategy
We plan to employ mostly white-box unit tests in order to test the application, using Visual Studio’s built-in unit-testing
framework. Each of the following major classes will have at least one unit test:
Game
GameBoard
Player
GameStatistics
Test Cases
13
Feature 2: Validate Basic Moves (legal moves only)
Test Case ID Test Case Name Steps Expected Result
2.1 Test basic moves 1. Place an X at TopLeft Markers are present at
2. Assert that the board expected positions
records an X at TopLeft (assertions pass)
3. Place an O at Center
4. Assert that the board
records an O at Center
2.2 Disallow player from 1. Place an X at TopLeft Move 2 fails
placing his marker on 2. Place an O at TopLeft
a square occupied by
his opponent
2.3 Disallow player from 1. Place an X at TopRight Move 3 fails
playing on his own 2. Place an O at Center
occupied square 3. Place an X at TopRight
Open Issues
1. If dev implements the networked play feature, we’ll need to think about some level of security test coverage.
This is not currently covered in the test plan.
16