Varis: IDE Support for Embedded Client Code in PHP Web Applications

kaestner@cs.cmu.edu (H. Nguyen, C. Kästner, T. Nguyen)
Sat, 05 Mar 2016 18:41:39 -0500

Hung Viet Nguyen, Christian Kästner, and Tien N. Nguyen. Varis: IDE Support for Embedded Client Code in PHP Web Applications. In Proceedings of the 37th International Conference on Software Engineering (Volume 2) (ICSE), pages 693--696, May 2015. Formal Demonstration paper, Best Demonstration Award.

In software development, IDE services such as syntax highlighting, code completion, and “jump to declara- tion” are used to assist developers in programming tasks. In dynamic web applications, however, since the client-side code is dynamically generated from the server-side code and is embedded in the server-side program as string literals, providing IDE services for such embedded code is challenging. In this work, we introduce Varis, a tool that provides editor services on the client-side code of a PHP-based web application, while it is still embedded within server-side code. Technically, we first perform symbolic execution on a PHP program to approximate all possible variations of the generated client-side code and subsequently parse this client code into a VarDOM that compactly represents all its variations. Finally, using the VarDOM, we implement various types of IDE services for embedded client code including syntax highlighting, code completion, and “jump to declaration”.