Sunday, 4 January 2015

CYCLOMATIC COMPLEXITY - SOLVED PROBLEMS

Cyclomatic complexity is a software metric. It provides a quantitative measure of the logical complexity of a program.Cyclomatic complexity provides us with an upper bound for the number of tests that must be conducted to ensure that all statements have been executed at least once.

Cyclomatic complexity has a foundation in graph theory and is computed in one of three ways.
1. The number of regions correspond to the cyclomatic complexity.
2. Cyclomatic complexity V(G) for a flow graph G, is defined as,
V(G)=E-N+2

where E=Number of flow graph edges
N=Number of flow graph nodes
3.Cyclomatic complexity,V(G) for a flow graph G, is defined as,
V(G)=P+1
where P=Number of predicate nodes contained in flow graph G.

The above three formulas are very important and there are a lot of NET questions based on this topic. I am solving a few of them here.
DECEMBER 2013 - PAPER III Q.NO 4
4. Given a flow graph with 10 nodes, 13 edges and one connected components, the number of regions and the number of predicate(decision) nodes in the flow graph will be
A)4,5
B)5,4
C)3,1
D)13,8
Ans:-B
Explanation:-
N=10,E=13
V(G)=E-N+2
V(G)=13-10+2
=3+2=5
Therefore, No of regions = 5. (According to rule 1.)
According to rule 3, V(G)=P+1
V(G) refers to the cyclomatic complexity which is equal to the no of regions.
5=P+1
P=5-1=4
So, the number of predicate nodes in the flow graph is 4.
So, the number of regions and the number of predicate nodes in the flow graph will be 5,4
Therefore, the correct answer is B.

JUNE 2013 - PAPER II Q.No 5
5. Cyclomatic complexity of a flow graph G with n vertices and e edges is
A)V(G)=e+n-2
B)V(G)=e-n+2
C)V(G)=e+n+2
D)V(G)=e-n-2
Ans:-B
Explanation:-
According to rule 2, the formula for Cyclomatic Complexity V(G)=e-n+2 where e is no of edges, n is no of vertices.

JUNE 2012 - PAPER III Q.No 33
33. Which one of the following statements is incorrect ?
(A) The number of regions corresponds to the cyclomatic complexity.
(B) Cyclometric complexity for a flow graph G is V(G) = N – E + 2, where E is the number of edges and N is the number of nodes in the flow graph.
(C) Cyclometric complexity for a flow graph G is V(G) = E – N + 2, where E is the number of edges & N is the number of nodes in the flow graph.
(D) Cyclometric complexity for a flow graph G is V(G) = P + 1, where P is the number of predicate nodes contained in the flow graph G.
Ans:- B
Explanation:-
According to the formulas given in (1),(2) and (3), option B is incorrect, because V(G)=E-N+2 and not N-E+2.

DECEMBER 2011 - PAPER II Q.No 15
15. McCabe's cyclomatic metric V(G) of a graph with n vertices, e edges and p connected component is
A)e
B)n
C)e-n+p
D)e-n+2p
Ans:-C
Explanation:-
According to McCabe's cyclomatic metric of a graph V(G)=E-N+P where P refers to connected components.

JUNE 2006 - PAPER II Q.No 42
42. In Software Metrics, McCABE􏰂's cyclomatic number is given by following formula :
(A) c=e-n+2p
(B) c=e-n-2p
(C) c=e+n+2p
(D) c=e-n*2p
Ans:-A


I hope all of you can solve problems based on cyclomatic complexity of a graph, with confidence and ease, after going through the above article.

REFER TO MY OTHER POSTS ON SOFTWARE ENGINEERING

SOFTWARE ENGINEERING

SOFTWARE ENGINEERING - SOLVED PROBLEMS

Saturday, 3 January 2015

SOFTWARE ENGINEERING - SOLVED PROBLEMS

SOFTWARE ENGINEERING PROBLEMS


JUNE 2014 – PAPER III

17. Assume that a program will experience 200 failures in infinite time. It has now experienced 100 failures. The initial failure intensity was 20 failures/CPU hr. Then the current failure intensity will be
(A) 5 failures/CPU hr
(B) 10 failures/CPU hr.
(C) 20 failures/CPU hr
(D) 40 failures /CPU hr

