zimmski / go-mutesting

Mutation testing for Go source code
MIT License
640 stars 56 forks source link

Make blacklisting not dependent on the content but on the line of code #7

Open zimmski opened 9 years ago

zimmski commented 9 years ago

The problem with using MD5 checksums for blacklisting mutations (blacklisting false-positives) is that a simple change in the source code (e.g. because of a new feature) will change ALL checksums and will therefore make the checksum of the blacklist obsolete. A more smart mechansim must be implemented to make blacklisting really possible.

zimmski commented 8 years ago

This is a hard problem which I have with other analysis tools too. I think it would be better to utilize a generic solution instead of hardcoding this into go-mutesting.

seborama commented 8 years ago

How about adding a tag to the line (block of lines) that shouldn't be mutated? Perhaps something like: // +go-mutesting: blacklist at the end of the line.

Or for a block of lines (if applicable): // +go-mutesting: +blacklist ...{code over several lines}... // +go-mutesting: -blacklist

zimmski commented 8 years ago

The problem is that the blacklisting cannot be marked in the source code, since it is mutation specific, and there can be many mutations for the same source code line.

EDIT: Also it would taint the source code itself, making it less readable. I would also prefer an outside solution so that it would be possible to use an UI for blacklisting that does not modify/has access to the code.