You are here

Code Coverage

This page contains code coverage information. For GNUnet, we try to do systematic testing as much as possible. Code coverage analysis tells us which parts of our code are covered by automatic tests. Note that we do not expect to ever cover 100% of the code --- quite a bit of the code is for error handling of more or less obscure failure cases (other peers/processes violating the protocol). Covering those branches would require extensive work to trigger the respective failure case.

The raw coverage percentage is simply not a good metric: we could easily develop code that had 100% test coverage by removing the error handling. This is the usual trap of coding for metrics, which we should avoid. As long as the error handlers are simple enough, it is totally acceptable to not cover them in the automated test cases. Thus, when analyzing code coverage results, it is important which parts of the code are not covered by testcases.