Testing AJAX functionality with UniTESK Yevgeny Gerlits, a postgraduate student from Lomonosov Moscow State University SYRCoSE 2010.

Slides:



Advertisements
Similar presentations
Multi-Paradigm Models as Source for Automatic Test Construction Victor Kuliamin ISP RAS, Moscow.
Advertisements

Interception of User’s Characteristics on the Web Michal Barla PeWe FIIT STU BA.
An Automata-based Approach to Testing Properties in Event Traces H. Hallal, S. Boroday, A. Ulrich, A. Petrenko Sophia Antipolis, France, May 2003.
How Can Simple Model Test Complex System Model Based Testing of Large-Scale Software Victor Kuliamin ISP RAS, Moscow.
CS 290C: Formal Models for Web Software Lecture 10: Language Based Modeling and Analysis of Navigation Errors Instructor: Tevfik Bultan.
HTML Form Processing Learning Web Design – Chapter 9, pp Squirrel Book – Chapter 11, pp
Cloud Computing Lecture #7 Introduction to Ajax Jimmy Lin The iSchool University of Maryland Wednesday, October 15, 2008 This work is licensed under a.
Microsoft ASP.NET AJAX - AJAX as it has to be Presented by : Rana Vijayasimha Nalla CSCE Grad Student.
1 State-Based Testing of Ajax Web Applications A. Marchetto, P. Tonella and F. Ricca CMSC737 Spring 2008 Shashvat A Thakor.
Formal Methods in Industrial Software Standards Enforcement A. Grinevich, A. Khoroshilov V. Kuliamin, D. Markovtsev A. Petrenko, V. Rubanov ISP RAS, Moscow,
It’s World Wide! I NTRODUCTION TO T HE WEB 1 Photo courtesy:
Client/Server Architectures
Agenda What is AJAX? What is jQuery? Demonstration/Tutorial Resources Q&A.
1 Web Servers (IIS and Apache) Outline 9.1 Introduction 9.2 HTTP Request Types 9.3 System Architecture 9.4 Client-Side Scripting versus Server-Side Scripting.
2012 National BDPA Technology Conference Creating Rich Data Visualizations using the Google API Yolanda M. Davis Senior Software Engineer AdvancED August.
Introduction to AJAX AJAX Keywords: JavaScript and XML
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
A Scalable Application Architecture for composing News Portals on the Internet Serpil TOK, Zeki BAYRAM. Eastern MediterraneanUniversity Famagusta Famagusta.
Beyond DHTML So far we have seen and used: CGI programs (using Perl ) and SSI on server side Java Script, VB Script, CSS and DOM on client side. For some.
Copyright © cs-tutorial.com. Introduction to Web Development In 1990 and 1991,Tim Berners-Lee created the World Wide Web at the European Laboratory for.
Languages in WEB Presented by: Jenisha Kshatriya BCM SS09.
Ruth Betcher Ruth Christie
11/13/2007 A synchronous J avaScript A nd X ML Gloria Law Joshua Mahaz.
TEST SUITE DEVELOPMENT FOR CONFORMANCE TESTING OF PROTOCOLS Anastasia Tugaenko Scientific Adviser: Nikolay Pakulin, PhD Institute for System Programming.
ASP.NET + Ajax Jesper Tørresø ITNET2 F08. Ajax Ajax (Asynchronous JavaScript and XML) A group of interrelated web development techniques used for creating.
Enabling Workflow in UPnP Networks Andreas BobekUniversity of Rostock Faculty of Computer Science and Electrical Engineering Andreas Bobek, Hendrik Bohn,
JavaScript is a client-side scripting language. Programs run in the web browser on the client's computer. (PHP, in contrast, is a server-side scripting.
Automated Generation of Test Suites from Formal Specifications Alexander K.Petrenko Institute for System Programming of Russian Academy of Sciences (ISP.
Intel Academic Forum. Budapest, September, 2002 ISPRAS Experience in Model Based Testing Alexander K. Petrenko, Institute for System Programming.
The Web Architecture and ASP.NET. Slide 2 Review of the Web (1) It began with HTTP and HTML, which delivers static Web pages to browsers which would render.
Asynchronous Interactive Design of Web Applications: Real-time SIP Message Monitoring System using AJAX Student: Yan-Hsiang Wang Advisor: Dr. Quincy Wu.
Web Applications BIS4430 – unit 8. Learning Objectives Explain the uses of web application frameworks Relate the client-side, server-side architecture.
1 Geospatial and Business Intelligence Jean-Sébastien Turcotte Executive VP San Francisco - April 2007 Streamlining web mapping applications.
Building Rich Web Applications with Ajax Linda Dailey Paulson IEEE – Computer, October 05 (Vol.38, No.10) Presented by Jingming Zhang.
Applying Model Based Testing in Different Contexts Alexander Petrenko Victor Kuliamin ISP RAS, Moscow.
UniTesK: Model Based Testing in Industrial Practice Victor Kuliamin Alexander Petrenko Alexander Kossatchev Igor Burdonov Institute for System Programming.
ISP RAS Java Specification Extension for Automated Test Development Igor B. Bourdonov, Alexei V. Demakov, Andrei A. Jarov, Alexander S. Kossatchev, Victor.
Ajax VS Flex A comparison based on shopping cart implementation PoHsu Yeh py2157.
UniTesK Test Suite Architecture Igor Bourdonov Alexander Kossatchev Victor Kuliamin Alexander Petrenko.
Dispatching Java agents to user for data extraction from third party web sites Alex Roque F.I.U. HPDRC.
1 What is JQuery. jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax* interactions.
 Web pages originally static  Page is delivered exactly as stored on server  Same information displayed for all users, from all contexts  Dynamic.
Department of Computer Science, Florida State University CGS 3066: Web Programming and Design Spring
UniTesK Test Suite Architecture Igor Bourdonov Alexander Kossatchev Victor Kuliamin Alexander Petrenko.
AJAX – Asynchronous JavaScript And XML By Kranthi Kiran Nuthi CIS 764 Kansas State University.
Text INTRODUCTION TO ASP.NET. InterComm Campaign Guidelines CONFIDENTIAL Simply Server side language Simplified page development model Modular, well-factored,
 AJAX technology  Rich User Experience  Characteristics  Real live examples  JavaScript and AJAX  Web application workflow model – synchronous vs.
ASP.Net ICallback Vijayalakshmi G M Senior Trainer Binary Spectrum.
Overview Web Technologies Computing Science Thompson Rivers University.
Open Solutions for a Changing World™ Eddy Kleinjan Copyright 2005, Data Access WordwideNew Techniques for Building Web Applications June 6-9, 2005 Key.
Ajax & Client-side Dynamic Web Gunwoo Park (Undergraduate)
12. DISTRIBUTED WEB-BASED SYSTEMS Nov SUSMITHA KOTA KRANTHI KOYA LIANG YI.
Arklio Studija 2007 File: / / Page 1 Automated web application testing using Selenium
Web Technologies Computing Science Thompson Rivers University
Self Healing and Dynamic Construction Framework:
Working with Client-Side Scripting
Application with Cross-Platform GUI
AJAX.
Whether you decide to use hidden frames or XMLHttp, there are several things you'll need to consider when building an Ajax application. Expanding the role.
AJAX.
Software Engineering for Internet Applications
AJAX Impact on Telecom It’s not just for web sites anymore.
Architectures of distributed systems Fundamental Models
Serpil TOK, Zeki BAYRAM. Eastern MediterraneanUniversity Famagusta
Architectures of distributed systems
Web Technologies Computing Science Thompson Rivers University
Introduction to AJAX and JSON
Ajax and JSON Jeremy Shafer Department of MIS Fox School of Business
Ajax and JSON Jeremy Shafer Department of MIS Fox School of Business
Creating dynamic/interactive web pages
Presentation transcript:

Testing AJAX functionality with UniTESK Yevgeny Gerlits, a postgraduate student from Lomonosov Moscow State University SYRCoSE 2010

2 AJAX vs. Classic web application Client side (browser) Server side HTTP response (HTML, CSS…) User interface event User interface Web server Back end User interface AJAX engine Web server Back end HTTP request Asynchronous HTTP request HTTP response (XML, JSON…) DOM change ClassicAJAX

3 Object of testing function onEventHandler() { } function callback() { } Client side (browser) Server side User interface AJAX engine Web server Back end Possible results of JavaScript execution: client side state changes including DOM, global JavaScript variables, and Cookies; page reloads; asynchronous HTTP requests; …

4 A problem: AJAX engine itself may initiate JavaScript processing JavaScript functions to create delayed actions: setTimeout (script, timeout); setInterval (script, timeout); clearTimeout (script, timeout); clearInterval (script, timeout) Client side (browser) Server side User interface AJAX engine Web server Back end

5 Technique for testing AJAX engine UniTESK – a general purpose, model based test development technology Test suite for systems with synchronous interfaces: 1. The next stimulus may be only after the reaction to the previous one. 2. SUT may not initiate interaction with its environment. Test suite for systems with asynchronous interfaces: 1. SUT may simultaneously interact with a couple of systems. 2. SUT may initiate interaction with its environment.

6 UniTESK test suite architecture for systems with asynchronous interfaces Formal descriptions:  Specification Test scenario Mediator   Components in the target programming language: Catcher  Model state Hyper oracle State mediator Test scenario Interaction register Action mediator Application under test Catcher Oracle

7 Elaboration of the specification for AJAX engine 1. Represent possible interactions of AJAX engine with its environment as a set of atomic stimuli and reactions. 2. Extract functional requirements to the behavior of AJAX engine. 3. Represent the requirements in the form of pre- conditions and post- conditions of stimuli and reactions, and model state invariants. Web server User interface AJAX engine Catcher Browser 1 Proxy server User interface AJAX engine Browser N Stimulus Reaction Detects reactions Action mediator

8 UniTESK tests for AJAX engine A test suite (covers the requirements in specification by traversing a FSM): A single test (Test-1): 1. mediator and proxy server apply a set of stimuli; catcher detects the reactions and saves their results; 2. hyper oracle verifies the results of the stimuli and reactions. Application states: Appropriate model states: Model-State-1 post(R 2 ) pre(S 1 )post(S 1 ), pre(R 1 )post(R 1 ), pre(R 2 ) Model-State-4 S1S1 R1R1 R2R2 App-State-1App-State-4 Test-2Test-1 Test-5 Test-N f (App-State-1, Model-State-1) f (App-State-4, Model-State-4) Test-3 Test-4 Test-6

9 Approbation process 1. Collect 8 AJAX design patterns. 2. Choose a pattern and implement it in a simple AJAX application. 3. Develop a test system for the application using UniTESK. 4. Assess the fault revealing capability of the test system: a. Inject a single fault into the AJAX engine of the application. b. Run the test system. c. See if the fault has been revealed. 5 times 8 times

10 AJAX design patterns and their implementations An AJAX design pattern: How to design an AJAX application so that it would behave in a certain way or a particular interactivity effect could be achieved? Pattern Predictive Fetch: Problem: How can you make an AJAX application respond quickly to user activity? Solution: Have the application anticipate likely user actions and call the server in preparation. Implementation: A multi-page article  12N

11 Injected faults Fault examples: removal of user interface event handlers; building incorrect HTTP requests; changing unique identifiers of HTML elements; removal of an HTTP request object; faults that result to the wrong processing of data in callback functions; … Characteristics of the injection process: Faults are injected at the client side of AJAX applications. There is no special fault injection procedure.

12 Test results AXAX application forIntroducedRevealed% 1. Explicit Submission55100% 2. Periodic Refresh5480% 3. Submission Throttling5480% 4. Predictive Fetch55100% 5. Browser-side cache55100% 6. Guesstimate5360% 7. Pseudo-threading5480% 8. Multi-stage download5480% TOTAL403485%

13 Conclusion and future work An approach to testing the client side of AJAX applications (AJAX engine) with UniTESK. Future work: enhance the automation level of the UniTESK approach; apply the UniTESK approach to a couple of AJAX applications available on WWW; design a new approach for testing both the client side and the server side of AJAX applications

14 Thank you!

15 References I. Bourdonov, A. Kossatchev, V. Kuliamin, and A. Petrenko, “UniTesK test suite architecture,” Proc. FME LNCS 2391, Springer-Verlag, 2002, pp I. Bourdonov, A. Kossatchev, V. Kuliamin, and A. Petrenko, “UniTesK: Model Based Testing in Industrial Practice,” Proc. the 1st European Conference on Model- Driven Software Engineering (ECMDSE), Nuremberg, Germany, Dec , 2003, pp A. Khoroshilov., “Specification and Testing Systems with Asynchronous Interfaces,” Preprint of the Inst. for System Programming, Russ. Acad. Sci., Moscow, V. Kuliamin, A. Petrenko, and N. Pakoulin, “Practical Approach to Specification and Conformance Testing of Distributed Network Applications,” Proc. ISAS'2005, Berlin, Germany, April 25-26, 2005, pp N. Pakulin and A. Khoroshilov, “Development of formal models and conformance testing for systems with asynchronous interfaces and telecommunications protocols,” Programming and Computer Software, vol. 33, number 6, Nov. 2007, pp , doi: /S

16 Contact Yevgeny Gerlits Lomonosov Moscow State University, Faculty of Computational Mathematics and Cybernetics, System Programming department

17 Comparison with the existing techniques Proposed by the scientific community: Invariant Based Testing; State Based Testing; Search Based Testing Used in industrial practice: Capture and Playback; Unit testing framework + software library to simulate user actions and programmatically access resulting DOM states FSM based approaches Advantages of our approachDisadvantages of our approach Modular test suite architectureLabor intensive, i.e. the automation level is low High fault exposing capability Ability to test concurrent HTTP requestMay reveal only client-side faults Specification-based test coverage measurement

18 First AJAX engine testing problem - a real situation of a set of users working with a single application

19 Solution to the first AJAX engine testing problem - a real situation of a set of users working with a single application Proxy server simulates server-side state changes that may be carried out by the users 2…N. Web server User interface AJAX engine Catcher Browser 1 Proxy server Stimulus Reaction Action mediator User interface AJAX engine Browser 2 User interface AJAX engine Browser N

20 Second AJAX engine testing problem - concurrent asynchronous HTTP requests Web serverDOMAJAX engine Asynchronous HTTP request 1 Asynchronous HTTP request 2 Response to the HTTP request 2 Removal of DOM element X Response to the HTTP request 1 Modification of DOM element X

21 Solution to the second AJAX engine testing problem - concurrent asynchronous HTTP requests A test for concurrent HTTP requests: 1. Action mediator applies stimulus 1; 2. Proxy server intercepts HTTP request 1; 3. Action mediator applies stimulus 2; 4. Proxy server intercepts HTTP request 2; 5. Proxy server emulates response to HTTP request 2; 6. Proxy server emulates response to HTTP request 1. Web server User interface AJAX engine Catcher Browser 1 Proxy server User interface AJAX engine Browser N Stimulus Reaction Detects reactions Action mediator

22 Third AJAX engine testing problem - AJAX engine itself may initiate JavaScript processing JavaScript functions to create delayed actions: setTimeout (script, timeout); setInterval (script, timeout); clearTimeout (script, timeout); clearInterval (script, timeout)

23 Solution to the third AJAX engine testing problem - AJAX engine itself may initiate JavaScript processing We impose a set of restrictions. An AJAX application may demonstrate a set of reactions but: after an external stimulus; the set of reactions is finite; there is an upper bound of time intervals, during which the reactions appear.

24 Fourth AJAX engine testing problem - how to programmatically detect AJAX engine reactions and get client side state changes? user interface event handlers setTimeout (CODE, timeout) callback functions Client side (browser) Server side User interface AJAX engine Web server Back end

25 Solution to the fourth AJAX engine testing problem - detecting AJAX engine reactions Existing approaches: Selenium RC testing tool - waitForCondition(sctipt, timeout); SWEA testing tool – AJAX complete event; Our approach: User interface event handlers, callback functions, and functions working with timers are programmatically instrumented to monitor the results of their execution.