You are on page 1of 21

GRIFFITH UNIVERSITY

school of computing and information technology

bachelor of information technology and


bachelor of engineering (software engineering)

cit12162 software quality principles

FINAL EXAMINATION SEMESTER TWO 1999

question 1 (a)

software product quality

suppose someone has sought your advice on how to go about the construction
a software product quality model to be used in conjunction with the ada
programming language. outline what specific instructions, advice and
examples you would give the person so that they may be able to go away and
successfully build an effective product quality model? the model is intended to
be used both to “build quality into software” and for inspection purposes.

(4 marks)
-2-

question 1 (b)

in response to the large number of defects found in an organisation’s software


suppose you have been brought in to implement the use of formal inspections
as a way of addressing the problem. outline what steps you would take to make
the initiative successful.
(4 marks)
-3-
question 1 (c)

given that a client has specifically asked that the software system that is to be
built for them is highly reliable explain what you would do to ensure that this
product quality requirement is satisfied?
(2 marks)

question 2 (a)

given the following implementation below draw a branch-successor graph for it.

(2
marks)
{pre: x < y < z & y > 0}
c:= 0;
do x < z ->
if x < y -> x:= x + 1; c :=c + 1
[] x >= y -> x:= x + y
fi
od
-4-
-5-

question 2 (b)

given below is part of an implementation that is intended to count the number


of blank lines and the number of non-blank lines in a file. inspect the code and
identify any problems that may prevent it from carrying out its intended task
correctly. also identify and label accordingly any defects that affect the
maintainability or efficiency of the code. note lines may have multiple leading
spaces and there may be multiple trailing spaces at the end of the line. words
are separated by one or more spaces. for each quality defect give its line
number, the nature of the defect and what high level quality attributes it
impacts.
(3 marks)

c-like code for inspection


01 #include <stdio.h>
02 #define space ''
03 main()
04 {
05 char chr;
06 int line;
07 . . .
08 getchar(chr);
09 line = 1;
10 while (chr != eof){
11
12 while (chr = = space) && (chr != eol) {
13 getchar(chr);
14 }
15 /* count non-blank lines */
16 if (chr = = eol){
17 blank++;
18 }
19 while (chr != eol) {

20 /* read a word */
21 while(chr != space) && (chr != eol) && (chr != eof) {
22 getchar(chr);

23 }
24 /* read spaces */
25 while (chr = = space) && (chr != eol) {
26 getchar(chr);
27 }
28 line++;
29 }
30 }
31 if (chr = = eof) {
32 /* print line count and */
33 ...
34 }
35} /* end main */
-6-
-7-
question 2 (b) (continued)
-8-
question 2 (c)

given the following implementation convert it to the multiple branch structure


form that is needed to draw a branch-successor graph and draw a branch
successor graph for the converted structure and identify the terminating
branches. (3 marks)

/* oldata has been previously set either to true or false */


oldcount = 0; newcount =0; newdata = false; error = false; i=
 0;
while ((tst= readata(argc, argv, data)) != eof && i <n) {

newdata = true;
if (tst == avail) {
if (oldata) {
error = true;
break; }
else { newcount++;}
}
else if (tst == notready) { oldata = true; oldcount++;}
else { error = true; break;}
i = i + 1;
}
-9-

question 2 (d)

restructure the code fragment in (c) to remove any logical redundancy and/or
redundant testing, any unnecessary assignments and any fragments that can
be placed outside the loop.
(2
marks)
- 10 -
question 3 (process)

(a) give a definition of “standard” and indicate how this definition is relevant
to software engineering concerns.
(4 marks)
- 11 -
question 3 (continued)

b) the following is a clause extracted from a working draft of a proposed


international standard - iso/iec 15939 - software measurement process.

(i) identify the specific requirements in this clause. (2 marks)

(ii) indicate for each requirement whether conformance to the


requirement is objectively verifiable.
(4 marks)

4.1 establish and maintain measurement commitment

the purpose of this activity is to ensure that all resource, personnel, and
commitment prerequisites for the measurement process have been satisfied.
as a result of the successful implementation of this activity:

there is commitment from management to support the measurement


process

individuals competent in the area of this international standard have been


identified and assigned responsibilities for the measurement process

resources are made available for producing a measurement plan and


performing the process

this activity consists of the following tasks :

1. establish commitment
2. assign competent resources

4.1.1 establish commitment

4.1.1.1 the organisational unit shall be explicitly identified.

commitment should be established when a “request for


measurement” is initiated.

the scope of measurement is an organisational unit. this may be a


single project, a functional area, the whole enterprise, a single site, or
a multi-site organisation. this may consist of software projects or
supporting processes, or both. in addition, all stakeholders should be
identified. for example, these may be project managers, the
information systems manager, or the quality assurance manager. the
stakeholders may be internal or external to the organisational unit.
all subsequent measurement tasks should be within the defined
scope.

