ICS 52 - Systematic Software Construction
Fall, 1997

Midterm Exam



  1. (6 points each, 36 points total) Define each of the following terms, as used in software engineering.
    1. Module
      Hides a secret; communicates through well-defined interfaces; a software fragment; a provider of computational resources or services; a collection of routines, data, objects.

    2. Process Model
      Defines the software life cycle; prototype of the process or procedures used to build, deliver, and evolve the software product; the order in which the steps to build software are performed.

    3. Abstract Data Type
      A module that exports a type, along with the operations that must be invoked to access and manipulate objects of that type.

    4. Separation of Concerns
      Partitioning different aspects of a problem; addressing the complexity of a system by segregating aspects which differ in time, by quality (e.g. efficiency).

    5. Robustness
      The quality of behaving reasonably even in circumstances that were not anticipated or stated in the requirements definition.

    6. Abstraction
      Identifying the important aspects of a phenomenon and ignoring its details

  2. (3 points) The textbook states that to achieve modular composability, decomposability, and understanding, modules must have (choose one)
    1. low cohesion and low coupling.
    2. low cohesion and high coupling.
    3. high cohesion and low coupling.
    4. high cohesion and high coupling.
    5. either (a) or (d).

  3. (3 points) Which of the following is not one of Boehm's Top 10 software risk items?
    1. Personnel shortfalls.
    2. Undue emphasis on requirements specification.
    3. Shortfalls in externally furnished components.
    4. Developing the wrong user interface.
    5. Gold plating.

  4. (3 points) Why would a class in Java contain a field designated as private (choose one)?
    1. So that it can be accessed by inherited classes.
    2. So that it retains its value for the life of the program.
    3. So that it cannot be accessed by code outside the class.
    4. For reasons of efficiency.
    5. Trick question: fields are not private, only classes are private.

  5. (21 points) Identify and briefly discuss three benefits of using the spiral model as opposed to the waterfall model.

    1. Focuses early attention on the option of re-using existing software or software components. In the upper left quadrant and upper right quadrant, attention is on considering alternatives, constraints, and risks.

    2. Accommmodates preparation for product growth, evolution, changes.

    3. Incorporates quality objectives as integral parts of the process and not as side-effects.

    4. Focuses on eliminating errors and unattractive alternatives early on.

    5. Answers the process ``how much is enough'' question. The spiral starts with a hypothesis that a particular goal (or set of goals) could be improved by a software effort. It terminates when the hypothesis is proved false (cost of continuing judged greater than benefit) or true (installation).

    6. Maintenance is not a second-class citizen in the process, but starts a new cycle.

    7. The incremental approach is more suited towards families of applications.

    8. It encourages a prototyping approach which is well suited for addressing user interfaces. Gets early user feedback based on prototypes.

    9. Its prototype-based approach avoids the risk of spending too much time on not-so-important aspects and helps concentrate attention on the relevant issues and risks.

    10. Recognizes that specification and implementation are inevitably intertwined.

    11. According to some experiments, took 40% less development time and resulted in a product with roughly 40% less source instructions.

  6. (10 points) A Java class can be declared ``abstract,'' as in
    abstract class Shape { . . . }.
    1. From the Java compiler's perspective, what are the implications of a class being abstract?
      An abstract class cannot be instantiated. If class X is abstract, then new X() is not allowed.

    2. From the software architecture point of view, why would the software architect decide to use an abstract class?
      The class represents a collection of concepts, or a category, or an abstract concept.

      The purpose of the class is to provide fields and methods which are common to several related classes, which extend the abstract class.

      An abstract class may have an ``is composed of'' relation to the classes that extend it.

      Insures common methods exist in inherited classes, without having to provide bodies of those methods in the parent, abstract class. Acts as a template for child classes.

  7. (24 points) Suppose you decide to describe a car. You take a modular approach, where each module is a small cube 15 inches on a side. Discuss this modularization in terms of how strongly linked all of the elements within a module are (cohesion), and in terms of the interdependencies between modules (coupling). Draw general conclusions about how one should modularize a complex system.

    (See the textbook, p. 51.) The modules will tend to have very little cohesion, because most 15 inch cubes will contain several quite different parts of the car, e.g. base of a seat, interior carpeting, body, and axle. The modules lack cohesion because they do not follow the structure of the car. Many modules will contain parts that are linked only in physical proximity, and not in function, use, design, etc.

    The coupling of the modules will vary greatly, but will tend to be larger than desirable. Much will depend of the exact alignment of the 15 inch cubes, and leaving such an important feature to chance is not good. For instance, if the battery happens to be split among two or more modules, then they will show high coupling, because it will be impossible to understand them, or for them to function, without referencing the others. (12 points for first half.)

    The modules of a complex system should not be arbitrary or designed in a ``one size fits all'' manner. Placing elements in the same module merely because of physical proximity is a poor choice. Module structure should be based on the form and function of the system. A modularization based on form might put the tires in one module, the gas tank in another, etc. A modularization based on function or user need might place elements designed to attract families with small children (built-in car seats, child-proof locks, Barney-themed paint) into a common module. Modularization should follow the principle of separation of concerns, and concerns in a car are not demarcated by 15 inch boundaries. The 15 inch cube modularization is not useful for describing a car because the modules will tend not to be understandable when considered individually. A complex system may benefit from a hierarchical decomposition, where high level modules (e.g. body, engine) are themselves decomposed into modules, based on the same principle of separation of concerns.