CS 172: Software Engineering

In-Class Examination

Closed-Book, 75 minutes, Winter 2001

General Instructions

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
  1. In a use case diagram, what is an actor?

  2. An actor models an external entity that communicates with the system:
  3. The specification of a use case includes what elements (give a template)?

  4. A use case consists of:
  5. Name 2 kinds of relationships between use cases.

  6. <<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.
  7. 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.
  8. 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();
    };
  9. What is a functional requirement?

  10. 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.
  11. What is a nonfunctional requirement? Give 2 examples.

  12. 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.
  13. Give & define 4 desirable properties of a requirement document (that we discussed in class or are mentioned in the book).

  14. 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]
  15. Give the entity that probably is being described in a problem statement by a:
    1. Improper noun

    2. class
    3. Doing verb

    4. method
    5. Being verb

    6. inheritance
    7. Adjective

    8. attrbute
  16. Define coherence.

  17. 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.
  18. Define coupling.

  19. Coupling measures dependencies between subsystems. Two subsystems are coupled to the extent that modifications to 1 subsystem impact the other subsystem.
  20. Describe a good system design with respect to coherence and coupling.

  21. Each subsystem should be highly coherent. Subsystems should be loosely coupled.
  22. 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.

  23. The classes and relationships are: Book (1) has (*) Parts (1) has (*) Chapters.
  24. Is the CVS automatic merge always safe?  Explain/illustrate.

  25. 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.
  26. What is the purpose of modeling?

  27. 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.