Professional Documents
Culture Documents
M363-Practice Questions
M363-Practice Questions
Question-1
A web server has been running for a month. From the log files for that month we see
that, of 2000 accesses, 100 attacks were made. Of these, 50 were denial-of-service
attacks, of which 10 were successful, 25 were password guessing (of which none were
successful) and 25 were accidental attacks (caused by errors on the part of the user), of
which 25 were successful. Find the integrity of the server.
Solution
Step1: Determine the type of attacks and fill up the first column
Step2: Compute the value threatattack and fill up the second column
Step4: Compute the value Integrity and fill up the fourth column
Question-2
A web server has been running for a month. From the log files for that month we see
that, of 10000 accesses, 500 attacks were made. Of these 300 denial-of-service
attacks, of which 99 were successful. 200 password guessing, of which none were
successful. Find the integrity of the server
Solution
Step1: Determine the type of attacks and fill up the first column
Step2: Compute the value threatattack and fill up the second column
Step3: Compute the value securityattack and fill up the third column
Step4: Compute the value Integrity and fill up the fourth column
Question 1
1. Calculate the following metrics for the given Java method Test
a. LOC
b. cyclomatic complexity metrics
2. Determine an appropriate set of white box tests for the Test method as follows:
a. a value of x to skip the while loop
b. a value of x to enter the while loop once
c. a value of x to enter the while loop more than once
Solution
b. x = 9
c. x =10
1. Calculate the following metrics for the given Java method Test
a. LOC
b. cyclomatic complexity metrics
2. Determine an appropriate set of white box tests for the Test method as follows:
a. A value of x to skip the while loop.
b. A value of x to enter the while loop once
c. A value of x to enter the while loop more than once.
int result = 0 , i = 0 ;
if (x < 0)
x = - x ;
{ i := i + 1 ;
result := result + i ;
System.out.println( result );
else
Solution
1. a. LOC = 12 (number of lines in the given Java Method)
b. cyclomatic complexity = 5
cyclomatic complexity starts with a value 1 + 1 while loop + 1 AND (&&) statement + 2 if
statements= 5
The weight of each use case is 7 and the weight of each class is 9.
The summation value for all of the 14 complexity factors (Fj ) is 25.
The system is simple and it will be written using Java language.
Step 1: Find FP
Number of classes: Fc = 3
Wight of classes: Wc = 9
Given that Fj = 25, Then: (The summation value for all of the 14 complexity
factors is 25)
Effort is:
E = a∙(KLOC)b
Duration is:
D = c∙Ed
Solution
Number of classes: Fc = 3
Wight of classes: Wc = 7
Given that Fj = 30, Then: (The summation value for all of the 14 complexity
factors is 30)
= 1.290 KLOC
Effort is:
E = a∙(KLOC)b
Duration is:
D = c∙Ed