CpSc 372

Exam 2

 

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 class notes, handouts, copies of submitted homework. You have from 12:30 am until 1:45am for the exam.


 

 

  1. Concurrency and design
    1. Describe what is being proved in the Reasoning Table that is shown on the last page of this exam.

 

    1. The Android SDK has emulators and the AADL community use Petri Net simulators. What are the advantages of using these techniques for evaluating a design and/or program?  What are the disadvantages?

 

    1. In unit testing we use levels of coverage to describe how thorough the testing has been. “All statements,” “all branches,” and “all paths” are three levels of coverage. Describe the difference between “all branches” and “all paths.”

 

 

 

d.      The proof shows that the program correctly implements the specification by not changing the entering parameter value.

 

e.       The SDK provides more faithful user interface and the Petri Net representation provides a more faithful execution of the inter-process communication. The disadvantage is that the behavior modeled is more coarse grained than actual execution.

 

f.       “All paths” executes every way to traverse the code including the maximum number of traversals of all iterative statements while “all branches” only covers at least one way to get to each decision statement but not all ways to get to each decision

  1. architecture
    1. We used a Timed Petri Net representation to simulate an AADL architecture. How would using that simulator help us determine that deadlock is possible in a design? How would that information help us correct our design?

 

    1. When an ATAM is conducted to evaluate an architecture, quality attribute scenarios are used as input. How could “coverage” be defined and measured in this situation?

 

    1. The client/server pattern separates users of the system from the main computation of the system. How would the MVC pattern be used to further decompose a system that has been broken into client and server?  

 

Deadlock would be represented by a halt to the forward traversal along the petri net. Where it stops helps determine where the problem is located.

 

The percentage of attributes for which the architecture is analyzed.

 

The MVC pattern would be used to decompose the client. The model would handle the interaction with the server to hide where the data comes from  from the views and controllers.

 

 


 

  1. Architectural mechanisms

 

    1. Inheritance is an essential ingredient in making the plug-in design pattern work. How does it contribute to this pattern?
    2. JUnit makes use of inheritance. Describe how the test cases for a product line of plug-ins could be efficiently developed using JUnit. Explain what is efficient about it.
    3. AADL allows us to build a representation of the architecture as we create it. Below are the two pieces that define a process element in AADL. Explain why there are two pieces. Under what circumstances are the elements defined in the top part used in the bottom part?

 

  process DefaultClientProcess

    features

      put: in event data port;

      get: out event data port;

  end DefaultClientProcess;

 

  process implementation DefaultClientProcess.impl

    subcomponents

      clientThread: thread interactWithClient.basic;

    connections

      connection2: event data port put -> clientThread.receiveData;

      connection1: event data port clientThread.requestData -> get;

  end DefaultClientProcess.impl;

 

 

The plugin extends (inherits from) an abstract plugin. Then the new plugin can be polymorphically passed as a parameter into the platform.

 

The Junit hierarchy of test classes can follow the same hierarchy as the plugins hierarchy.

 

The two pieces are the specification and the implementation. By separating, there can be multiple implementations of each specification. The elements of the specification are  used at the beginning and the end of the implementation to show the inputs and the outputs of the implementation.

 

 


 

 

  1. Design
    1. A specification written by a team using the “design by contract” approach provides the contract. Describe the ROLE of each item below in the contract:

 

Pre-condition

Post-condition

Invariant

 

    1. Fault models guide the development of test cases but they can also guide the design process. How is information from the fault model used in the test process? In the design process?

 

    1. RUP is an iterative incremental process model. How would the SONAR tool be incorporated into a project using the RUP process model?

 

Pre: defines the conditions under which the contract applies

Post: defines the guarantee of service provided the pre-condition is met

Invariant: the conditions that do not change for the life of the contract

 

Some of the test cases should be devoted to searching for the faults that are defined in the fault model. The design review should search to see if the design contains these faults.

 

SONAR would be executed after each code check in or at least at the end of each iteration.

 


 

 

 

  1. Software product line and process
    1. Product line organizations are divided into asset development and product development. Why divide the team into two groups? What is the purpose of each group?

 

    1. List one variation mechanism used in developing assets for a software product line. Classify it as either static or dynamic, and then explain why it is (static or dynamic).

 

    1. Consider the 4 major phases of RUP: Inception, Elaboration, Construction, and Transition. What is the role of testing in each of these phases? List example testing activities for each phase and the objectives of each of those activities.

 

 

The two groups need to have different perspectives. The core asset team takes the long term investment view and consider all products while the product builders take a short term focused view on one product.

 

Inheritance is static

 

In the Inception phase testers help determine if requirements are testable; in the elaboration phase test cases are written to help ensure that the specification is complete; in the construction phase actual code is tested ; in the transition phase system and acceptance tests are conducted as the product is deployed

For all questions about reasoning tables use this example.

 

Procedure Inc_Dec(I:integer)

            Requires Min_Int <= I and

            (I+1) <= Max_Int

            Ensures I = #I

Procedure

            Increment(I);

            Decrement(I);

End

 

Reasoning Table

 

State

Code

Assume True

Confirm True

0

 

Pre_condition of Inc_Dec

I0+1 <= MAX_Int

Pre_condition for Increment

I0<=MAX_int

 

Increment(I)

 

 

1

 

Post_condition of Increment

I1=I0+1

Pre_condition for Decrement

MIN_int<=(I1-1)

 

Decrement(I)

 

 

2

 

Post_condition for Decrement

I2=I1-1

Post condition for Inc_Dec

I2=I0

 

<= (less than or equal to)