Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
10.1145/2950290.2950292acmconferencesArticle/Chapter ViewAbstractPublication PagesfseConference Proceedingsconference-collections
research-article

Static DOM event dependency analysis for testing web applications

Published: 01 November 2016 Publication History

Abstract

The number and complexity of JavaScript-based web applications are rapidly increasing, but methods and tools for automatically testing them are lagging behind, primarily due to the difficulty in analyzing the subtle interactions between the applications and the event-driven execution environment. Although static analysis techniques have been routinely used on software written in traditional programming languages, such as Java and C++, adapting them to handle JavaScript code and the HTML DOM is difficult. In this work, we propose the first constraint-based declarative program analysis procedure for computing dependencies over program variables as well as event-handler functions of the various DOM elements, which is crucial for analyzing the behavior of a client-side web application. We implemented the method in a software tool named JSDEP and evaluated it in ARTEMIS, a platform for automated web application testing. Our experiments on a large set of web applications show the new method can significantly reduce the number of redundant test sequences and significantly increase test coverage with minimal overhead.

References

[1]
100 Online JavaScript Games.
[2]
S. Alimadadi, A. Mesbah, and K. Pattabiraman. Hybrid dom-sensitive change impact analysis for javascript. In 29th European Conference on Object-Oriented Programming, ECOOP 2015, July 5-10, 2015, Prague, Czech Republic, pages 321–345, 2015.
[3]
E. Andreasen and A. Møller. Determinacy in static analysis for jQuery. In ACM SIGPLAN Conference on Object Oriented Programming, Systems, Languages, and Applications, pages 17–31, 2014.
[4]
S. Arlt, A. Podelski, and M. Wehrle. Reducing GUI test suites via program slicing. In International Symposium on Software Testing and Analysis, pages 270–281, 2014.
[5]
S. Artzi, J. Dolby, S. H. Jensen, A. Moller, and F. Tip. A framework for automated testing of JavaScript web applications. In International Conference on Software Engineering, pages 571–580, 2011.
[6]
M. Bravenboer and Y. Smaragdakis. Strictly declarative specification of sophisticated points-to analyses. In ACM SIGPLAN Conference on Object Oriented Programming, Systems, Languages, and Applications, pages 243–262, 2009.
[7]
L. Cheng, J. Chang, Z. Yang, and C. Wang. GUICat: GUI testing as a service. In IEEE/ACM International Conference On Automated Software Engineering, 2016.
[8]
R. Chugh, J. A. Meister, R. Jhala, and S. Lerner. Staged information flow for javascript. In ACM SIGPLAN Conference on Programming Language Design and Implementation, pages 50–62, 2009.
[9]
R. Cytron, J. Ferrante, B. K. Rosen, M. N. Wegman, and F. K. Zadeck. Efficiently computing static single assignment form and the control dependence graph. ACM Trans. Program. Lang. Syst., 13(4):451–490, 1991.
[10]
L. De Moura and N. Bjørner. Z3: An efficient smt solver. In Proceedings of the Theory and Practice of Software, 14th International Conference on Tools and Algorithms for the Construction and Analysis of Systems, pages 337–340, Berlin, Heidelberg, 2008. Springer-Verlag.
[11]
A. Feldthaus, M. Schäfer, M. Sridharan, J. Dolby, and F. Tip. Efficient construction of approximate call graphs for JavaScript IDE services. In International Conference on Software Engineering, pages 752–761, 2013.
[12]
J. Ferrante, K. J. Ottenstein, and J. D. Warren. The program dependence graph and its use in optimization. ACM Trans. Program. Lang. Syst., 9(3):319–349, July 1987.
[13]
P. Godefroid. Partial-Order Methods for the Verification of Concurrent Systems - An Approach to the State-Explosion Problem. Springer, 1996.
[14]
S. Guarnieri and V. B. Livshits. GATEKEEPER: mostly static enforcement of security and reliability policies for JavaScript code. In USENIX Security Symposium, pages 151–168, 2009.
[15]
A. Guha, S. Krishnamurthi, and T. Jim. Using static analysis for Ajax intrusion detection. In International Conference on World Wide Web, pages 561–570, 2009.
[16]
A. Guha, C. Saftoiu, and S. Krishnamurthi. Typing local control and state using flow analysis. In European Symposium on Programming, pages 256–275, 2011.
[17]
K. Hoder, N. Bjørner, and L. de Moura. muZ - an efficient engine for fixed points with constraints. In International Conference on Computer Aided Verification, pages 457–462, 2011.
[18]
C. S. Jensen, A. Møller, V. Raychev, D. Dimitrov, and M. T. Vechev. Stateless model checking of event-driven applications. In ACM SIGPLAN Conference on Object Oriented Programming, Systems, Languages, and Applications, pages 57–73, 2015.
[19]
S. H. Jensen, P. A. Jonsson, and A. Møller. Remedying the eval that men do. In International Symposium on Software Testing and Analysis, pages 34–44, 2012.
[20]
S. H. Jensen, M. Madsen, and A. Møller. Modeling the HTML DOM and browser API in static analysis of javascript web applications. In ACM SIGSOFT Symposium on Foundations of Software Engineering, pages 59–69, 2011.
[21]
V. Kahlon, C. Wang, and A. Gupta. Monotonic partial order reduction: An optimal symbolic partial order reduction technique. In International Conference on Computer Aided Verification, pages 398–413, 2009.
[22]
J. B. Kam and J. D. Ullman. Monotone data flow analysis frameworks. Acta Inf., 7:305–317, 1977.
[23]
M. Kusano and C. Wang. Assertion guided abstraction: a cooperative optimization for dynamic partial order reduction. In IEEE/ACM International Conference On Automated Software Engineering, pages 175–186, 2014.
[24]
M. Kusano and C. Wang. Flow-sensitive composition of thread-modular abstract interpretation. In ACM SIGSOFT Symposium on Foundations of Software Engineering, 2016.
[25]
M. S. Lam, J. Whaley, V. B. Livshits, M. C. Martin, D. Avots, M. Carbin, and C. Unkel. Context-sensitive program analysis as database queries. In ACM SIGACT-SIGMOD-SIGART Symposium on Principles of Database Systems, pages 1–12, 2005.
[26]
G. Li, E. Andreasen, and I. Ghosh. SymJS: automatic symbolic testing of JavaScript web applications. In ACM SIGSOFT Symposium on Foundations of Software Engineering, pages 449–459, 2014.
[27]
B. Livshits, M. Sridharan, Y. Smaragdakis, O. Lhoták, J. N. Amaral, B. E. Chang, S. Z. Guyer, U. P. Khedker, A. Møller, and D. Vardoulakis. In defense of soundiness: a manifesto. Commun. ACM, 58(2):44–46, 2015.
[28]
V. B. Livshits and M. S. Lam. Finding security vulnerabilities in Java applications with static analysis. In USENIX Security Symposium, 2005.
[29]
M. Madsen, B. Livshits, and M. Fanning. Practical static analysis of JavaScript applications in the presence of frameworks and libraries. In ACM SIGSOFT Symposium on Foundations of Software Engineering, pages 499–509, 2013.
[30]
M. Madsen, F. Tip, and O. Lhoták. Static analysis of event-driven Node.js JavaScript applications. In ACM SIGPLAN Conference on Object Oriented Programming, Systems, Languages, and Applications, pages 505–519, 2015.
[31]
L. A. Meyerovich and V. B. Livshits. ConScript: Specifying and enforcing fine-grained security policies for JavaScript in the browser. In IEEE Symposium on Security and Privacy, pages 481–496, 2010.
[32]
M. Naik, A. Aiken, and J. Whaley. Effective static race detection for Java. In ACM SIGPLAN Conference on Programming Language Design and Implementation, pages 308–319, 2006.
[33]
C. Nguyen, H. Yoshida, M. R. Prasad, I. Ghosh, and K. Sen. Generating succinct test cases using don’t care analysis. In IEEE International Conference on Software Testing, Verification and Validation, pages 1–10, 2015.
[34]
C. Pacheco and M. D. Ernst. Randoop: feedback-directed random testing for Java. In ACM SIGPLAN Conference on Object Oriented Programming, Systems, Languages, and Applications, pages 815–816, 2007.
[35]
G. Richards, C. Hammer, B. Burg, and J. Vitek. The eval that men do - A large-scale study of the use of eval in javascript applications. In European Conference on Object-Oriented Programming, pages 52–78, 2011.
[36]
A. Rountev, A. Milanova, and B. G. Ryder. Points-to analysis for java using annotated constraints. In ACM SIGPLAN Conference on Object Oriented Programming, Systems, Languages, and Applications, pages 43–55, 2001.
[37]
P. Saxena, D. Akhawe, S. Hanna, F. Mao, S. McCamant, and D. Song. A symbolic execution framework for javascript. In IEEE Symposium on Security and Privacy, pages 513–528, 2010.
[38]
K. Sen, S. Kalasapur, T. G. Brutch, and S. Gibbs. Jalangi: a selective record-replay and dynamic analysis framework for JavaScript. In ACM SIGSOFT Symposium on Foundations of Software Engineering, pages 488–498, 2013.
[39]
M. Sridharan, J. Dolby, S. Chandra, M. Schäfer, and F. Tip. Correlation tracking for points-to analysis of JavaScript. In European Conference on Object-Oriented Programming, pages 435–458, 2012.
[40]
C. Wang, Z. Yang, V. Kahlon, and A. Gupta. Peephole partial order reduction. In International Conference on Tools and Algorithms for Construction and Analysis of Systems, pages 382–396, 2008.
[41]
S. Wei and B. G. Ryder. State-sensitive points-to analysis for the dynamic behavior of JavaScript objects. In European Conference on Object-Oriented Programming, pages 1–26, 2014.
[42]
J. Whaley and M. S. Lam. Cloning-based context-sensitive pointer alias analysis using binary decision diagrams. In ACM SIGPLAN Conference on Programming Language Design and Implementation, pages 131–144, 2004.
[43]
N. Zhang, M. Kusano, and C. Wang. Dynamic partial order reduction for relaxed memory models. In ACM SIGPLAN Conference on Programming Language Design and Implementation, pages 250–259, 2015.
[44]
Y. Zheng, T. Bao, and X. Zhang. Statically locating web application bugs caused by asynchronous calls. In International Conference on World Wide Web, pages 805–814, 2011.

