ICS 52 - Introduction to Software Engineering
Fall, 1999

Final Exam

  1. (5 points each, 25 points total) Define each of the following terms, as used in software engineering.
    1. Test case

    2. Reusability (the software quality)

    3. Fault (in testing)

    4. Program Family

    5. Testing oracle

  2. (12 points) Determine the words (in five cases) or short phrase (in one case) that best match (a) through (f) in the following paragraph, and write them below.

    The set of services that each module provides to its ____(a)____ (i.e. the purpose of the module as it relates to other modules) is called its ____(b)____ . The corresponding services are said to be ____(c)____ by the module and ____(d)____ by its ____(a)____ The way these services are accomplished by the module is called the module's ____(e)____ . A clear distinction between the ____(b)____ of a module and its ____(e)____ is a key aspect of good design, because it supports the ____(f)____ .

    1. (a)
    2. (b)
    3. (c)
    4. (d)
    5. (e)
    6. (f)

  3. (8 points) The book states that ``every software quality must be verified.'' Choose a software quality other than correctness, and briefly describe how it might be verified.

  4. (16 points) You have been assigned to design test cases for black box testing of a vending machine that sells several different kinds of soda pop. Focus on the functionality encountered by the typical customer.
    1. What is the input domain?

    2. For the input domain you defined in (a), name a specific basis for dividing the domain into subdomains.

    3. Using the basis from (b), name three or four subdomains.

    4. For each subdomain from (c), give a test case input and the expected output.

  5. (15 points) Recall that for positive b, a raised to the -b power equals 1 divided by a raised to the b power.

    The pow method is defined to take two integer parameters, and return the result of raising the first parameter to the power of the second paramter. Assume that the pow method is invoked elsewhere in the program with this statement: System.out.println(pow(i, j));, where i and j are ints.

    	double pow(int a, int b)
    	{
    	   boolean inverse = false;
    	   if (a < 0)
    	     {
    	        inverse = true;
    	        b = -b;
    	     }
    	   double result = 1.0;
    	   for (int i=0; i<b; i++)
    	       result *= a;
    	   if (inverse)
    	       result = 1.0/result;
    	   return result;	
    	}
    
    1. (5 points) There is an error in pow. What is it?

    2. (5 points) The method could generate a fault that does not lead to a failure. Explain how, specifying the parameters, the fault, and why no failure occurs.

    3. (5 points) Give an example of input parameters that cause a failure, and say what the failure is.

  6. (12 points) Draw and label a diagram representing the ``spiral'' software process model.

  7. (2 points) According to the textbook, although design activity should be a blend of top-down and bottom-up steps, it is recommended that the description of the resulting design be given (choose one)
    1. in a top-down fashion.
    2. in a bottom-up fashion.
    3. using the yo-yo approach.
    4. in an object-oriented fashion.
    5. in a manner that facilitates acceptance testing.

  8. (2 points) If you select test cases so that every branch in the program's control flow is executed at least once, then you are (choose one)
    1. using the spiral process model.
    2. following the node coverage criterion for test cases.
    3. following the edge coverage criterion for test cases.
    4. guaranteed to catch all bugs in the program.
    5. always going to need an infinite number of test cases.

  9. (2 points) Suppose the function double sqrt(double x) is defined as ``returns a double y such that y times y equals the parameter x.'' This definition is (choose one)
    1. an operational definition.
    2. a formal definition.
    3. a descriptive definition.
    4. a declarative definition.
    5. a top-down definition.

  10. (2 points) When estimating the size of software by the number of lines of code it comprises, the ``productivity paradox'' is that (choose one)
    1. longer programs often have more functionality.
    2. high level programming languages tend to have more functionality per line.
    3. user-interface code is often very few lines.
    4. senior programmers usually write less code.
    5. information hiding leads to more lines of code.

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

  12. (2 points) One purpose of declaring some methods and variables as private in Java is to promote (choose one)
    1. information hiding.
    2. user friendliness.
    3. top-down design.
    4. an acyclic USES hierarchy.
    5. interoperability.