1

NAME: ______

(Please PRINT)

------CEN 5035 - Software Engineering ------

Exam 2 -- Spring 2009

You have 90 minutes to work on this closed-book/closed-notes test. Please pay attention to point values since you may not have time to complete all 23

problems. PLEASE PRINT ALL ANSWERS IN THE SPACE PROVIDED ONLY. Print your name above NOW and sign the pledge at the end of the test WHEN YOU FINISH.

  1. (3 pts.) The term information hidingis often associated with the notion of

encapsulation. David Parnas, however, suggests a more general interpretation.

Statehis definition of information hiding.

2. (3 pts.) In Sommerville’s introduction to Chapter 14, Object-orienteddesign,

he notes: “As I discuss in Chapter 17, system developmentbased onextensive

up-front design can be criticized because theextensiveanalysis and design

effort is not well suited to incrementaldevelopment and delivery. So called

agile methods have been developedto address this problem, and these

drastically reduce or completelyeliminate the object-oriented design

activity.” Which one of thefollowingbest reflects Sommerville’s view

regarding this matter? (Circle ONE only.)

  1. He agrees that extensive, “heavyweight” design is unnecessary, and therefore presents a form of “lightweight” design in Chapter 14.
  1. He agrees with the criticism discussed in Chapter 17 in the context of function-oriented pipelining, but argues that object-oriented design is inherently well suited to incremental development and delivery.
  1. His view is that extensive, “heavyweight” design is essential, since it can be used as a focus for discussion by a range of different stakeholders.
  1. His view is that extensive, “heavyweight” design is unnecessary for small and medium-sized business systems, but that for large and particularly critical systems, it is necessary in order to ensure that teams working are properly coordinated.

3. (3 pts.) Sommerville notes that the conceptual model of objectinteraction in

object-oriented design allows objects to execute concurrently as parallel

processes.Briefly describe this model, and explain how it allows objects to

execute concurrently.

4. (3 pts.) Consider the subsystems associated withSommerville's layered

architecture for a weather mapping system from Chapter 14, Object-oriented

design:

For which of the following architectural elements does he develop an example design to illustrate the process of object-oriented design?(Circle ONE only.)

a. User interface and Data storage components

b. Data collection subsystem.

c. Weather station component

d. Data display subsystem.

e. Data collection and processing subsystems

f. the entire weather mapping system

5. (+/8 pts.) The following statements concern "Cleanroom Software

Engineering". Circle either "true" or "false" as appropriate. (Note that to

compensate for random guessing, you will receive +2 pts. for each correct

answer and -2 pts. for each incorrect answer. No points will be added to or

subtracted from your score if you do not circle an answer.)

a. The philosophy is defect avoidance rather than true false

defect removal.

b. No execution of the software is permitted true false

until the start of defect testing.

c. Uses formal methods rather than software true false

inspections.

d. Only a limited number of control and data true false

abstraction constructs are used.

6. (8 pts.) Match each description below to the SINGLE MOST APPROPRIATE TERM

among the following. (Note: terms may apply to none, one, or more than one

description.)

A. advice H. tangling

B. scattering I. join point model

C. knotting J. guidance

D. aspect K. pointcut

E. core concerns L. cross-cutting concerns

F. braiding M. feature

G. join point N. weaving

___ A program abstraction that defines a cross-cutting concern.

___ Requirements reflecting attributes of the system as awhole or which

influence the implementation of requirements.

___ Occurs when a module includes code that implements different system

requirements

___ Normally organized and structured using such programming language

abstractions as procedures and classes

___ The incorporation of advice at specified join points

___ The code implementing a concern

___ A statement, included in an aspect, that defines where the aspect will

beinserted into the program

___ Specific functionality that relates to a system's primary purpose

7. (3 pts.) Sommerville identifies a number of “key factors” that should be

considered when planningsoftware reuse. One of these is the development

schedule forthe software.Which of the following best reflects his advicein

this regard? (Circle ONE only.)

a. If the software needs to be developed quickly, you should try to reuse

off-the-shelf systems rather than individual components.

b. If the software needs to be developed quickly, you should avoid areuse-

based approach all together since all reuse technologies are fairly

complex and youneed quite a lot of time to understand and use them

effectively.

c. If the software needs to be developed quickly, you should try to reuse

software components that implement a single function, such as a

mathematical function or an object class, since these can be easily

linked with other application code.

d. If the software needs to be developed quickly, it is best to use abstract

designs that do not include detailed implementation decisions that have

been made by others. Abstract designs can be implemented to fit your

specific application requirements.

e. None of the above.

8. Component-Based Software Engineering (CBSE) is a development approach based

on systematic reuse.

a. (4 pts.) Sommerville notes that components are defined by their interfaces

and that, in the most general cases, can be thought of ashaving two

related interfaces. Briefly describe the structure of a"2-part" component

interface.

b. (3 pts.) In contrasting components with object classes, Sommerville

observes that components do not define types. Briefly explain.

9. (+/-14 pts.) Consider the following statements related to inspections and