Cited By

View all
  • (2024)EdgStr: Automating Client-Cloud to Client-Edge-Cloud Transformation2024 IEEE 44th International Conference on Distributed Computing Systems (ICDCS)10.1109/ICDCS60910.2024.00061(589-600)Online publication date: 23-Jul-2024
  • (2022)Model-based automated testing of JavaScript Web applications via longer test sequencesFrontiers of Computer Science: Selected Publications from Chinese Universities10.1007/s11704-020-0356-716:3Online publication date: 1-Jun-2022
  • (2021)Communicating Web Vessels: Improving the Responsiveness of Mobile Web Apps with Adaptive RedistributionWeb Engineering10.1007/978-3-030-74296-6_30(388-403)Online publication date: 18-May-2021
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
FSE 2016: Proceedings of the 2016 24th ACM SIGSOFT International Symposium on Foundations of Software Engineering
November 2016
1156 pages
ISBN:9781450342186
DOI:10.1145/2950290
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 01 November 2016

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. Automated testing
  2. Event dependency
  3. JavaScript
  4. Partial order reduction
  5. Static analysis

Qualifiers

  • Research-article

Conference

FSE'16
Sponsor:

Acceptance Rates

Overall Acceptance Rate 17 of 128 submissions, 13%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)27
  • Downloads (Last 6 weeks)0
