Source code instrumentation is the most powerful, flexible and accurate way to provide code coverage analysis. The following table compares different methods of obtaining code coverage and their relative benefits:
| Possible feature | JVMDI/PI | Bytecode instrumentation | Source code instrumentation |
| gathers method coverage | yes | yes | yes |
| gathers statement coverage | line only | indirectly | yes |
| gathers branch coverage | indirectly | indirectly | yes |
| can work without source | yes | yes | no |
| requires separate build | no | no | yes |
| requires specialized Runtime | yes | yes | no |
| gathers source metrics | no | no | yes |
| view coverage data inline with source | not accurate | not accurate | yes |
| source level directives to control coverage gathering | no | no | yes |
| control which entities are reported on | limited | limited | yes |
| compilation time | no impact | variable | variable |
| runtime performace | high impact | variable | variable |
| Container friendly | no | no | yes |

No comments:
Post a Comment