Automatic Error Detection Using Program Invariants for Fault Localization
João Pedro Filipe, Rodrigues dos Santos · 2012
One of the constants of software development is how errors always exist after a product is finished, even with the most rigorous testing. These errors must be located and fixed in a phase called debugging phase. Since this phase can be very time consuming and expensive, automating the process of finding errors is of major importance. Techniques like Spectrum-based Fault Localization are used to locate errors, but they need information regarding successful and failed executions. Invariants can help in this regard. By using invariants to automatically detect errors, the process would be fully automated. However, this solution still has some drawbacks, mainly due to performance issues. Selecting only key variables to be monitored, instead of monitoring every variable, could help reduce the performance loss without any significant reduction in error detection quality. This thesis proposes the use of two created algorithms to detect the system’s so-called collar variables, and only monitor these variables. The first pattern finds variables whose value increase or decrease at regular intervals and deems them not important to monitor. The other pattern verifies the range of a variable per (successful) execution. If the range is constant across executions, then the variable is not monitored. Experiments were conducted on three different real-world applications to evaluate the reduction achieved on the number of variables monitored and determine the quality of the error detection. Results show a reduction of 52.04% on average in the number of monitored variables, while still maintaining a good detection rate with only 3.21% of executions detecting non-existing errors (false positives) and 5.26% not detecting an existing error (false negatives).