2

------Software Engineering Foundations ------

Practice Problems: Lectures 10-17

1. a. (3 pts.) The term “information hiding” is often associated with the

notion of encapsulation. David Parnas, however, suggests a more

general interpretation. Give his definition of “information hiding”.

b. (4 pts.) What are aspects (Aspect-Oriented Software Development)

and what is their relationship with “information hiding”?

2. (3 pts.) In Chap. 14 (“Object-Oriented Design”) of his text,

Sommerville notes that “extensive up-front design can be criticized

because the extensive analysis and design effort is not well suited to

incremental development and delivery. So-called agile methods have

been developed to address this problem, and these drastically reduce

or completely eliminate the object-oriented design activity.” Briefly

describe Sommerville’s view regarding this issue?

3. (2 pts.) One of the ways to support software reuse mentioned by

Sommerville is “Legacy system wrapping.” Briefly describe the idea.

4. (2 pts.) One of the “four essential elements of design patterns” is

described as “consequences”. What important information should be

documented in the description of a design pattern’s “consequences”?

5. Consider the UML sequence model below from Sommerville’s weather

mapping system example.

a.  (2 pts.) Briefly describe what is being modeled in the context of the weather mapping system. (Be specific.)

b.  (2 pts.) How is time represented in the model?

c.  (2 pts.) What do the labeled arrows linking the vertical lines represent?

d.  (2 pts.) What do the thin (vertically oriented) rectangles represent?

6. (4 pts.) Sommerville notes that expected system lifetime is a

key factor to consider when planning software reuse. What, in

particular, are his recommendations regarding software reuse when

developing a long-lifetime system?

7. (4 pts.) What, according to Sommerville, is the distinction between

“verification” and “validation”?

8. a. (2 pts.) To which of the following are static V&V techniques

applicable? (Circle those for which such techniques apply.)

requirements prototype high-level formal detailed program

specification design specification design

b. (2 pts.) To which of the following are dynamic V&V techniques

applicable? (Circle those for which such techniques apply.)

requirements prototype high-level formal detailed program

specification design specification design

c. (3 pts.) Briefly explain your selections above.

9. (3 pts.) Many studies have shown that code inspections can be much

more effective than machine-based testing in uncovering program

errors. Briefly explain why this is so.

10. (3 pts.) The idiom “Don’t kill the goose that lays the golden eggs”

was used in class to make a point about reviews/inspections. Briefly

explain what the point was.

11. (3 pts.) Briefly explain why it is generally not a good idea for the

Reader role to be assigned to the owner of the element being reviewed

during an inspection?

12. (4 pts.) Sommerville notes that while formal specification and proofs

of correctness can demonstrate that some classes of errors are not

present in a program, they cannot, in general guarantee program

reliability. List 2 of the 3 reasons he gives for this.

13. (4 pts.) As discussed in class, the “philosophy” of Cleanroom Software

Engineering is defect avoidance rather than defect removal. How are

defects avoided in Cleanroom SE? What role does testing play in

Cleanroom SE? Be specific.

14. (6 pts.) Give a precise interpretation of the weak correctness

predicate, {P} S {Q}.

15. (14 pts.) Indicate whether each of the assertions is “true” or

“false”.

a. {x>0} x := x-1 {x>0} true false

b. {1=2} x := 10 {x<0} true false

c. {true} while x>3 do x := x+1 {x=3} true false

d. {x[i]=k} i := i+k {x[i+k]=k} true false

e. {x >= 1}

while x < 7 do x := x+1 true false

{x ≥ 7}

f. [{x>0} s1 {y>0}]=>[{x=1} s1 {y=1}] true false

g. [{x=1} s1 {y=1}]=>[{x>0} s1 {y>0}] true false

16. (5 pts.) Use axiomatic verification to prove the assertion:

{Z=B} if A>B then Z := A {Z=Max(A,B)}

State the appropriate Rule of Inference and show all steps.

17. a. (3 pts.) Give the antecedents (“initialization, preservation, and

finalization”) for the while loop statement: (Fill-in the blanks.)

______, ______, ______



{P} while b do S {Q}

b. (8 pts.) Prove the following assertion of weak correctness using

the while-loop rule of inference with the given invariant. Assume

that all program variables represent INTEGER values. (Show ALL

steps as illustrated in class.)

{ n ≥ 0 } Use I: p = 2k

p := 1

k := 0

while k>n do

p := 2*p

k := k+1

end_while

{ p = 2n }

18. (3 pts.) What is regression testing and what is its purpose?

19. (3 pts.) Under what specific circumstances is partition testing

tantamount to exhaustive testing?

20. (4 pts.) Give a counterexample that proves that condition coverage

does not subsume statement coverage. (Explain how your counterexample

proves this.)

21. Consider the pseudocode program given below. (Assume that X and Y are

integer variables.)

1. input(X,Y)

if (X>Y) and (Y<0) do

2. X := X-1

Y := Y+1

if (X>Y) or (Y<0) then

3. X := X-2

else

4. X := X-1

end_if_then_else

end_if_then

5. output(X,Y)

a. (4 pts.) Give the PATH CONDITION for path 1-2-4-5 in terms

of the initial (input) values of X and Y.

b. (1 pt.) Give input values of X and Y for a test case that would

result in path 1-2-4-5 being executed.

22. (3 pts.) What is the principal advantage of an incremental integration

testing strategy over a non-incremental integration testing strategy?

23. (2 pts.) Statistical testing is usually based on an operational

profile. What critical information does an operational profile provide

in this regard?

24. (3 pts.) State Lehman’s “Law of Increasing Complexity”.

25. (4 pts.) Briefly describe the three different types of software

maintenance activity described in class. Which one of the three types

do industry surveys suggest is the most common?

26. (6 pts.) Sommerville notes that process improvement should be viewed

as a cyclical activity involving three principal stages. Briefly

describe each of the stages.

27. a. (3 pts.) What is the SEI, who sponsors it, and what is its primary

function?

b. (3 pts.) What are CMMs and what are they used for?

c. (4 pts.) Briefly describe the scope and structure of SEI’s CMMI

framework. (What disciplines or “bodies of knowledge” are currently

modeled and what two basic instantiations or “representations” do

the models take?)

d.  (2 pts.) How do the two CMMI model representations differ in terms

of the nature of the maturity appraisal generated?