CS 172: Software Engineering
In-Class Examination
Closed-Book, 75 minutes, Winter 2001
General Instructions
-
Before you answer any questions, write your name and perm number.
-
Read each question carefully. Make sure that you clearly understand
each question before answering it.
-
Use a pen to write your answer. You may wish to work out an
answer on scratch paper before writing it on your answer page; answers
that are difficult to read may lose points for that reason.
Q |
Value |
Score |
Q |
Value |
Score |
Q |
Value |
Score |
1 |
7 |
|
6 |
7 |
|
11 |
7 |
|
2 |
7 |
|
7 |
8 |
|
12 |
7 |
|
3 |
7 |
|
8 |
7 |
|
13 |
7 |
|
4 |
8 |
|
9 |
7 |
|
14 |
7 |
|
5 |
7 |
|
10 |
7 |
|
|
|
|
Total |
|
|
Total |
|
|
Total |
|
|
-
In a use case diagram, what is an actor?
An actor models an external entity that communicates with the system:
-
User
-
External system
-
Physical environment
-
The specification of a use case includes what elements (give a template)?
A use case consists of:
-
Unique name
-
Participating actors
-
Entry conditions
-
Flow of events
-
Exit conditions
-
Special requirements
-
Name 2 kinds of relationships between use cases.
<<extend>> A use case extends another use case. The extend
relationship represents exceptional or seldom invoked cases.
<<include>> A use case uses another use case. The include
relationship represents behavior that is factored out of the use case
(“functional decomposition”).
<<generalization>> A use case is an abstract generalization of
several use cases. It represents reused information that each particular
use inherits from the generalization.
-
Problem statement: A stock exchange lists many companies. Each company
is identified by a ticker symbol, and tracks the exchanges on which it
is listed.
-
Give a class diagram (no operations needed).
-
Give skeleton Java code.
Class diagram is many-to-many: StockExchange *---- * Company.
Java code:
public class StockExchange
{
public Vector m_Company = new Vector();
};
public class Company
{
public int m_tickerSymbol;
public Vector m_StockExchange = new Vector();
};
-
What is a functional requirement?
A requirement that the system must have. It describes an interaction
between the system & an actor[s]. It avoids specifying how the system
works, describing rather what the system does.
-
What is a nonfunctional requirement? Give 2 examples.
It describes a constraint on the system's behavior. Examples include:
Performance: The transaction response time is less than 2 seconds.
Accuracy: The values for sine are within 10-7 of actual
values.
-
Give & define 4 desirable properties of a requirement document (that
we discussed in class or are mentioned in the book).
Correct - The client agrees that it represents the reality
Complete - The client agrees that all relevant scenarios are described
Consistent - Each requirement is represented consistently, albeit in
varying levels of detail.
Unambiguous - There is only 1 way to interpret the specification
Realistic - All features can be implemented subject to all constraints
Verifiable - Requirements & constraints are testible
Traceable - For each system function there is some requirement[s].
For each requirement there is some system function[s]
-
Give the entity that probably is being described in a problem statement
by a:
-
Improper noun
class
-
Doing verb
method
-
Being verb
inheritance
-
Adjective
attrbute
-
Define coherence.
It measures the interdependence of classes. A subsystem is coherent
when its classes are related via associations. Low coherence: Lots of miscellaneous
& auxilliary objects, few or no associations.
-
Define coupling.
Coupling measures dependencies between subsystems. Two subsystems are
coupled to the extent that modifications to 1 subsystem impact the other
subsystem.
-
Describe a good system design with respect to coherence and coupling.
Each subsystem should be highly coherent. Subsystems should be loosely
coupled.
-
Draw a class diagram representing a book defined by the following statement:
“A book is composed of a preface, a table of contents, a body, and a number
of appendices. A body consists of a number of chapters.” Focus only on
classes and relationships.
The classes and relationships are: Book (1) has (*) Parts (1) has (*)
Chapters.
-
Is the CVS automatic merge always safe? Explain/illustrate.
No, it is not always safe. It may be that 2 developers have modified
exclusive lines of the same file, but the logic is related. For example,
one developer could delete a data declaration that the other developer
uses in an assignment statement. CVS would not object.
-
What is the purpose of modeling?
The purpose of modeling is to reduce complexity by building a simplified
representation of reality which ignores irrelevant details. What is relevant
or not is defined by the questions the model will be used to answer.