Modern web applications are written in an event-driven style, in which event handlers execute asynchronously in response to user or system events. The nondeterminism arising from this programming style can lead to pernicious errors. Recent work focuses on detecting event races and classifying them as harmful or harmless. However, since modifying the source code to prevent harmful races can be a difficult and error-prone task, it may be preferable to steer away from the bad executions. In this paper, we present a technique for automated repair of event race errors in JavaScript web applications. Our approach relies on an event controller that restricts event handler scheduling in the browser according to a specified repair policy, by intercepting and carefully postponing or discarding selected events. We have implemented the technique in a tool called EventRaceCommander, which relies entirely on source code instrumentation, and evaluated it by repairing more than 100 event race errors that occur in the web applications from the largest 20 of the Fortune 500 companies. Our results show that application-independent repair policies usually suffice to repair event race errors without excessive negative impact on performance or user experience, though application-specific repair policies that target specific event races are sometimes desirable.
Description
Repairing event race errors by controlling nondeterminism
%0 Conference Paper
%1 Adamsen:2017:RER
%A Adamsen, Christoffer Quist
%A Møller, Anders
%A Karim, Rezwana
%A Sridharan, Manu
%A Tip, Frank
%A Sen, Koushik
%B Proceedings of the 39th International Conference on Software Engineering
%C Piscataway, NJ, USA
%D 2017
%I IEEE Press
%K DataRace EventLoop JavaScript Policies RaceCondition Repairing
%P 289--299
%R 10.1109/ICSE.2017.34
%T Repairing Event Race Errors by Controlling Nondeterminism
%X Modern web applications are written in an event-driven style, in which event handlers execute asynchronously in response to user or system events. The nondeterminism arising from this programming style can lead to pernicious errors. Recent work focuses on detecting event races and classifying them as harmful or harmless. However, since modifying the source code to prevent harmful races can be a difficult and error-prone task, it may be preferable to steer away from the bad executions. In this paper, we present a technique for automated repair of event race errors in JavaScript web applications. Our approach relies on an event controller that restricts event handler scheduling in the browser according to a specified repair policy, by intercepting and carefully postponing or discarding selected events. We have implemented the technique in a tool called EventRaceCommander, which relies entirely on source code instrumentation, and evaluated it by repairing more than 100 event race errors that occur in the web applications from the largest 20 of the Fortune 500 companies. Our results show that application-independent repair policies usually suffice to repair event race errors without excessive negative impact on performance or user experience, though application-specific repair policies that target specific event races are sometimes desirable.
%@ 978-1-5386-3868-2
@inproceedings{Adamsen:2017:RER,
abstract = {Modern web applications are written in an event-driven style, in which event handlers execute asynchronously in response to user or system events. The nondeterminism arising from this programming style can lead to pernicious errors. Recent work focuses on detecting event races and classifying them as harmful or harmless. However, since modifying the source code to prevent harmful races can be a difficult and error-prone task, it may be preferable to steer away from the bad executions. In this paper, we present a technique for automated repair of event race errors in JavaScript web applications. Our approach relies on an event controller that restricts event handler scheduling in the browser according to a specified repair policy, by intercepting and carefully postponing or discarding selected events. We have implemented the technique in a tool called EventRaceCommander, which relies entirely on source code instrumentation, and evaluated it by repairing more than 100 event race errors that occur in the web applications from the largest 20 of the Fortune 500 companies. Our results show that application-independent repair policies usually suffice to repair event race errors without excessive negative impact on performance or user experience, though application-specific repair policies that target specific event races are sometimes desirable.},
acmid = {3097403},
added-at = {2018-07-17T19:23:10.000+0200},
address = {Piscataway, NJ, USA},
author = {Adamsen, Christoffer Quist and M{\o}ller, Anders and Karim, Rezwana and Sridharan, Manu and Tip, Frank and Sen, Koushik},
biburl = {https://www.bibsonomy.org/bibtex/2238d6e9087049b5f06f391bd0f5c521f/gron},
booktitle = {Proceedings of the 39th International Conference on Software Engineering},
description = {Repairing event race errors by controlling nondeterminism},
doi = {10.1109/ICSE.2017.34},
interhash = {c0186f61ede10389949bea9325cfe395},
intrahash = {238d6e9087049b5f06f391bd0f5c521f},
isbn = {978-1-5386-3868-2},
keywords = {DataRace EventLoop JavaScript Policies RaceCondition Repairing},
location = {Buenos Aires, Argentina},
numpages = {11},
pages = {289--299},
publisher = {IEEE Press},
series = {ICSE'17},
timestamp = {2018-07-17T19:23:10.000+0200},
title = {{Repairing Event Race Errors by Controlling Nondeterminism}},
year = 2017
}