CpSc 372
Exam 1
Name______________________________________________
Answer any FOUR of the five questions. Place a large X on the question you are omitting. If you answer all five, the one on which you score the best will NOT be counted. All questions are counted the same: 25 points each. Answer all parts of each question.
You can not have a laptop in the exam. You may have the textbook, class notes, handouts, copies of submitted homework. You have from 2pm until 3:15pm for the exam.
The difference is in
how tangible the results are. The Actual section describes understandings while
the By-Product section describes tangible documents.
Multiple passes
provides the opportunity for lessons learned later in an iteration to be used
to correct mistakes in earlier tasks.
1. <<Phase name>>
1.1.
Responsibility
Lists roles in the phase and who has responsibility for
each activity.
1.2.
Input
1.2.1.
Actual
The knowledge the team should bring to this phase
1.2.2.
By-product
The actual documents that should be available for
starting this phase.
1.3.
Output
1.3.1.
Actual
The knowledge that participants in this phase should
gain during the phase.
1.3.2.
By-product
The documents that will be available when this phase is
complete.
1.4.
Exit Criteria
1.4.1.
Proceed to next
phase
If the criteria
stated in this section is true the project proceeds to the next phase in the
process.
1.4.2.
Iterate back to
phase
If this criteria is true then
the project will repeat some previous phase.
1.5.
Metrics
1.5.1.
Raw data
These are the actual counts such as lines of code or
hours workd.
1.5.2.
Derived measures
This is a value
computed by combining raw data such as LOC/developer hour
The model and view
parts participate. The View is the Observer and the Model is the Subject. This
pattern is useful when changes to the Subject cause other changesin
the system to become necessary.
The model team would
need skills in the domain of the application; the view team would need skills
in visualization; and the controller team would need hardware interfacing and
user interface techniques.
A table could be the best representation in both the model and the view
components. The view would actually have a table viewer. The controller would
not be affected by the choice of representation.
The pre-condition
describes what must be true before that use of the system will be allowed.
Pre-condition: A problem array must have been created.
The elicitation phase captures
information from each of the customers or clients about what the product is
supposed to do. In the analysis phase these requirements are consolidated,
duplicates eliminated, contradictions reconciled.
During elicitation,
the basic model is created. During analysis this diagram is revised. Some use
cases will be removed, some expanded to cover a more
broad use.
During the Inception
phase a very high-level notion of requirements allows managers to estimate who
they need to help build the system and how much it will cost. During
Elaboration the requirements are developed in detail. During Construction the
requirements are revised as mistakes are discovered. During Transition the
requirements are used as input into maintenance and marketing activities.
Missing use cases,
uses that were not complete, and uses that contradicted each other.
The elements of a
model are consistent if no element contradicts another. The model is complete
if all concepts in the real world are represented someplace in the model or are
out of scope for that particular model.

Accurate – the mapping
perform by OATS from problem to orthogonal array must be correct.
Performance – the
system must respond at a rate that never requires a human user to wait.
The architecture is
would be designed to have the fewest possible steps from the human request to
the corresponding computation and back to the human.
CODE for questions 4 and 5
public class GameEngine {
//Create few strategies
private static AttackStrategy attack = new AttackStrategy();
private static DefendStrategy defend = new DefendStrategy();
//Create our teams
private static Team
private static Team
public static void main(String args[]){
//Let us create a team and set its strategy,
//and make the teams play the game
//Now let us set the strategies
france.setStrategy(attack);
italy.setStrategy(defend);
//Make the teams start the play
france.playGame();
italy.playGame();
//Let us change the strategies
france.setStrategy(defend);
italy.setStrategy(attack);
//Make them play again
france.playGame();
italy.playGame();
}
}
public interface TeamStrategy {
//AlgorithmInterface : This is the interface provided
public void play();
}
public class AttackStrategy implements TeamStrategy {
public void play() {
//Algorithm to attack
System.out.println(" Playing in attacking mode");
}
}
public class Team {
//Just a variable to keep the name of team
private String teamName;
//A reference to the strategy algorithm to use
private TeamStrategy strategy;
//ContextInterface to set the strategy
public void setStrategy(TeamStrategy ts){
//Set the strategy
strategy = ts;
}
//Function to play
public void playGame(){
//Print the team's name
System.out.println(" - " + teamName);
//Play according to the strategy
strategy.play();
}
public Team(String newTeamName){
//Set the team name to use later
teamName = newTeamName;
strategy = new DefendStrategy();
}
}
