Analysis and Testing of Ajax Web Applications

Extraction of Finite State Machines

Although asynchronous technologies such as Ajax make Rich Internet Applications (RIAs) responsive, they can result in unexpected behavior due to nondeterministic client-side processing and asynchronous communication. One difficulty in understanding such erroneous behavior lies in the unpredictable contexts of the running system. Dynamic behavior analysis techniques do not help to verify the correctness of certain “blind spots” in the execution path. In this work, we present a static approach for extracting all possible state transitions described in source code from the RIAs. Our approach is based on the assumption that user, server and self interactions with the RIAs can change the states of the application. Our method consists of four steps: 1) using given specifications of Ajax relevant to interactions as rules, 2) creating a call graph, annotating interactions on it and extracting interaction controls, 3) abstracting the call graph to extract relationships among the interactions, and 4) refining the relationships with the interaction controls. By extracting the state machines of test scenarios of the correct and wrong behavior, it can help developers to pinpoint the statements in the source code that lead to the erroneous behavior. Our approach has been evaluated against a few experimental cases and we conclude that it can extract comprehensible state machines in a reasonable time.

ajax-fsm

Pattern-Based Verification

When developing asynchronous JavaScript and XML (Ajax) applications, developers implement Ajax design patterns for increasing the usability of the applications. However, unpredictable contexts of running applications might conceal faults that will break the design patterns, which decreases usability. We propose a support tool called JSVerifier that automatically verifies interaction invariants; the applications handle their interactions in invariant occurrence and order. We also present a selective set of interaction invariants derived from Ajax design patterns, as input. If the application behavior breaks the design patterns, JSVerifier automatically outputs faulty execution paths for debugging. The results of our case studies show that JSVerifier can verify the interaction invariants in a feasible amount of time, and we conclude that it can help developers increase the usability of Ajax applications.

ajax-verification

Testing with Subtle Delays

The challenge of validating Asynchronous JavaScript and XML (Ajax) applications lies in actual errors exposed in a user environment. Several studies have proposed effective and efficient testing techniques to identify executable faults. However, the applications might have faults that are not executed during testing, but might cause actual errors in a user environment. Although we have investigated static methods for finding “potential faults” that seem to cause actual errors if executed, developers need to confirm whether or not the potential faults are actually executable. Herein, we propose a mutation-based testing method implemented in a tool called JSPreventer. Even if the potential faults are not easily executable in a given environment, our method mutates the applications until they are executable using two delay-based mutation operators to manipulate the timing of the applications handling interactions. Thus, JSPreventer provides executable evidences of the not-easily-executable faults for developers, if it reveals actual errors by testing the mutated applications. We applied our method to real-world applications and found actual errors that developers could debug to improve their reliability. Therefore, JSPreventer can help developers validate reliable real-world Ajax applications.

ajax-delay

Publications

  1. Yuta Maezawa, “Interaction-Based Preventive Maintenance of Ajax Web Applications”, PhD thesis, The University of Tokyo, March 2015.
  2. Yuta Maezawa, Kazuki Nishiura, Hironori Washizaki, Shinichi Honiden, “Validating Ajax Applications Using a Delay-Based Mutation Technique”, In Proceedings of the 29th ACM/IEEE International Conference on Automated Software Engineering (ASE’14), pp.491-502, September 2014. Acceptance rate: 50/276=18.1%
  3. Yuta Maezawa, Hironori Washizaki, Yoshinori Tanabe, Shinichi Honiden, “Automated Verification of Pattern-Based Interaction Invariants in Ajax Applications”, In Proceedings of the 28th IEEE/ACM International Conference on Automated Software Engineering (ASE’13), pp.158-168, November 2013. Acceptance rate: 43/254=16.9%
  4. Yuta Maezawa, Hironori Washizaki, Shinichi Honiden, “Extracting Interaction-Based Stateful Behavior in Rich Internet Applications”, In Proceedings of the 16th European Conference on Software Maintenance and Reengineering (CSMR’12), pp.423-428, March 2012. Acceptance rate: 18/45=39.1% (Early Research Achievement Track)