Reverse Engineering Finite State Machines from Rich Internet Applications

968 views

Published on

In the last years, Rich Internet Applications (RIAs) have emerged as a new generation of web applications offering greater usability and interactivity than traditional ones. A combination of web technologies give RIAs new client-side elaboration capacity, new presentation features, and different communication mechanisms between client and server side, making them very similar to desktop applications and able to provide richer user experiences. At the same time, RIAs introduce new issues and challenges in all the web application lifecycle activities. As an example, a key problem with RIAs consists of defining suitable models for representing them from several points of view and defining Reverse Engineering processes for obtaining them effectively.
This paper proposes a model based on Finite State Machines for representing the behaviour offered by a RIA implemented with Ajax-based techniques, and presents a reverse engineering process and a tool for producing this model. The reverse engineering process is based on dynamic analysis of the RIA and employs clustering techniques based on equivalence criteria for solving the problem of state explosion of the state machine. A case study illustrated in the paper shows the results of a preliminary experiment where the proposed process has been executed with success for reverse engineering the behaviour of an existing RIA.

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
968
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
7
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Reverse Engineering Finite State Machines from Rich Internet Applications

  1. 1. Reverse Engineering Finite State Machines from Rich Internet Applications Domenico Amalfitano Anna Rita Fasolino Porfirio Tramontana Dipartimento di Informatica e Sistemistica University of Naples Federico II, Italy
  2. 2. Motivation In the last years, Rich Internet Applications (RIAs) have emerged as a new generation of web applications offering greater usability and interactivity than traditional ones.  Web pages have been transformed in complex GUIs with synchronous and asynchronous interactions with the user and with the resources Key problems:  to define models that are suitable for RIAs representation  to define Reverse Engineering techniques for the abstraction of the proposed modelPorfirio Tramontana – WCRE 2008 – Antwerp – 10/15/2008 2
  3. 3. RIA pages vs plain HTML pages Complex interactions between the user and the RIA in the browser environment are designed and implemented in Javascript  A simple model comprehending only pages and forms (e.g. the Conallen model) is not more suitable to describe RIAs Javascript event handlers can be associated to any DOM element and are able to modify the DOM instance itself XHR objects are also able to manage Http communicationsPorfirio Tramontana – WCRE 2008 – Antwerp – 10/15/2008 3
  4. 4. RIA Interactions Conceptual model• A ClientInterface +Builds Server Page Server Resourcecorrespond to the 1 1 1DOM instanced at * 1..* Transitiona given time in the Client Interface 1..* +End Transition Timestamp * * Web Page Request XHR Requestbrowser 1 0..1• The raise of an 1 1 Http Requestevent to which an DOM Raised Event 1 0..* +Timestampevent handler is * 1 1 Time Event Listenerassociated can 0..*cause a transition 1..* 1 1to another client DOM Element Event Listener Http Response Event Listenerinterface (i.e. a 1..* *variation of the Event HandlerDOM) User Event Listener Porfirio Tramontana – WCRE 2008 – Antwerp – 10/15/2008 4
  5. 5. Transition Graph RIA interactions can be modelled as a Transition Graph, where  each node is associated with a distinct Client Interface  each edge corresponds to the raise of an event  The event handler execution causes the variation between Client Interfaces.Porfirio Tramontana – WCRE 2008 – Antwerp – 10/15/2008 5
  6. 6. Reverse Engineering Process 1/2 In order to reconstruct the model of a RIA, a three steps process has been proposed  The Extraction step is obtained by dynamic analysis  A user navigates the RIA while it is monitored.  Probes applied externally to the DOM structure allow the tracing of the complete cycle of event raising/handling with a non-invasive approach For each observed Client Interface the complete set of tags, attributes and event handlers is stored End Tracing Start Tracing Event Waiting Raised Event Event Handling Completion Waiting entry/DOM Extraction entry/Transition Tracing exit/End transition Tracing Event Handling CompletedPorfirio Tramontana – WCRE 2008 – Antwerp – 10/15/2008 6
  7. 7. Reverse Engineering Process 2/2 In this step the retrieved information are analyzed in order to abstract the FSM Model of the RIA Two open issues:  When a Client Interface should be considered equivalent to a previously visited one?  What DOM elements and properties should be considered in order to compare two Client Interfaces? Two possible criteria to cluster together a pair of Client Interfaces have been proposed:  Criterion C1 considers equivalent two Client Interfaces if the corresponding DOM structures include the same set of DOM elements with the same registered event listeners and handlers  Criterion C2 considers equivalent two Client Interfaces if the criterion C1 is satisfied and the set of Http requests and time event listeners are equivalent, too. A Concept Assignment step, assisted by an expert, must be carried in order to assess if the applied equivalence criterion has been able to cluster together Client Interfaces corresponding to actual Interaction StatesPorfirio Tramontana – WCRE 2008 – Antwerp – 10/15/2008 7
  8. 8. RE-RIA Tool• The Tool supports the proposed Reverse Engineering Process• It is realised in Java with JavaXPCOM library in order to embed a Mozillainstance into the tool GUI Extractor Abstractor DOM Querying Browser DOM Clustering Extractor Trace Extractor Reverse FSM Engineering Abstractor Process Manager <<artifact>> <<artifact>> Statechart DataBase Diagram Porfirio Tramontana – WCRE 2008 – Antwerp – 10/15/2008 8
  9. 9. An example (1/2)• Based on FilmDB Ajax applicationfor data management of a personalmovie archive.• Five Users Sessions correspondingto the entering/exiting the personalmovie area use case scenarios wereexercised by a user and traced andcollected by the tool SCHERMATA FILMDB• A Transition Graph with 60 nodesand 59 edges was preliminaryobtained Porfirio Tramontana – WCRE 2008 – Antwerp – 10/15/2008 9
  10. 10. Example (2/2)• The C1 criterion was able toreduce the TG to 8 nodes and 22transitions• A Concept Assignment activityrevealed that some nodes could notbe associated with meaningfulstates, but had to be split intofurther logical states.• The C2 criterion produced a TGwith 12 nodes and 23 transitionsthat was validated by the ConceptAssignment activity Porfirio Tramontana – WCRE 2008 – Antwerp – 10/15/2008 10
  11. 11. Conclusions and Future Works This paper presented the initial results of a research project that aims at defining and validating techniques for reverse engineering software representation models from Rich Internet Applications. The proposing clustering criteria seems to be useful for the abstraction of a compact behaviour model of the RIA interfaces  Further criteria that are able to reduce the Concept Assignment step effort will be proposed in future The suitability of the obtained model to specific tasks, such as GUI testing, quality evaluation, migration to services will be explored in future worksPorfirio Tramontana – WCRE 2008 – Antwerp – 10/15/2008 11
  12. 12. Porfirio Tramontana – WCRE 2008 – Antwerp – 10/15/2008 12

×