Web Testing
Web Testing
By Adithya N.
? Going Faster: Testing The Web Application
Edward Hieatt and Robert Mee (IEEE
Software)
? Analysis and Testing of Web Applications
Filippo Ricca and Paolo Tonella
Testing Challenges
? The
web Browser has an ability to send information through a map of string to a web server ? The server deals with the requests by passing it off to an engine running application code ? Test Client and server part ? Difficult to come up with testing framework for testing both at once
Solutions
? Test
parts of the server side code that are not directly concerned with being part of web application ? Test parts of the client side code that have no server interaction
JsUnit a testing framework for testing JavaScript ? Functional test that simulate the request/response
environment
Framework:
? ?
Test data in the output not the web page look ? Create UI <- XML -> HTML(using XSLT) ? Clean separation of testable data from HTML ? Compare the actual output with expected output
Unit Test
? Unit
test, for a new piece, before coding ? Positively affect overall code design ? Code Reusability ? Loose coupling between classes
example: overloading service() subclass, or a whole hierarchy of different classes makes it difficult to test ? Test-first approach removes code that handles request from the servlet itself and put it into its own class ? Modified Service(): creating new object (dispatcher) and handle the control to it. ? The dispatcher and each command object have their own tests.
? Servlet
Acceptance Tests
? Allows
product managers to express tests at the scenario level ? Testing tool that express operations in the system and the expected results as XML. ? EAI (Enterprise Application Integration) tool configured to generate XML ? XML though workable, is awkward for a human to write ? Evant Script Programming (ESP), which is more compact and readable than XML
Outline
? Create a UML ? Use
Test case generation ? Tools ReWeb TestWeb ? Example applications: Wordnet Amazon.com
software defines the notation and semantics for the following domains:
Use Case Model The Interaction or Collaboration Model The Logical or Class Model The Physical Component Model
Testing:Static Verification
? Static
analyzers
to scan the HTML pages in a web site detect possible faults and anomalies ? Analyzing
case for a web application is a sequence of pages to be visited + the input values to be provided to pages containing forms ? Execution consists of requesting the Web Server for the URLs in the sequence and storing the output pages
and All-paths criteria are often impractical because of the infinite paths in a site ? But can be satisfied with additional constraints
a set of paths in the web site graph and provide input ? Based on path expression ? Since Path expression directly represents all paths in the graph, it can used to generate test cases. ? Tester has to insert input values for the variables collected through forms ? Highly benefits regression testing
Path Expression: e 1e2e3e4 + e 5e6e7
ReWeb
Analysis
Testing
TestWeb
? Test case generation engine
path from model and generates test cases ? Test cases are sequences of URLs ? Satisfying selected coverage criteria ? Input value supplied by user
Experiment
? ReWeb and TestWeb on Wordnet
(http://cogsci.princeton.edu/~wn/) is a lexical reference system ? English nouns, verbs, adjective and adverb are organized into synonym sets, each representing one underlying lexical concept ? Different relation links the synonym sets
? Wordnet
Wordnet
? Three stages
0 webwn0: initial input page 1 webwn1: selection among alternative senses 2 webwn2: final output
Conclusion
? The technique and analysis proposed helps
expression e1e2e3(e4e5 + e6e7) ? Insert edge conditions (isNoun(word), etc) ? Select input to make each condition true ? Generate test cases ? Executed test cases ? No defect found
in assessing the site quality ? Allows a deep insight in the internal functioning of the web applications ? Future work
Reduction of the manual activities (e.g. State
unrolling )