How can you find dead code!!

Answer Posted / mfsi_chinmayb`

Hi
Dead code (a.k.a Unreachable code),as the name suggests is
the portion of the code which is never executed.
Point out the word NEVER , as the code above that made the
break before that and the execution of that never come.
Ex:
int function(a,b)
{
int z;
return a+b;
z=a*b; //It will never be executed
}

The above is the example for a Statement . There might a big
function which is never executed.In larger programs 5-10% of
dead code can be found.

Note : If a program is smaller in size error code can be
checked manually.But for larger program we have automated
tools like: TrueCoverage etc

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Please Tell me About Fish-Bone Model. Thanks in Adv.

1470


Can anyone please answer the below question on Manual Testing: Tell me about atleast 5 bugs you come across in your last testing?

1581


What is pesticide paradox?

639


test cases on bangles???

2538


Write the test cases for godaddy home page

1230






Can some one help me writing a manual test case for email applications like yahoo i need for www.everonn.com

1524


write a testing stratgy \ approach for a product that you are use every day (e.g gmail, out look etc)

1452


What is split testing?

682


What is an audit report? Whom is it done by?

1950


What is the difference between manual testing and automation testing?

638


What is defect validity ratio?

6764


What is junit & api?

1675


What is a test log?

631


What is a testing process / lifecycle?

687


Give me an example of something you tried at work but did not work out so you had to go at things another way.

1632