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.

 

  1. A process description breaks the work needed to perform some task into a series of phases.
    1. Explain the DIFFERENCE between “Actual” and “By-product” sections in a process description (like in the Input section below).

 

The difference is in how tangible the results are. The Actual section describes understandings while the By-Product section describes tangible documents.

 

 

 

    1. The Rational Unified Process lists four phases: Inception, Elaboration, Construction, and Transition and then defines multiple iterations within each phase. How does passing through the activities within a phase multiple times improve quality as opposed to one pass that simply takes more time?

 

Multiple passes provides the opportunity for lessons learned later in an iteration to be used to correct mistakes in earlier tasks.

 

 

 

 

    1. In the outline of a phase shown below, insert a one sentence explanation for each item listed.

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

 


 

  1. We have tentatively decided on the Model-View-Controller (MVC) architecture as the internal architecture for our plug-in.
    1. This architecture uses the observer pattern. Explain which parts of the MVC  architecture participate in this pattern and how they participate. What advantage does the pattern give to systems built using the architecture?

 

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.

 

 

 

 

 

    1. If we use the three major divisions in the architecture, the model, the view, and the controller, to assign teams, describe the types of skills that each team should have that is unique to their portion of the architecture.

 

 

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.

 

 

 

 

 

 

    1. We first identified the Eclipse plug-in architecture, then the MVC architecture inside of that. What did your investigation of tables say about the architecture inside each of the three major divisions? For example, how should an orthogonal array be represented?

 

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.

  1. We used the use case notation of UML to capture our requirements for the OATS plug-in.

 

    1. The template we used for the text portion of the use case included a section in it that listed the “pre-conditions” for the use case. What does it mean to have a pre-condition for a use case?  Give an example of a pre-condition for the use case: The user maps a problem array onto an orthogonal array creating a mapped array written in terms of the problem vocabulary.

 

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.

 

 

 

 

 

 

    1. There are two phases to requirements engineering: elicitation and analysis. Explain what happens in each of these phases. How do each of these phases relate to developing a use case model?

 

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.

 

 

 

 

 

 

 

    1. Consider the 4 major phases of RUP: Inception, Elaboration, Construction, and Transition. What is the role of requirements engineering in each of these phases.

 

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.

  1. The strategy pattern (a sample of which is the code below question 5) allows the manner in which something is being computed to be changed by simply instantiating a different class.
    1. Before a design is implemented, a review process helps ensure that the design solves the problem and uses patterns correctly. We conducted a review of the first draft of the use case model. What types of defects did we expect this review to identify?

 

Missing use cases, uses that were not complete, and uses that contradicted each other.

 

 

 

 

    1. In a review we consider whether the elements of the model are consistent and the total model is complete. Explain what it means for a model to be complete and for the elements to be consistent.

 

 

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.

 

 

 

 

    1. Draw the class diagram for the code given below problem 5.

 


  1. The architecture defines a basic structure for a software-intensive product but it also defines the non-functional requirements.
    1. List two non-functional requirements you identified for the OATS product. Explain what each means.

 

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.

 

 

    1. For one of those non-functional requirements, describe how an architecture could be constructed to enhance this requirement.

 

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.

 

 

    1. Draw a sequence diagram for the code given below that captures all of the interactions in the “Main” method in the GameEngine class. (use back)

 

 

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 france = new Team("France");

    private static Team italy = new Team("Italy");

 

       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();

          }

}