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 will need a picture ID to turn in your exam.
You can have a laptop in the exam. You may have the textbook, class notes, handouts, copies of submitted homework. You have from 12:30 pm until 1:45pm for the exam.
Abstraction is useful because it allows the designer to eliminate certain details and focus on essential ideas. UML supports abstract class definitions and it supports the separation of specification and implementation. Java has an abstract keyword for defining classes. Java also has an interface construct.
In all cases an interface hides complexity of implementation. The GUI has nice buttons rather than having a user invoke methods. They are different in that they have support at various levels of abstraction.
Each class has a state machine. The state machine defines a
set of sequences that can be captured in sequence diagrams. The transitions in
the state machine correspond to the methods defined in the class.

Class inheritance provides a relationship among type definitions that allow instances of one type to be recognized as legitimate substitutes for another type.
The pre-condition in class S cannot require anymore than the pre-condition in class T. This is because if we want to substitute an instance of S in place of an instance of T the instance of S cannot expect anything additional.
Modularity enhances the principle because the principle
requires a clearly specified unit that is to be substituted for and a clearly
specified unit to be the substitute.


Cancel\[total>0]\{total=0; return total@pre;}
We have inheritance hierarchies and aggregation hierarchies.
Inheritance hierarchies are used to build flexible designs that allow
substitutions. Aggregation hierarchies allow the implementation of an element
to contain instances of other elements whose implementations include instances
of elements. Each of these types of hierarchy enhances the flexibility and
modifiability of the system while degrading performance.
Two associated blocks in a SysML block diagram leads to multiple system definitions in AADL with interactions between some of those. Each system will generate multiple classes in UML some of which will be associated and have interactions. Those classes are then implemented in Java and the associations are implemented as methods in the classes.
A constraint establishes requirements for the element to which it is attached. The guard on any transition in the state diagram is a constraint.
The scope of interest changes as the notation changes. The
Systems Engineer views the entire system, the Architect views the entire
software but not the hardware and the Designer remains focused on a portion of
the software. They communicate by translations of the models from one notation
to another.
The listener pattern decoupled the hardware from the software. It allowed easy changes on both sides. Modifiability was enhanced. Performance degraded.
Each machine driver is singleton so that there is no chance to have multiple drivers communicating with one piece of hardware.
Inception: test planning
Elaboration: test specification
Construction: test implementation and execution
Transition: Acceptance testing