In this assignment you will go through the steps in the Software Engineering process. The assignment is based on the card game Hearts.
The Game
Hearts is a card game with any number of players, usually 3, 4 or 5. The object of the game is to not accumulate points--the lowest score wins.
You play until one player's score reaches 100 or more.
For each hand you shuffle the cards and deal them card by card to each player until all the cards are dealt if the number of cards (52) is divisible by the number of players or the cards are dealt until each player has an equal number of cards. You place any remaining cards face down in the middle of the table.
At the beginning of of each hand each player chooses three cards to give to another player. In the first hand you give the cards to the player on your right. In the second hand you give the cards to the player to your right. In the third hand you give the cards to the player opposite you. In the fourth hand you don't give the cards to anyone. This pattern repeats itself for successive hands.
If you have the Two of Clubs you play it as the first card in the first trick. If no one has the Two of Clubs but you have Three of Clubs you play it as the first card in the first trick. (The Two must be in the remainder pile.) Etc.
In each trick each player plays a card. You must play a card from the suit that was first played if you have one. Otherwise you can play any card. You win the trick if you play the highest card. You keep the cards played in that hand and accumulate any points associated with those cards. The highest card in a suit is the Ace; the lowest card is the Two.
If you win the first trick you get the remainder cards from the middle of the table along with any points associated with those cards.
You can not play any of the penalty cards in the first hand unless all you have in your hand are penalty cards. If you win a trick you play the first card in the next trick. You can't play a penalty card as the first card in a trick until a penalty card has been played in a previous trick unless all you have are penalty cards.
Once all the cards are played you count one point for each Heart you have accumulated and count 13 for if you have the Queen of Spades. Add these to your point total. If during the game you accumulate all the penalty cards--all the Hearts and the Queen of Spades--subtract 26 from your point total.
The game ends when someone reaches or passes 100 points. If you have the lowest number of points you win.
Assignment
This assignment will start as individual work. Part way through the term groups of students will be organized into teams. I will assign team members. As we start the course there are 15 students registered in the course. Pending change in enrolment there will be five teams of three members.
Ongoing Exercise Assignment Journal
Keep a journal that describes the process you went through to complete each of the exercises. At each step in the process document the reasons for decisions made. Describe the process. The alternatives considered. The obstacles met. How they were overcome. Etc.
For example in Exercise 1, describe how you played the game. Did you
read the specification and then
set it aside and try to play? Did you read the specification step by
step and
apply each individual step? Did someone assume a leadership role and the
leader then
read the specification and direct the
players or did the individual players read the specifications as they were
needed?
The journal is
an individual assignment, not a team project. Hand in your journal with
each exercise.
Exercise 1 (week 3) Reading Specifications
Find three friends who have never played Hearts, four if you have played Hearts. Find a deck of playing cards. Using the game description, "specification", above play the game. Make notes on where there are problems in the specification, errors, omissions, ambiguity, contradictions.
Exercise 2 (week 4) Requirements Elicitation
Find an experienced Hearts player maybe in your FaceBook account or in
residence and quiz them about the rules of the game. (No strategy at the
moment.) Rewrite the specifications as completely and correctly as
possible. Do not just transcribe the experienced player's description.
Rewrite the specifications from Exercise 1 with corrections and
additions.
Provide UML Use Case diagrams for the functionality of the game.
Exercise 3 (week 6) Identify Objects
Identify the objects in a simulated game. Make a case for your choice of objects. Include UML Class Diagrams for your objects. Write Java code for the different classes in your tournament program that simulates the game. Do unit testing of your classes. (There is no need at this point to do any more than unit testing.)
Exercise 4 (week 8) Team Building and Communication
(At this point teams will be assigned to parts of the project.) Each member of the team makes a pitch that his/her code is used as the basis of the team's submission. Define the interface between the game part of the program and the players part. Refactor as necessary.
Immediately after the due date each team must provide their interfaces to the other teams. Negotiate with the other teams to reach a common interface for the game team and the player teams.
Exercise 5 (week 10) Complete Coding and Testing
The player teams will write a driver program that runs a tournament, tests and accumulates data regarding performance. The game team writes a player stub that feeds data to the game program. Make sure that your player works with the game or your game works with the players. Provide integration testing and system testing.
Immediately after the due date republish your modified interface (or a statement indicating that your interface has not changed.)
Exercise 6 (week 12) Preparation for the Competition
Go back to the expert Hearts player from Exercise 2 and ask for tips on winning strategies, picking cards to pass, order to play the cards in your hand. Integrate these strategies into your program. Add to the accumulation of data any other interesting statistics. We will run your code with other implementations.