Extracting client-side web application code

The web application domain is one of the fastest growing and most wide-spread application domains today. By utilizing fast, modern web browsers and advanced scripting techniques, web developers are developing highly interactive applications that can, in terms of user-experience and responsiveness, compete with standard desktop applications. A web application is composed of two equally important parts: the server-side and the client-side. The client-side acts as a user-interface to the application, and can be viewed as a collection of behaviors. Similar behaviors are often used in a large number of applications, and facilitating their reuse offers considerable benefits. However, due to client-side specifics, such as multi-language implementation and extreme dynamicity, identifying and extracting code responsible for a certain behavior is difficult. In this paper we present a semi-automatic method for extracting client-side web application code implementing a certain behavior. We show how by analyzing the execution of a usage scenario, code responsible for a certain behavior can be identified, how dependencies between different parts of the application can be tracked, and how in the end only the code responsible for a certain behavior can be extracted. Our evaluation shows that the method is capable of extracting stand-alone behaviors, while achieving considerable savings in terms of code size and application performance.

[1]  Keith Brian Gallagher,et al.  Using Program Slicing in Software Maintenance , 1991, IEEE Trans. Software Eng..

[2]  Paolo Tonella,et al.  Web Application Slicing in Presence of Dynamic Code Generation , 2005, Automated Software Engineering.

[3]  Joseph Robert Horgan,et al.  Dynamic program slicing , 1990, PLDI '90.

[4]  Martin P. Robillard,et al.  Automatically Recommending Triage Decisions for Pragmatic Reuse Tasks , 2009, 2009 IEEE/ACM International Conference on Automated Software Engineering.

[5]  David W. Binkley,et al.  Program slicing , 2008, 2008 Frontiers of Software Maintenance.

[6]  Alex Wright,et al.  Ready for a Web OS? , 2009, Commun. ACM.

[7]  Paolo Tonella,et al.  Web application slicing , 2001, Proceedings IEEE International Conference on Software Maintenance. ICSM 2001.

[8]  Brad A. Myers,et al.  FireCrystal: Understanding interactive behaviors in dynamic web pages , 2009, 2009 IEEE Symposium on Visual Languages and Human-Centric Computing (VL/HCC).

[9]  David W. Binkley,et al.  Interprocedural slicing using dependence graphs , 1990, TOPL.

[10]  Mary Jean Harrold,et al.  Slicing object-oriented software , 1996, Proceedings of IEEE 18th International Conference on Software Engineering.

[11]  Jan Carlson,et al.  Reusing Web Application User-Interface Controls , 2011, ICWE.

[12]  Susan Horwitz,et al.  Identifying the semantic and textual differences between two versions of a program , 1990, PLDI '90.

[13]  Philip J. Guo,et al.  Opportunistic programming: how rapid ideation and prototyping occur in practice , 2008, WEUSE@ICSE.

[14]  Thomas W. Reps,et al.  Integrating noninterfering versions of programs , 1989, TOPL.

[15]  Robert J. Walker,et al.  Semi-Automating Pragmatic Reuse Tasks , 2008, 2008 23rd IEEE/ACM International Conference on Automated Software Engineering.

[16]  Peng Li,et al.  Script InSight: Using Models to Explore JavaScript Code from the Browser View , 2009, ICWE.

[17]  Giuseppe Visaggio,et al.  Extracting Reusable Funtions by Flow Graph-Based Program Slicing , 1997, IEEE Trans. Software Eng..