NCover 4 was designed to eliminate dubious coverage merging from differing builds of software assemblies. There are, however, legitimate cases when assemblies can have differing binary contents, but are actually created from the same source code. Indeed, the binary output of any given build will not match the output from another. We encounter this when we build software on separate machines and when we build software in multiple builds on the same machine. The binary differences occur even if the version number of the assembly remains constant and the source code unchanged. Previously, the code coverage data for such assemblies would not be merged at and below the module level in NCover 4. Modules with the same names appear to be duplicated because their binary content hashes differ. As humans we say, “Why are these different?”
We’ve decided to make merging a bit more aggressive. NCover will now merge coverage data for assemblies which are identical at the source code level. NCover 4.1.2101.816 is the first build to contain this new coverage merge functionality. This new merging strategy means that even assemblies with mismatched version numbers and binary hash can be merged if the source code can be verified as identical.
The following screen captures demonstrate the impact of this change. The first image show a merge for consecutive builds of unchanged code. The assemblies of the same names are all listed separately, one for each build.
The improved merge now combine the data of assemblies from consecutive builds of identical source code. It will also still merge identical assemblies based on binary has if source is not available. The following screen capture shows the same data from the previous screen after it has be re-merged under the new functionality.
In practice this allows multiple build servers to create independent builds yet still merge the code coverage results collected in their disparate environments. It’s fairly common to have software builds which are built in multiple environments or even to build release or debug versions from the same versions of source code. Merging of rebuilt assemblies allows my team to track the code coverage data from separate environments as one unified assembly.
Read more “Merge Executions”.