Ans:- B
Explanation:- The formula for Current Failure Intensity =
Initial Failure intensity X [ 1 – Experienced failures/Failures in infinite time ]
= 20 X [ 1 – 100/200 ]
=20 X (100/200)
=10 failures /CPU hr


18. Consider a project with the following functional units :
Number of user inputs = 50
Number of user outputs = 40
Number of user enquiries = 35
Number of user files = 06
Number of external interfaces = 04
Assuming all complexity adjustment factors and weighing factors as average, the function points for the project will be
(A)135
(B)722
(C)675
(D)672

Ans:-
Explanation:-

Measurement parameter Count Weighting Factor(Average) Total
Number of user inputs 50 4 =200
Number of user outputs 40 5 =200
Number of user enquiries 35 4 =140
Number of user files 6 10 =60
Number of external interfaces 4 7 =28

Functon point (FP) = count total X (0.65 + 0.01 X S(fi))
= 628 X (0.65 + .01 X 30)
= 596.6
There is no option like that given. So I am not choosing anything.


The weighting factors of Simple project are 3,4,3,7,5

The weighting factors of Complex project are 6,7,6,15,10

Formula for Function point (FP for Simple project)= count total X (0.65+0.01 X 22)

Formula for Function point (FP for Complex project)= count total X (0.65+0.01 X 44)



TRY OUT THE FOLLOWING PROBLEMS

1. Compute the function point value for a project with the following information domain characteristics
Number of user inputs : 23
Number of user output : 60
Number of user enquiries : 24
Number of files : 10
Number of external interface : 05
Assume that all complexity adjustment values are average.
Ans : - 591.85

2. Compute the function point value for a project with the following information domain characteristics.
Number of user inputs : 28
Number of user outputs : 50
Number of user enquiries : 42
Number of files : 07
Number of external interface : 03
Assume that all complexity adjustment values are simple.
Ans:- 412.38

Problems are taken from the book on Software Engineering by Bharat Bhushan Agarwal and Sumit Prakash Tayal

Friday, 2 January 2015

ALL ABOUT NET

NET stands for National Eligibility Test. This is a test conducted by National Educational Testing Bureau of University Grants Commission to establish a minimum standard for Lecturers and Junior Research Fellowships for pursuing research. I think most of you know all about it. Why am I writing about all these basics now?. Because I want to ensure that all of you know how important this exam is. I know many success stories of people having passed this exam. There is no looking back for any one of them.

The first success story is that of my brother, who cleared his JRF way back in the 1990's. He not only went on to complete his Phd from IIT Madras, but he is also in a very senior position in a well known fortune 500 company. Not only that, many of the others, whom I know,who have cleared this test are in either government jobs or good positions, even if it is a private job. I feel it is easy to pass this exam if you write it immediately after finishing your masters. The theories and problems are easy to understand and apply, while you are fresh from all your studies. But still with little discipline, and some smart reading it is possible to crack this exam. This site will help you all in the smart reading part. Passing this exam is a prestige which no one can deny. Any one who has cleared NET is looked up in the work environment, and the opportunities they have are in abundance. Again why am I stressing about all this now is that, however the December 2014 exam was, everyone should look forward to the next one and try to crack it, the next time.

But, for that preparations have to start from right now. Not around April, May or June. I read in the paper, that this time, Paper I was quite tricky and tough. Normally the candidates writing NET do not focus much on cracking Paper I. They take it for granted. So I have decided to include tips for Paper I as well from now onwards. This place will be a one point reference for all information and guidance related to NET. I started this blog with the sole aim of reaching out to people who want to crack this exam. I found that there was no help online for understanding the solution in detail. That is why all the questions will have a detailed explanation as far as possible in this site. I aim to write, as regularly as I can. When I read your comments, on how useful a particular post or information was, that actually makes my day. So, ALL THE BEST to all of you out there. Do not rest, till you clear the test!!!.

For all other information, related to NET, click here...

About NET



SYLLABUS FOR NET



OLD QUESTION PAPERS



SCOPE OF NET/SLET



Tuesday, 9 December 2014

SOFTWARE ENGINEERING

CAPABILITY MATURITY MODEL


CMM stands for Capability Maturity Model. This was developed by Software Engineering Institute(SEI). This is a well known benchmark for judging the quality level of the processes in the organization. CMM defines five levels determined on the basis of organisation’s support for certain “key” process areas known as KPAs. The five levels are:

