Concurrency Bug Finder
Christoph Amrein · HSR (HSR University of Applied Sciences Rapperswil) · 2016
This thesis presents a catalog of concurrency-related bug patterns. In contrast to design patterns, bug patterns describe specific code constellations that are error-prone. Each pattern is introduced with a brief description of the possible concurrency issues that may occur and what changes are necessary to avoid them. Moreover, the patterns have a short explanation of how their presence can be observed. Concurrency Bug Finder is a Roslyn-based static code analysis tool for the introduced bug patterns. The underlying core idea of the analyses is: "Code made to run concurrently will run concurrently." This presumption removes the necessity to identify if a code is truly executed concurrently. Instead, the concurrent execution of the code is assumed if synchronization primitives are used. The experimental evaluation verified the reliability of the different bug pattern analyses by scanning various projects with Concurrency Bug Finder and manually assessing the correctness of the reported issues. It revealed that more than 36% of the 365 findings are malign and only 29% are false positives. The remaining 35% indicate code locations that could be improved with regard to the design.