University Logo Testing Web- based Applications · Examine queue View account Frequent customer...

8
Common Ground Research Day 2002 November 6, 2002 Common Ground Research Day 2002 1 University Logo Modeling and Testing Web- based Applications Jeff Offutt George Mason University Joint work with Ye Wu November 6, 2002 J. Offutt, George Mason University 2 Thesis Statement Web applications are heterogeneous , dynamic and must satisfy very high quality attributes Use of the Web is hindered by low quality Web sites and applications Web applications need to be built better and tested more

Transcript of University Logo Testing Web- based Applications · Examine queue View account Frequent customer...

Page 1: University Logo Testing Web- based Applications · Examine queue View account Frequent customer bonus WebPics: Bonjour Tim Berners-Lee! Search Recommended Movies I II III Examine

Common Ground Research Day 2002 November 6, 2002

Common Ground Research Day 2002 1

UniversityLogo

Modeling and Testing Web-

based Applications

Jeff OffuttGeorge Mason UniversityJoint work with Ye Wu

November 6, 2002 J. Offutt, George Mason University

2

Thesis Statement

• Web applications are heterogeneous, dynamic and must satisfy very high quality attributes

• Use of the Web is hindered by low quality Web sites and applications

• Web applications need to be builtbetter and tested more

Page 2: University Logo Testing Web- based Applications · Examine queue View account Frequent customer bonus WebPics: Bonjour Tim Berners-Lee! Search Recommended Movies I II III Examine

Common Ground Research Day 2002 November 6, 2002

Common Ground Research Day 2002 2

November 6, 2002 J. Offutt, George Mason University

3

Research in a Nutshell

• Web applications control flow cannot be determined statically

• Define atomic sections that have structural information and dynamic content

• Model is composition of atomic sections and regular expressions

• Model is used to support design, testing, and maintenance

November 6, 2002 J. Offutt, George Mason University

4

Client WebServer

ApplicationServer

DBServer

networkmiddleware

middleware

Client-server … 3-tier … N-tier …

Multi-tiered Web Software Systems

Page 3: University Logo Testing Web- based Applications · Examine queue View account Frequent customer bonus WebPics: Bonjour Tim Berners-Lee! Search Recommended Movies I II III Examine

Common Ground Research Day 2002 November 6, 2002

Common Ground Research Day 2002 3

November 6, 2002 J. Offutt, George Mason University

5

Important Web SoftwareQuality Attributes

1. Reliability2. Usability3. Security

Customers have little “site loyalty” and will switch quickly, thus time to market is much less important than in other application areas.

(but still important!)

4. Availability5. Scalability6. Maintainability7. Performance & Time-to-market

Based on an informal survey of a dozen software development managers, 2000.

November 6, 2002 J. Offutt, George Mason University

6

New Essential Problems of Web Site Software

2. Web software is extremely loosely coupled– Coupled through the Internet – separated by space– Coupled to diverse hardware and software– Web services dynamically couple with other services

after deployment – without human intervention!

1. Web software content providers and services offer dynamically changing flow of control– Web pages are created by software on user request– The UI controls vary depending on state: the user,

previous choices, server-side data, even time of day– Examples: amazon.com, netflix.com, aol.com,

washingtonpost.com

Page 4: University Logo Testing Web- based Applications · Examine queue View account Frequent customer bonus WebPics: Bonjour Tim Berners-Lee! Search Recommended Movies I II III Examine

Common Ground Research Day 2002 November 6, 2002

Common Ground Research Day 2002 4

November 6, 2002 J. Offutt, George Mason University

7

Problem 1: Dynamic Flow of Control

WebPics: Welcome Steve Case!

Search

Recommended Movies

A C DB

Examine queue

View account

Frequent customer bonus

WebPics: Bonjour Tim Berners-Lee!

Search

Recommended Movies

I IIIII

Examine queue

View account

(Warning: Queue empty)

How can we ensure the reliability of this type of system?

November 6, 2002 J. Offutt, George Mason University

8

Problem 2: Loosely Coupled

How can we ensure the reliability of this type of system?

Traditional systemsConnected by calls, message passing

High and moderate coupling

Web-based systemsConnected with network protocols

Loose and extremely loose coupling

Page 5: University Logo Testing Web- based Applications · Examine queue View account Frequent customer bonus WebPics: Bonjour Tim Berners-Lee! Search Recommended Movies I II III Examine

Common Ground Research Day 2002 November 6, 2002

Common Ground Research Day 2002 5

November 6, 2002 J. Offutt, George Mason University

9

Modeling Dynamic Control Flow

• Dynamic web pages are created when users make requests

• The program the user interacts with changes dynamically

• Unlike traditional software, we cannot determine potential flows of control before execution

• But all the pieces of the web pages and the programs are contained in the software …

November 6, 2002 J. Offutt, George Mason University

10

Atomic Sections

PrintWriter out = response.getWriter();

out.println ("<HTML>")

out.println ("<HEAD><TITLE>" + title + "</TITLE></HEAD>)"

out.println ("<BODY>")

for (int i=0; i<myVector.size(); i++)

if (myVector.elementAt(i).size > 10)

out.println(“<p><b>" + myVector.elementAt(i) + "</b></p>");

else

out.println ("<P>" + myVector.elementAt(i) + "</P>");

out.println ("</BODY></HTML>");

out.close();

P1 =

P2 =

P3 =

P4 =

Atomicsections

Contentvariables

HTML with static structure and content variables

Page 6: University Logo Testing Web- based Applications · Examine queue View account Frequent customer bonus WebPics: Bonjour Tim Berners-Lee! Search Recommended Movies I II III Examine

Common Ground Research Day 2002 November 6, 2002

Common Ground Research Day 2002 6

November 6, 2002 J. Offutt, George Mason University

11

Web Service Application Model

• Web pages are modeled as composite sections and regular expressions– Sequence, selection, aggregation– Conditions on inclusion of composite

sections• The previous example produces:

p → p1 • (p2 | p3)* • p4• Models can be produced automatically

November 6, 2002 J. Offutt, George Mason University

12

Test Criteria

• Tests are created by deriving sequences of transitions among the web software components and composite sections:– All productions in the grammar (each

atomic section)– Each selection used once– Each possible aggregation– MC/DC type coverage of conditions on

productions

Page 7: University Logo Testing Web- based Applications · Examine queue View account Frequent customer bonus WebPics: Bonjour Tim Berners-Lee! Search Recommended Movies I II III Examine

Common Ground Research Day 2002 November 6, 2002

Common Ground Research Day 2002 7

November 6, 2002 J. Offutt, George Mason University

13

Testing Loose Couplings

• Current integration testing covers couplingsamong the software components – requiring source

• Essential part of integration is how software components communicate

• XML stores data independently of type, without regard to format, in arbitrary order

• Tests created by modifying existing XMLmessages according to the XML Schema

November 6, 2002 J. Offutt, George Mason University

14

Benefit to AOL

• Model can support AOL, open source products, and content producers

• Better design, maintenance and testing can lead to better quality products and more satisfied customers

• Web applications can be more accessible to more people

• AOL is a content provider

Page 8: University Logo Testing Web- based Applications · Examine queue View account Frequent customer bonus WebPics: Bonjour Tim Berners-Lee! Search Recommended Movies I II III Examine

Common Ground Research Day 2002 November 6, 2002

Common Ground Research Day 2002 8

November 6, 2002 J. Offutt, George Mason University

15

Contact Information

Jeff OffuttInformation & Software Engineering

George Mason University+1 [email protected]

www.ise.gmu.edu/~ofut/Ye Wu, [email protected]