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

what is sanity test (or) build test?

651


write test condition for testing SMS service of a mobile phone maximun length is 100 character while sending and 80 character for receiving write test scenarios do not write test cases

3046


Encapsulation of attributes and operations inside objects makes it easy to obtain object state information during testing. is it true.explain

1644


name poneno dept sun 9894433467 computer This is the xls sheet a programs written to transfer this data into database write test cases and test scenario?

1930


3. In a system designed to work out the tax to be paid: An employee has £4000 of salary tax free. The next £1500 is taxed at 10%. The next £28000 after that is taxed at 22%. Any further amount is taxed at 40%. To the nearest whole pound, which of these groups of numbers fall into three DIFFERENT equivalence classes?

1693






What does you mean by positive and negative testing & what is the difference between them. Can anyone explain with an example?

674


what will be verification and validation test cases for yahoo login page (only functional test cases)? Please explain in details.

13644


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

1644


Can you explain the workbench concept?

700


Presently working in software company as a software test engineer with 1.5 yrs of experience but i am 2002 passout.Gap is 6 yrs.Is there any problem getting job in MNC? Which criteria HR follows for recruiting test engineer?

1617


Easiest way to write test cases? How i can learn writing the test cases?

943


What is benchmark testing? hi friends... can anyone suggest the correct answer plz...

3178


What is Test Design?

1745


Why testers wil prepare useracceptance testcases,system testcases and integration testcases,What is the differenece between all this test cases

1609


diff b/w desktop based testing & web application testing

1576