Severity Levels of Inconsistent Code [chapter]

Martin Schäf, Ashish Tiwari
2015 Lecture Notes in Computer Science  
Inconsistent code detection is a variant of static analysis that detects statements that never occur on feasible executions. This includes code whose execution ultimately must lead to an error, faulty error handling code, and unreachable code. Inconsistent code can be detected locally, fully automatically, and with a very low false positive rate. However, not all instances of inconsistent code are worth reporting. For example, debug code might be rendered unreachable on purpose and reporting it
more » ... will be perceived as false positive. To distinguish relevant from potentially irrelevant inconsistencies, we present an algorithm to categorize inconsistent code into a) code that must lead to an error and may be reachable, b) code that is unreachable because it must be preceded by an error, and c) code that is unreachable for other reasons. We apply our algorithm to several open-source project to demonstrate that inconsistencies of the first category are highly relevant and often lead to bug fixes, while inconsistencies in the last category can largely be ignored.
doi:10.1007/978-3-319-24953-7_8 fatcat:atzakmq5b5ee5ivxoqtrzwz22q