CMM – LEVEL 1 Initial Undefined, chaotic, no process in place
CMM – LEVEL 2 Repeatable Basic project management processes are in place.
CMM – LEVEL 3 Defined In addition to level 2 activities, organization has defined processes and management activities are documented.
CMM – LEVEL 4 Managed Standards are built for organization. Managed through setting standards
CMM – LEVEL 5 Optimising Leveraging on knowledge and innovative ideas. Continous process improvement and preventing the occurrence of defects.

JUNE 2014 – PAPER II
11. KPA in CMM stands for
A) Key Process Area
B) Key Product Area
C) Key Principal Area
D) Key Performance Area
Ans:- A

JUNE 2014 – PAPER III
21. Which one of the following is not a key process area in CMM level 5 ?
(A) Defect prevention
(B) Process change management
(C) Software product engineering
(D) Technology change management
Ans:- C

DECEMBER 2012 – PAPER II
19. The maturity levels used to measure a process are
(A) Initial, Repeatable, Defined, Managed, Optimized.
(B) Primary, Secondary, Defined,Managed, Optimized.
(C) Initial, Stating, Defined, Managed, Optimized.
(D) None of the above
Ans:- A

JUNE 2012 – PAPER II
21. Key process areas of CMM level 4 are also classified by a process which is
(A) CMM level 2
(B) CMM level 3
(C) CMM level 5
(D) All of the above
Ans:- B

JUNE 2009 – PAPER II
39. Capability Maturity Model is meant for:
A) Product
B) Process
C) Product and process
D) None of the above
Ans:- B

DECEMBER 2008 – PAPER II
44. Which level is called as “defined” in capability maturity model?
A) level 0
B) level 3
C) level 4
D) level 1
Ans:- B

JUNE 2005 – PAPER II
41. The capability maturity model defines 5 levels :
a) level 1     i) Managed
b) level 2     ii) Defined
c) Level 3     iii) Repeatable
d) Level 4     iv) Initial
e) Level 5     v) Optimised
Correct matching is:
   (a)   (b)   (c)   (d)   (e)
A)   i   ii   iii   iv   v
B)   iv   iii   ii   i   v
C)   v   i   iii   ii   iv
D)   v   ii   i   iii   iv
Ans:- B

Wednesday, 19 November 2014

COMPUTER NETWORKS

An Ebook on COMPUTER NETWORKS is available for FREE download here. The book has the following salient features.

  1. Detailed explanation of theory on certain topics.
  2. Over 100+ solved questions in computer networks of previous year papers(starting from 2008) with detailed explanation.
  3. Important formulae.
  4. Important URLs where MCQ's in computer networks are available.
Overall a very useful book for your learning reference in Computer Networks.

Click here on the following link, complete a small survey questionnaire and then download....

DOWNLOAD COMPUTER NETWORKS - EBOOK

Happy downloading and reading.

Monday, 10 November 2014

IP ADDRESS AND ITS DIFFERENT CLASSES

IP address is the short form for Internet Address. These help to uniquely identify the hosts on the internet. The data which is sent over the network is delivered to the correct host with the help of the IP address.There are two versions of IP addresses available. IPv4 and IPv6. Let us talk about IPv4 now.

IPv4


IPVersion 4 addresses consist of 32 bits(0 through 31) partitioned into four groups of eight bits each. Each of this group is called an octet. It will be very difficult to understand and decipher the IP addresses if they were represented in the binary form and so they are reprsented in decimal form. Four decimal numbers separated by a dot, each standing for one octet. So, for example an IP address would look like this, 206.172.180.100.

  • IP address consist of 32 bits.
  • Each grouped into 4 groups of eight bits each.
  • Each of the eight bits are referred to as octets.

IP addresses are grouped into five classes class A, class B, class C, class D and class E. In order to differentiate between all these classes, we have to observe the first four bits of the first octet of the IP address.

CLASS A:

If the first bit is 0, then the IP address belongs to Class A. Class A addresses begins with a decimal number ranging from 0 to 127.Both 0 and 127 are reserved. So the first octet’s bit representation.

X X X X X X X X X - First octet's bit position
0 X X X X X X X X - Class A address representation
Each X stands for a bit which can be 0 or 1. For class A addresses the first bit would be a zero only.

CLASS B:
If the first two bits are 10, then the IP address belongs to class B. Class B addresses begins with a decimal number ranging from 128 to 191.
X X X X X X X X - First octet's bit position
1 0 X X X X X X - Class B address representation