Reflects downloads up to 08 Feb 2025

Other Metrics

Citations

Cited By

View all
  • (2024)EdgStr: Automating Client-Cloud to Client-Edge-Cloud Transformation2024 IEEE 44th International Conference on Distributed Computing Systems (ICDCS)10.1109/ICDCS60910.2024.00061(589-600)Online publication date: 23-Jul-2024
  • (2022)Model-based automated testing of JavaScript Web applications via longer test sequencesFrontiers of Computer Science: Selected Publications from Chinese Universities10.1007/s11704-020-0356-716:3Online publication date: 1-Jun-2022
  • (2021)Communicating Web Vessels: Improving the Responsiveness of Mobile Web Apps with Adaptive RedistributionWeb Engineering10.1007/978-3-030-74296-6_30(388-403)Online publication date: 18-May-2021
  • (2020)Enhancing Web App Execution with Automated ReengineeringCompanion Proceedings of the Web Conference 202010.1145/3366424.3382087(274-278)Online publication date: 20-Apr-2020
  • (2020)Client Insourcing: Bringing Ops In-House for Seamless Re-engineering of Full-Stack JavaScript ApplicationsProceedings of The Web Conference 202010.1145/3366423.3380105(179-189)Online publication date: 20-Apr-2020
  • (2020)D-Goldilocks: Automatic Redistribution of Remote Functionalities for Performance and Efficiency2020 IEEE 27th International Conference on Software Analysis, Evolution and Reengineering (SANER)10.1109/SANER48275.2020.9054870(251-260)Online publication date: Feb-2020
  • (2019)Snapshot-based Loading Acceleration of Web Apps with Nondeterministic JavaScript ExecutionThe World Wide Web Conference10.1145/3308558.3313575(2215-2224)Online publication date: 13-May-2019
  • (2019)DebreachProceedings of the 34th IEEE/ACM International Conference on Automated Software Engineering10.1109/ASE.2019.00088(899-911)Online publication date: 10-Nov-2019
  • (2019)Static Detection of Event-Driven Races in HTML5-Based Mobile AppsVerification and Evaluation of Computer and Communication Systems10.1007/978-3-030-35092-5_3(32-46)Online publication date: 12-Nov-2019
  • (2019)Catch & Release: An Approach to Debugging Distributed Full-Stack JavaScript ApplicationsWeb Engineering10.1007/978-3-030-19274-7_32(459-473)Online publication date: 26-Apr-2019
  • Show More Cited By

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media