4.1.1.2 commitment of management and staff to measurement shall be


established and shall be communicated to the organisational unit.

this includes the commitment of resources to the measurement


process and the willingness to maintain this commitment. a
- 12 -
commitment may take the form of a measurement policy for the
organisational unit. commitment may also come in the form of a
contract with a customer stipulating that certain metrics be used.
- 13 -
question 3 (b) (continued)

4.1.2 assign competent resources

4.1.2.1 competent individuals shall be assigned responsibility for the


measurement process within the organisational unit.

the sponsor of measurement should assign this responsibility.

competent individuals may be acquired through transfer, coaching,


training, sub-contracting and/or hiring. competence includes
knowledge of the principles of measurement, how to collect data,
perform data analysis, and communicate the analysis results. at a
minimum, the following individuals should achieve competence:

the decision-maker(s) using the measurement results


the measurement analyst
those responsible for data management
the data provider

4.1.2.2 the assigned competent individuals shall be provided with resources


to develop a measurement plan and perform the measurement
process.

the sponsor of measurement should be responsible for ensuring that


resources are provided.
- 14 -
question 3 (b) (continued)
- 15 -
question 4 (process)

(a) what attribute is measured in a software process assessment based on


version 1.1 of the capability maturity model? (2
marks)

(b) a large multinational organisation has conducted cmm- based


assessments of a number of its software development laboratories across
the world. the results of the assessments were as follows: (4
marks)

10 laboratories were assessed

3 laboratories were assessed as level 1 on the cmm


4 laboratories were assessed as level 2 on the cmm
2 laboratory was assessed as level 4 on the cmm
1 laboratory was assessed as level 5 on the cmm

which of the following statements about the organisation’s results are


meaningful? which statements are correct? why?

(i) the average process maturity in all laboratories in the organisation


is 2.2.
(ii) the average maturity of the organisation is between 2 and 3.
(iii) 30% of all laboratories have a process maturity greater than 3.
(iv) the 4 laboratories at level 2 have equal process maturity.
(v) the level 4 laboratory will always produce better software designs
than the level 1 laboratories.
- 16 -
question 4 (b) (process) (continued)
- 17 -
question 4 (continued)

(c) the plan - do - check - act cycle is the basis of many approaches to
process improvement. if improvement is based on software process
assessment, where in the pdca cycle does the assessment function fit?
what would be the next actions to follow in the cycle?
(4 marks)
- 18 -
question 5 software testing (marks 10)

consider the following program:

procedure check_date(day : integer; month : integer; year : integer; result : in out


boolean)

dayok, monthok, yearok : boolean := false;

begin
-- check year
if year >= 0 then
yearok := true
end if;
-- check month
if month >= 1 and month <= 12 then
monthok := true
end if;
-- check day
if day >= 1 and day <= 28 then
dayok := true
else if day = 29 and month = 2 and
(year mod 400 = 0 or (year mod 4 = 0 and not (year mod 100 =
0))) then
dayok := true
else if day = 30 and not month = 2 then
dayok := true
else if day = 31 and not month = 2 and not month = 4 and not month
=6
and not month = 9 and not month = 11 then
dayok := true
end if;
- - consolidate result
if dayok and monthok and yearok then
result := true
else
result := false
end if
end check_date;
- 19 -
question 5 (continued)

the flow graph for the above program is shown below:


A ? - Year > 0
F T
B

C ? - Month >= 1 and Month <= 12


F T
D

E ? - Day >= 1 and Day <= 28

T F
? - Day = 29 and Month = 2 and
G (Year mod 400 = 0 or
(Year mod 4 = 0 and not (Year mod 100 = 0)))
F T F

I ? - Day = 30 and not Month = 2

H T F
? - Day = 31 and not Month = 2 and
K
not Month = 4 and not Month = 6
J T and not Month = 9 and not Month = 11
F

M ? - DayOK and MonthOK and YearOK


F T
O N

answer the following questions for the routine above:

1. complete the table below to indicate what paths are covered by the test cases.
(2 marks)

no. day mont year result path


h
1 1 1 1999 true
2 29 2 2000 true
3 30 4 1999 true
4 31 1 1999 true
- 20 -

2. add additional test cases that are required to achieve 100% statement
coverage. (2 marks)

no. day mont year result path


h

3. add additional test cases that are required to achieve 100% branch coverage.
(2 marks)
references to above test cases may be used.

no. day mont year result path


h

4. for the following condition define the conditions required to achieve 100%
modified condition/decision coverage. (2 marks)

day = 29 and month = 2 and


(year mod 400 = 0 or (year mod 4 = 0 and not (year mod 100 = 0)))

5. for the following condition define the conditions required to achieve 100%
modified condition/decision coverage. (2marks)
references to above test cases may be used.

no. day mont year result path


h
- 21 -

You might also like