The lowest class B address would be 1 0 0 0 0 0 0 0. The decimal equivalent of the same is 128. The highest class B address would be 1 0 1 1 1 1 1 1. The decimal equivalent of the same would be 191. That is why the decimal number range is between 128 to 191.

CLASS C:
If the first three bits are 110, then the IP address belongs to class C. Class C addresses begin with a decimal number ranging from 192 to 223.
X X X X X X X X – The first octet’s eight bits
1 1 0 X X X X X - Class C address representation

The lowest class C address would be 1 1 0 0 0 0 0 0. The decimal equivalent of the same is 27+26 = 192. The highest class C address would be 1 1 0 1 1 1 1 1. The decimal equivalent of the same is = 223.

CLASS D:
If the first four bits are 1110, then the address is class D address. Range of values from 224 to 229.

X X X X X X X X – The first octet’s eight bits
1 1 1 0 X X X X – Class D address
The lowest address would be 1 1 1 0 0 0 0 0. Decimal equivalent of the same is 128 + 64 + 32 = 224. Highest class D address would be 1 1 1 0 1 1 1 1. Again decimal equivalent of the same would be 128 + 64 + 32 + 8 + 4 + 2 +1 = 239. Class D addresses are used for multicasting.

CLASS E:
If the first four bits are 1111, then the address is a class E address. Range of decimal numbers ranging from 240 to 255.

X X X X X X X X – The first octet’s eight bits
1 1 1 1 1 1 1 1 – Class E address.
Lowest address = 1 1 1 1 0 0 0 0 = 128 + 64 + 32 + 16 = 240
Highest address = 1 1 1 1 1 1 1 1 = 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = 255

STEPS TO FIND OUT THE CLASS OF IP ADDRESS


Given a IP address consider only the first octet. The rest of the octets can be of any value. That should not be of a concern in identifying the class of IP address. When we consider the first octet, there are two ways of identifying the class of IP address. One is to remember the decimal range of values for each class.
  1. Class A - 0 to 127
  2. Class B - 128 to 191
  3. Class C - 192 to 223
  4. Class D - 224 to 239
  5. Class E - 240 to 255
So if in the first octet the decimal number is given as 200.200.192.55 then the IP address belongs to class C because it falls in that range. But we might forget this sequence of numbers and that will be trouble for us. So, another way of working this out is to remember only the bit values for each of the class addresses.
  1. Class A - First bit is 0
  2. Class B - First two bits 1 0
  3. Class C - First three bits 1 1 0
  4. Class D - First four bits 1 1 1 0
  5. Class E - First four bits 1 1 1 1
So, given any IP address convert the first octet's decimal number to the binary equivalent. Look at the first few bits and decide the class of the IP address.

1. In IPv4, the IP address 200.200.200.200 belongs to
(A) Class A
(B) Class B
(C) Class C
(D) Class D
Ans :- C
Explanation:- Consider only the first octet's decimal value. Ignore the rest. The first octet value is 200. Convert the same to binary equivalent. It is 11001000. If the converted bit equivalent has less than 8 bits, then fill its left side with 0's and bring it to a count of 8 bits. The first 3 bits are 110 here and so this IP address belongs to class C address. So the answer is C. This question is from December 2013 - Paper III.

2. In classful addressing, the IP address 190.255.254.254 belongs to
(A) Class A
(B) Class B
(C) Class C
(D) Class D
Ans:- B
Explanation:- Again consider only the first octet. The value there is 190. Convert it into binary equivalent. It is 1011 1110. Look at the first two bits. It is 10. So it is class B address and so the correct answer is B. This question is from June 2013 - Paper II.

3. In classful addressing, the IP address 123.23.156.4 belongs to __________class format.
(a) A
(b) B
(c) C
(d) D
Ans:- A
Explanation:- Consider the first octet. The value is 123. The binary equivalent is 111 1011. There are only 7 bits. Add a zero in the high order bit. 0111 1011. The first bit is 0 and so the class address is A.This question is from December 2012 - Paper III.

4. IP address in class B is given by:
(A) 125.123.123.2
(B) 191.023.21.54
(C) 192.128.32.56
(D) 10.14.12.34
Ans:- B
Explanation:- You should be in a position to explain it on your own by now!!.