You are on page 1of 9

Question No 1 [Marks 5 (1*5)]

Read the following statement carefully. These statements are either true or false.
Clearly indicate the true/false and Justify your answer.

a) UML is a language for specifying, visualizing and documenting the software


systems. [True/False]

The statement is true. As the UML name indicates Unified Modeling Language in
which a model of software system is represented. The module captures the static
features of software, defines the interaction among the software components and also
signify the overall framework of software.
b) Extension should not cover all other interests of stakeholders except for happy
path. [True/False]

The statement is true because the extensions in project doesn’t necessitate mean that it
will meet all the expectations of stakeholders. But the combination of both happy path
and extension can meet the interests of stakeholders. The increment in time duration
for the extension in project will also delay the plans of stakeholders for that
significant time.

c) Use case diagrams and use case relationships are the secondary steps in use case
work. [True/False]

Yes, the statement is also true because there is need to identify and specify the actors
first then the use case diagrams will be drawn and use case relationships will be
modeled among the actors and use cases. This is the reason that the actor
identification is primary task.
d) We continue writing use cases in the construction phase.
[True/False]

The statement is false because the use cases are written in elaboration phase where
there is working about analysis of functional requirements.
e) Dealing with the performance of a system is the part of a supplementary
specification. [True/False]

Yes, the statement is true because in supplementary specification the system


requirements like usability, reliability, performance and supportability requirements
are captured that are not captured in use cases. So, the performance of system is also
considered in supplementary specification.
Question No 2 [Marks 5 (2.5+2.5)]

Data flow testing techniques use to identify the anomalies in data variable definition and
use in white box testing techniques. For following two programs do Def-Use
Associations for all variables in program respectively and identify where data anomalies
exist

Def-Use Associations Z Def Use Association of X Def-Use Associations of Y


1 read (z) read (z) read (z)
2 x=0 x=0 x=0
3 y=0 y=0 y=0
4 if (z ≥ 0) if (z ≥ 0) if (z ≥ 0)
5 { { {
6 x = sqrt (z) x = sqrt (z) x = sqrt (z)
7 if (0 ≤ x && x ≤ 5) if (0 ≤ x && x ≤ 5) if (0 ≤ x && x ≤ 5)
8 y = f (x) y = f (x) y = f (x)
9 else else else
10 y = h (z) y = h (z) y = h (z)
11 } } }
12 y = g (x, y) y = g (x, y) y = g (x, y)
13 print (y) print (y) print (y)

Def Use C use P use


1 z
2 x
3 y
4 z
5
6 x z
7 x, x
8 y x
9
10 y z
11
12 y x, y
13 y

Data anomalies

In second program data anomalies lies here:

if (0 ≤ x && x ≤ 5)

In the above statement there is comparison between zero and variable and zero is lying at left
side in place of variable, this is not right way for implementation in the programming
languages.

Def-use of var x Def-use of var y Def-use of var z Def-use of var p


1 void pow (int x, y) void pow (int x, y) void pow (int x, y) void pow (int x, y)
2 { { { {
3 float z; float z; float z; float z;
4 int p; int p; int p; int p;
5 if (y < 0) if (y < 0) if (y < 0) if (y < 0)
6 p = 0 – y; p = 0 – y; p = 0 – y; p = 0 – y;
7 else else else else
8 p = y; p = y; p = y; p = y;
9 z = 1.0; z = 1.0; z = 1.0; z = 1.0;
10 while (p != 0) while (p != 0) while (p != 0) while (p != 0)
11 { { { {
12 z = z * x; z = z * x; z = z * x; z = z * x;
13 p = p – 1; p = p – 1; p = p – 1; p = p – 1;
14 } } } }
15 if (y < 0) if (y < 0) if (y < 0) if (y < 0)
16 z = 1.0 / z; z = 1.0 / z; z = 1.0 / z; z = 1.0 / z;
17 printf(z); printf(z); printf(z); printf(z);
18 } } } }

Def-use C-use P-use


1 x, y
2
3 z
4 p
5 y
6 p y
7
8 p y
9 z
10 p
11
12 z z, x
13 p p
14
15 y
16 z z
17 z
18

Data anomalies

In this program data anomaly lies here:

p = 0 – y;

variable is saving the value here but this is not right way of assignment.

Question No 3 [Marks 5]

Below is a brief program listing. Create the control flow diagram, determine its
Cyclomatic Complexity, choose a set of basis paths, and determine the necessary values
for the conditions to sensitize each path.

if (c1)
{
while (c2)
{
if (c3) { s1; s2;
if (c5) s5;
else s6;
break; // Skip to end of while
else
if (c4) { }
else { s3; s4; break;}
} // End of while

} // End of if
s7;
if (c6) s8; s9;
s10;
Cyclomatic Complexity
We can calculate the cyclomatic complexity by knowing the number of regions.
V(g) = number of regions in graph
V(g) =6
Cyclomatic complexity=6
Set of basis paths
c1 -> c2 -> c3 -> s1--s2-- c5-> s6--s7 -> c6 -> s8--s9--s10  (c1, c2, c3, c6 must be true, and c5
must be false)
c1 -> c2 -> c3 -> s1--s2-- c5-> s5--s7 -> c6 -> s8--s9--s10 (c1, c2, c3, c5, c6 must be true)
c1 -> c2 -> c3 -> s1--s2-- c5-> s6--s7 -> c6 -> s9--s10 (c1, c2, c3 must be true and c5, c6
must be false)
Determining the necessary values for the conditions to sensitize each path
c1 -> c2 -> s7 -> c6 -> s8--s9--s10
c1 -> c2 -> s7 -> c6 -> s9--s10
c4 -> c2 -> c3 -> s1--s2-- c5-> s5--s7 -> c6 -> s8--s9--s10
c4 -> c2 -> c3 -> s1--s2-- c5-> s6--s7 -> c6 -> s8--s9--s10
c4 -> c2 -> c3 -> s1--s2-- c5-> s6--s7 -> c6 -> s9--s10
c4 -> c2 -> s7 -> c6 -> s8--s9--s10
c4 -> c2 -> s7 -> c6 -> s9--s10
c4 -> s3 -> s4 -> s7 -> c6 -> s8--s9--s10
c4 -> s3 -> s4 -> s7 -> c6 -> s9--s10
Question No 4 [Marks 3]

a) Why is prioritization of requirements important?


