Lecture23 - Q1(True\/False Black-box tests can be used to find aliasing errors that occur when two different formal parameters of a method both refer to

Lecture23 - Q1(True/False Black-box tests can be used to...

This preview shows page 1 - 6 out of 17 pages.

Q1. (True/ False) Black-box tests can be used to find aliasing errors that occur when two different formal parameters of a method both refer to the same object. Q2. ( True /false) One can use the Strategy design pattern to encapsulate an algorithm as an object. Q3. What is the first phase of the software life cycle? a. Testing b. Coding c. Design d. Specification e. Documentation Q4. You have a subsystem that consists of multiple classes, making it hard to use. Additionally, the implementation of many of the classes is likely to change, but the interfaces are stable. You want to make it easy for the users of this subsystem to work with it. What design pattern might you apply to facilitate this? Q5. What is the importance of building a system with low coupling?
Image of page 1
Q6. Given the following Java code, draw its UML class diagram. Provide as many details as possible public class Plane { public Propeller[] myPropellers; public Engine myEngine; } public class Propeller { public double thrust; Engine power : double mileage : int Plane myPropellers : Propeller[ ] myEngine : Engine * 1
Image of page 2
Q7. Design Pattern recognition Consider the following UML diagram. (a) First, identify the pattern in the diagram. (b) Second, identify the participants in the diagram and indicate their responsibilities. 3
Image of page 3
Q8. Recording companies consider band and musician to be type of artist. A band consists of two or more musicians. Each song has an artist who wrote it. An artist can write a number of songs but each song is written by exactly one artist. A CD is composed of a number of tracks, each of which contains exactly one song. However, a song can be used in any number of tracks, because it could appear on more than one CD. Name the classes and draw a UML class diagram showing classes and relationships between classes with appropriate multiplicities. CD 1 Track 1 * * Song * 1 Artist Band Musician 2.. 1 4
Image of page 4
Image of page 5
Image of page 6

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture