what is cyclomatic complexity? plz explain with example
Answer Posted / deep singh kushwaha
Cyclomatic complexity is a software metric (measurement) developed by Thomas McCabe and is used to measure the complexity of a program. It directly measures the number of linearly independent paths through a program's source code.
One of the ways is counting the number of closed loops in the flow graph, and incrementing the number by one.
i.e.
M = Number of closed loops + 1
where
M = Cyclomatic number.
Implications for Software Testing
M is a lower bound for the number of possible paths through the control flow graph.
M is an upper bound for the number of test cases that are necessary to achieve a complete branch coverage.
For example, consider a program that consists of two sequential if-then-else statements.
if (c1) {
f1();
} else {
f2();
}
if (c2) {
f3();
} else {
f4();
}
To achieve a complete branch coverage, two test cases are sufficient here.
For a complete path coverage, four test cases are necessary.
The cyclomatic number M is three, falling in the range between these two values, as it does for any program.
please suggest me if i m wrong..
e-mail-deepsingh.154@gmail.com
Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
Define performance and stress testing?
what is sanity test (or) build test?
which test strategy your are fallowing in your company?which documents u r using in software development life cycle?
Difference between smoke and sanity testing
Hi there, I am new to the world of testing. Is there any place where I can have a look at an actual specification documents or test plans or test cases. This will help me in generating a level of confidence. Looking forward to your replies
Scenario-based testing Option 1 concentrates on actor and software interaction Option 2 misses errors in specifications Option 3 misses errors in subsystem interactions Option 4 Both 1 abd 2
Give me an example of something you tried at work but did not work out so you had to go at things another way.
What is meant by entry criteria and exit criteria in software testing?
What is a test scenario?
HI FRNDS, I HAVE 2.5 years OF exp In Manual Testing,Plz let me know if thr r any oppurtunities in any company in Bangalore ID:dsnithi@gmail.com Thanks in Advance
Describe to me what you see as a process. Not a particular process, just the basics of having a process.
How could we start writing testcases without having the FRS,BRS Docs? My Project has some docs that are related to explain the operations which will be done in the application. It is deployed in UAT server and is a maintainance project. Tell me some technipues or best way to provide the quality to application?
What is quality center? How many built in tables does quality center have?
9.Data – driver automation typically includes?
Can anyone please answer the below question on Manual Testing: Tell me about atleast 5 bugs you come across in your last testing?