reviews. Circle either "true" or "false" as (most) appropriate.(Note that

to compensate for random guessing, you will receive +2pts. for each correct

answer and -2 pts. for each incorrect answer. No points will be added to or

subtracted from your score if you do not circle an answer.)

a. Applicable tosystem installation processes true false

and documentation

b. Inspection results should never be used by true false

management.

c. If possible, the program author or owner

should present the item under review to the true false

team during the inspection.

d. The role of author/owner could be held by a true false

tester.

e. Whenever possible, an inspection team should

assist developers by suggesting how true false

discovered defects should becorrected.

f. Applicable to formal correctness arguments true false

g. Is the only effective V&V technique at the true false

sub-system and system (code) levels

10. (3 pts.) Briefly describe the "Chief Moderator" role in the inspection/

review process.

11. (3 pts.) Which of the following best captures the precisemeaning of the

weakcorrectness predicate, "{P} S {Q}"? (Circle ONE only.)

a. {P} S {Q} is true unless Q could be false if S terminates.

b. If P holds before executing S, {P} S {Q} is true unless Q could be false

if S terminates.

c. {P} S {Q} is true unless Q must be false if S terminates, given that P

held before executing S.

d. If P holds before executing S, S must terminate in state Q.

e. P must hold before S executes and Q must hold if S terminates.

12. (+/-12 pts.) Circle either “true” or “false”, as appropriate, for each of

thefollowingassertions. (Notethat to compensate for random guessing, you

willreceive +2 pts. for each correct answer and -2 pts. for each incorrect

answer. No points will be added to orsubtracted from your score if you do

not circle an answer.)

a. {x=1} y := x+1; x := 5 {y≤x}true false

b. {true} if x<0then x := -x {x>0}true false

c. {x=y*t} x := x+t {x-t≤y*t}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 {x≤7}true false

f.[{x>0} s2 {y=3Лk=5}] [{x>0} s2 {y=3}] true false

13. (6 pts.) Prove the following assertion using the if-then-else Rule of

Inference (ROI). State the rule's antecedents and show all steps.

{x=5 Л |y|=1}

if y>0 then

z := x-1

else

z := 1-x

end_if_else

{y*z=4}

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

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

______, ______, ______

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

{P} while b do S {Q}

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

while-loop Rule of Inference with the given invariant.Assume thatall

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 }

15. (3 pts.) Beizer defines testing as “the act of executing tests to

demonstrate the correspondence between an element and its specification.”

Give Myers’ definition of testing and briefly explain his rationale for

adopting a perspective different from Beizer’s.

16. (6 pts.) Briefly describe the steps associated with the “test case selection

strategy” illustrated in class for filling-inthe columns of a test case

coverage matrix given a Cause-Effect graph.

17. Consider the following pseudocode program:

input(X,Y,Z)

if (X<0) OR (Y>0) OR (Z=0) then

print(“Hello World”)

end_if

a. (5 pts.) What is the minimum number of test cases that would be required

to achieve each of the following coverage criteria for this program?

i. statement coverage: ______

ii. branch coverage: ______

iii. condition coverage: ______

iv. compound condition coverage: ______

v. path coverage ______

b. (2 pts.) What general result(s) can be deduced about the relationship

between pathcoverage and compound coverage from part (a) above? (Be

precise.)

18. a. (2 pts.) What is the purpose of a “stub” in the context of top-down

integration testing?

b. (2 pts.) Are “stubs” ever required in testing outside the context of

integrationtesting? Briefly explain your answer.

19. Consider the pseudocode program given below.

1. input(X,Y,Z)

2. if (X<Y) then

3. Y := Y-1

4. end_if

5. if (YZ) then

6. Z := Z-2

7. end_if

8. if (X=Y) AND (Y=Z) then

9. output(“eureka!”)

10. end_if

a. (4 pts.) Give the PATH CONDITION for path 1-2-3-4-5-6-7-8-9-10 in terms of

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

b. (3 pts.) Give input values of X, Y, and Z for a test case that would

result in this path being executed.

20. (3 pts.) Briefly explain how a newly installed system can itself cause

changes to its own system requirements.

21. (3 pts.) Four software maintenance “cost factors” were identified inclass:

team stability, contractual responsibility, staff skills, andprogram age

and structure. Briefly describe the program age and structure factor.

22. (8 pts.) Sommerville describes eight process attributes that may be subject

to improvement via the process improvement cycle. Briefly describe four of

the eight attributes.

23. a. (4 pts.) Briefly describe the circumstances and issues that led to SEI’s

Capability Maturity Model Integration (CMMI) project in 2001.

b. (3 pts.) How, specifically, did CMMI address these circumstances and

issues?

c. (6 pts.) In addition to a 5-level “staged model” expressed in terms of

capability levels as used in the original CMM, CMMI introduced a new

“continuous model”. Briefly describe the form of assessment afforded by

the continuous model and its principal advantage to organizations over

the staged model.

On my honor, I have neither given nor received unauthorized aid on this exam and I pledge not to divulge information regarding its contents to those who have not yet taken it.

______

SIGNATURE