The doubt i have is , what will the instrumented file look like? Instrumentation code at each line ?
Bytecode instrumentation generally involves adding extra code that increment counters -- and these counters are used to indicate whether something happened (was reached). For example, if a block of code never gets executed, then the counter for that block should still be zero.
Generally, it is not needed to instrument every line. You just need to instrument branches. For example, inside and outside of an "if" condition, inside and outside of an "while" condition, before and after a block that contains a return statement, etc.
As for the file, there is probably no need to instrument the classfile (but this can vary from tool to tool)... it is possible to instrument the byte codes when it is loaded into the VM, via a classloader.
Henry