b) Describe at least three different scales/aspects/attributes on which prioritization can be
done? (we are not asking for different prioritization methods) For each scale/aspect/attribute:
why are they important and what could happen if they were not taken into account?
C) Prioritize the six (6) requirements from case study of question 5 below using the cost-
value approach of Karlsson et al discussed in the lecture. Clearly mark each step of the way
and the results it produces until you arrive at the final and prioritized list of requirements.
Question No 5 [Marks 4]

Consider the following set of requirements for a university information system that is
used to keep track of student’s transcripts. The first requirement RS1 concerns the data
to be kept in permanent storage, which is further broken down into five parts draw the
class diagram which support all stated requirements.
RS1a. The university keeps track of each student's name, student number, social security
number, current address and phone, permanent address and phone, birthdate, sex, class
(freshman, sophomore, ..., graduate), major department, minor department (if any), and
degree program (B.A., B.S., ..., Ph.D.). Some user applications need to refer to the city, state,
and zip of the student's permanent address, and to the students' last name. Both social security
number and student number have unique values for each student.
RS1b. Each department is described by a name, department code, office number, office
phone and college. Both name and code have unique values for each department.
RS1c. Each course has a course name, description, code number, number of semester hours,
level, and offering department. The value of code number is unique for each course.
RS1d. Each section has an instructor, semester, year, course, and section number. The section
number distinguishes different sections of the same course that are taught during the same
semester/year; its values are 1, 2, 3, ...; up to the number of sections taught during each
semester.
RS1e. A grade report has a student, section, and grade.

Question No 6 [Marks 4]

Create a Use Case Diagram (in UML) for the following description of an Internet auction
system:

1. Types of users:

Anyone (Anyone may use the search features of the system and may look at an auction's
information)

Members

1. Only members may bid or place items for sale.

2. All members must register with the system.


3. Members must supply their name and a valid e-mail address.

4. After registering, the system will create an account for the member.

1. A password will be mailed to the e-mail address specified.

5. Members must log in to bid or place an item for sale.

6. Members who forget their password can have it re-mailed to them.

2. Auctions

1. An auction involves an item, a seller, and zero or more bidders.

2. Items and sellers

1. Sellers put up items for auction

2. The item must include a name, a closing time, and a minimum bid.

3. The item may include a description and a picture.

4. Sellers may have any number of auctions active at one time.

3. Bids and bidders

1. Any member may bid in any auction.

2. Bids may be placed at any time before the closing time.

3. A bid must be at least the minimum bid, and higher than any bid so far.

4. Ending an auction.

1. No matter how an auction ends, it is immediately removed from the list of


active auctions.

2. If no bids are placed before the closing time, the auction is closed
unsuccessfully and the seller notified by e-mail.

3. If at least one legal bid has been placed before the closing time, the auction is
closed successfully. The winning bidder and the seller are both mailed each
other's contact information and the winning bid.

4. The seller may cancel the auction up to 24 hours before the closing time. All
bidders on this auction will be mailed a notice of the cancellation.

Question No 7 [Marks 4 (2+2)]

Part 1:

Read the following formal use case of Auction system and convert the Buy and sell
goods by auction into sequence diagram.

Use Case: Buy and Sell Goods by Auction


Scope: Auction System
Level: Summary
Intention in Context: The intention of the User is to buy and sell goods by auctions over
time.
Multiplicity: Multiple users can interact with the auction system concurrently. A User can be
involved in multiple auctions at any one time.
Primary Actor: User (becomes Customer, once s/he has identified him/herself with the
System)
Main Success Scenario:
All Users must first enroll with the System before they have the right to use the system
1. User enrolls with System, providing System with registration information. Steps 2-5 can be
repeated many times.
2. User identifies him/herself to System.
3. System presents Customer with a welcome message. The user-goal level use cases of step
4 can be performed in parallel and individually repeated. A customer may bid and sell in
many auctions at any one time.
4. Customer increases credit with System or Customer buys an item on auction or Customer
sells an item by auction
5. Customer exits System.
6. Customer requests to cancel his/her enrollment.
Extensions:
3a. System fails to identify User; use case continues at step 2.

Part 2:
Draw Sequence diagram for the following casual use case.
 Add Calendar Appointment
The scenario begins when the user chooses to add a new appointment in the UI.
The UI notices which part of the calendar is active and pops up an Add Appointment window
for that date and time.
The user enters the necessary information about the appointment's name, location, start and
end times. The UI will prevent the user from entering an appointment that has invalid
information, such as an empty name or negative duration. The calendar records the new
appointment in the user's list of appointments. Any reminder selected by the user is added to
the list of reminders.

If the user already has an appointment at that time, the user is shown a warning message and
asked to choose an available time or replace the previous appointment. If the user enters an
appointment with the same name and duration as an existing group meeting, the calendar asks
the user whether he/she intended to join that group meeting instead. If so, the user is added to
that group meeting's list of participants.

You might also like