Q: What is the coverage.db file and why am I seeing files like coverage.dbxxxxxxxxx_xxxxx_xxxx? The coverage.db file is the instrumentation database telling Clover the structure of your project and files during the last instrumentation event. coverage.dbxxxxxxxxx_xxxxx_xxxx hold the code coverage from your unit test or application run.
You will generally only have one instrumentation database per directory and you should expect to have many (sometimes 100s or even 1000s) of coverage recording files per directory.
How coverage recording files are matched with the database
Every time Clover instruments your source files it records the timestamp of that
instrumentation session in the database. Instrumented classes connect to the
coverage recorder of the session they were built in, and each recording file therefore carries the
dbVersion of that session.
When a report is generated, Clover discards recording files whose
dbVersion does not match any instrumentation session registered in the
database. With debug logging enabled you will see messages such as:
Ignoring coverage recording ... because no FileInfo supports its coverage range
This is normal behaviour, but it causes missing coverage if the database and the recording files are not managed consistently - most commonly when the build deletes clover.db in the middle of a build, or when an outdated database is reused for reporting. See Ignoring coverage recording files for the full explanation and resolution.
Because the database holds only the structure of your code, while coverage lives in these recording files, you often do not need to merge databases at all - see Do I need to merge Clover databases from multiple machines?