Computing Reviews
Today's Issue Hot Topics Search Browse Recommended My Account Log In
Review Help
Search
Understanding JavaScript event-based interactions with Clematis
Alimadadi S., Sequeira S., Mesbah A., Pattabiraman K. ACM Transactions on Software Engineering and Methodology25 (2):1-38,2016.Type:Article
Date Reviewed: Jul 14 2016

JavaScript development is not easy. Creating solid and reusable code is a very complex task, even for the skilled developer, due to the unique language features that positioned JavaScript in its high rank in front-end development. But software maintenance of such programs can become a challenge, especially for those developers not familiar with the application domain or with the coding style of the initial architecture. The authors propose a software framework that aims at helping JavaScript developers and maintainers to understand the behavior of a web application.

Despite its popularity, not much research in JavaScript behavioral analysis exists. Three characteristics make the language unique: it is weakly typed; it is “used to seamlessly mutate the document object model (DOM) at runtime”; and it is an event-driven language, allowing the registration of listeners to DOM nodes. This third characteristic makes it a language particularly complex to analyze. In fact, events can be triggered by the user, by the asynchronous callbacks from network communications (namely, XmlHttpRequests), and events “can propagate on the DOM tree and trigger multiple listeners according to the event capturing and bubbling properties of the event model.” Of course, testing and debugging tools exist, for example, Firebug. Tools such as Selenium dramatically help the testing, allowing specific web browser drivers to be run in a JUnit context to perform a test. However, both approaches are not useful when dealing with large code bases. Firebug is simply not applicable, and Selenium tests show the failure but not where the failure is located.

The tool presented, Clematis, effectively helps the developer understand the behavior of JavaScript software. It performs on-the-fly code instrumentation in order to obtain a trace of events used to build the behavioral model. The events instrumented are: 1) interposing on DOM events; 2) capturing timeouts and XmlHttpRequests; and 3) recording function traces and return statements. The code instrumentation is made by exploiting a proxy component, and it is performed by wrapping the above events with inline JavaScript functions. The behavioral model is then rendered as a graph and presented to the user using a click+zoom web interface (no plugin required; the whole graphical user interface (GUI) is also implemented in JavaScript). The GUI contains three levels: the user sessions recorded, details of the event, and finally the detailed sequence of events. The GUI also provides integration with Selenium tests: when a test fails, the behavioral model captures the portion of code that caused the failure, avoiding delta debugging.

The effectiveness of the tool is measured with test labs, showing that Clematis improves comprehension task accuracy by 157 percent and reduces task completion time by 47 percent.

Reviewer:  Massimiliano Masi Review #: CR144585 (1610-0766)
Bookmark and Share
  Featured Reviewer  
 
Testing And Debugging (D.2.5 )
 
 
Distribution, Maintenance, and Enhancement (D.2.7 )
 
Would you recommend this review?
yes
no
Other reviews under "Testing And Debugging": Date
Software defect removal
Dunn R., McGraw-Hill, Inc., New York, NY, 1984. Type: Book (9789780070183131)
Mar 1 1985
On the optimum checkpoint selection problem
Toueg S., Babaoglu O. SIAM Journal on Computing 13(3): 630-649, 1984. Type: Article
Mar 1 1985
Software testing management
Royer T., Prentice-Hall, Inc., Upper Saddle River, NJ, 1993. Type: Book (9780135329870)
Mar 1 1994
more...

E-Mail This Printer-Friendly
Send Your Comments
Contact Us
Reproduction in whole or in part without permission is prohibited.   Copyright 1999-2024 ThinkLoud®
Terms of Use
| Privacy Policy