ST L05 Testing Internet Applications

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 71

Software Testing

Testing Internet Applications

Phan Thi Hong


Lecturer
Faculty of Information Technology
Van Lang University

© 2016
Lecture Learning Objectives
 Objectives
▪ Provide some of the basic concepts about testing
internet applications.
▪ Identify the difference between testing internet-
based applications and testing traditional
applications.

 Outcomes
▪ Understand the difference between internet-based
applications and traditional applications

▪ Know how to apply testing techniques to test


internet-based applications
2
Outline
 Introduction and Background
▪ The Application Models

▪ Web Application Architectures

▪ The Differences Between Web-based and


Traditional Client-Server Systems

 Testing Internet Applications


▪ Web Testing Challenges

▪ Testing Strategies for Web Applications

3
08 | Testing Internet Applications

8.1. Introduction & Background


8.1.1. The Application Models
Section Overview
 In this section, we will review the following:
▪ Application models: from the models for mainframe
systems, desktop PC systems, typical client-server
systems, to the models for web-based systems

5
Guiding Questions

 How is a typical application model operated?

 What are differences between mainframe systems and


desktop PC systems? (components, characteristics,
operation)

 What are components of traditional client-server


systems? How are they operated?

6
A Typical Application Model

HUMAN SW/HW

INPUT LOGIC/RULES FILE SYSTEMS


Data entries Manipulate data Read/Write/Store data
Data requests
USER Data rules
USER INTERFACE
OUTPUT
Database or file-based
Feedback system
Requested data

Figure 8.1 – A Typical Application Model

7
Application Model – Mainframe Sys.

HUMAN SW/HW

INPUT LOGIC/RULES FILE SYSTEMS


Data entries Manipulate data Read/Write/Store data
Data requests
USER Data rules
USER INTERFACE
OUTPUT
Database or file-based
Feedback system
Requested data

Dumb Terminal Echoing Text

Mainframe

Figure 8.2 – Mainframe systems


8
Application Model – Desktop PC Sys.

HUMAN SW/HW

INPUT LOGIC/RULES FILE SYSTEMS


Data entries Manipulate data Read/Write/Store data
Data requests
USER Data rules
USER INTERFACE
OUTPUT
Database or file-based
Feedback system
Requested data

Desktop PC – Text or GUI

Figure 8.3 – Desktop PC systems


9
Application Model – Client-Server Sys.

HUMAN SW/HW

INPUT LOGIC/RULES FILE SYSTEMS


Data entries Manipulate data Read/Write/Store data
Data requests
USER Data rules
USER INTERFACE
OUTPUT
Database or file-based
Feedback system
Requested data

Desktop PC – Text or GUI


Application Server DB Server
Figure 8.4 – Client-Server systems
10
Application Model – Client-Server Sys.

Figure 8.5 – A Client-Server system on LAN


11
Application Model – Web-based Sys.

Figure 8.6 – Typical architecture of a web-based system (e-commerce site)

12
Application Model – Web-based Sys.

Figure 8.7 – Example of an order entry


application that retrieves and processes
information from several servers

13
Distributed Application Architecture
 A distributed system is a software system in which
components located on networked computers
communicate and coordinate their actions by passing
messages.

 In a distributed architecture, components are grouped


into clusters of related services.

 Distributed architectures are used for both traditional


client-server systems and Web-based client-server
systems.
14
Keep in mind that

software, not hardware, that defines clients


 It is

and servers

• Clients are software programs that


request services from other software
programs on behalf of end users.

• Servers are software programs that


offer services.

15
Section Questions

How is a typical application model operated?

What are differences between mainframe


systems and desktop PC systems? (components,
characteristics, operation)

What are components of traditional client-server


systems? How are they operated?
08 | Testing Internet Applications
8.1. Introduction & Background
8.1.2. Web Application
Architectures
Section Overview
 In this section, we will review the following:
▪ Historical perspective for web application
architectures
▪ What is a web application?
▪ Web application architectures of web 1.0, web 2.0
and web 3.0
▪ Design patterns

18
Guiding Questions
 What are components of web-based systems? How
are they operated?

 What are advantages and disadvantages of web


applications compared with standalone applications?

 What are differences between web application


architectures of web 1.0, web 2.0, and web 3.0?

 What is a design pattern? Which design patterns can


be applied to web-based systems?
19
Traditional Client-Server Systems

 A database access application typically consists of


four elements:
▪ User interface (UI) code

▪ Business logic code

▪ Data access service code

▪ Data storage

20
Thin-client vs. Thick-client Systems

CLIENT SERVER

Logic/Rule
User interface
Components

Data Access
Components

Data storage

Figure 8.8 – Thin-client System

21
Thin-client vs. Thick-client Systems

CLIENT SERVER

User interface

Logic/Rule Data Access


Components Components

Data storage

Figure 8.9 – Thick-client System

22
Section Questions
What are components of web-based systems? How are
they operated?

What are advantages and disadvantages of web


applications compared with standalone applications?

What are differences between web application


architectures of web 1.0, web 2.0, and web 3.0?

What is a design pattern? Which design patterns can be


applied to web-based systems?
08 | Testing Internet Applications

8.1. Introduction & Background


8.1.3. Web-based systems vs.
traditional client-server systems
Section Overview
 In this section, we will review the following:
▪ Distinguishing web-based systems and traditional client-server
systems

25
Web-based Sys. vs. Traditional C/S Sys.
Traditional Client-Server Systems Web-based Client-Server System
Client-side Applications
Clients of traditional C/S system are Web-based client is running in the context of a
platform-specific (Win 32/64, Linux, web browser.
etc.)
There are many different web browsers and
 A client application will be developed many difference versions of the same browser.
and tested for that target platform.  Web browser compatibility issues.
Event Handling
It supports many kinds of event- - It supports only single-clicking for navigation
handling, such as mouse-over, mouse and data submission, and mouse-over ALT
single-click, mouse double-click or attribute for an alternate description of
mouse-click with a modifier key such as graphic.
Ctrl.
- It offers very limited keyboard event
support.
- It supports explicit submission model (one-
way request and submission model).
26
Web-based Sys. vs. Traditional C/S Sys.

Traditional Client-Server Systems Web-based Client-Server System


Application Instance and Windows Handling
It supports multiple document The Web browser interface is flat and
interface (MDI) or multiple windows nonlinear; therefore, it does not support
interface. MDI.
UI Controls
It supports many kinds of UI controls. - It does not support many kinds of
common UI controls.
- It needs extra effort to go beyond the
basic functionality. However, there will
be compatibility issues among different
browsers.

27
Web-based Sys. vs. Traditional C/S Sys.

Traditional Client-Server Systems Web-based Client-Server System


Server-based Applications
- It is programs that have UI for user - Client can only interact with server-based
to interact with. applications to access functionality and
data via communication protocols,
- In contrast, to use a client
application programming interface (API),
application, an end-user must
and other interfacing standards.
explicitly launch the client
application and interact with it via - When a server-based application is
a UI. started, it's intended to stay up, waiting
to provide services to client applications
whether there is any client out there
requesting services.

Table 8.1 – Web-based Client-Server Systems vs. Traditional Client-Server Systems

28
08 | Testing Internet Applications

8.2. Testing Internet Application


8.2.1. Web testing challenges
Section Overview
 In this section, we will review the following:
▪ Challenges that we have when testing web
applications
▪ Some examples for testing 3-tiers of web
applications

30
Guiding Questions

 Which challenges should we concern when testing


web applications?

 How should we do to overcome these challenges?

31
Web Testing Challenges – Examples

Large and varied user base


 The users of your web site
▪ posses different skill sets
▪ employ a variety of browsers
▪ and use different operating
systems or devices

Locales
 Some internationalization issues
▪ Language translation
▪ Time zone difference
▪ Currency conversion

32
Web Testing Challenges – Examples

Business environment
 The tester must thoroughly understand
the structure of remote system, and
work closely with its owners and
developers to ensure security and
accuracy.

Security
 Since your site is open to the world,
you must protect it from hackers.

Testing environment
 Need to duplicate the production
environment.

33
Web Testing Challenges – Examples

Presentation tier Business tier Data tier


Ensure fonts are the same Verify proper calculation of Ensure database
across browsers sale tax and shipping operations meet
charges. performance goals.
Confirm that all links point Ensure documented Verify that data are stored
to valid files or websites. performance rates are met correctly and accurately.
for response times and
throughput rates.
Verify that graphics are the Verify that transactions Verify that you can recover
correct resolution and size. complete properly. using current backups.
Spell-check each page. Confirm that failed Test failover or redundancy
transactions roll back operations.
correctly.

Table 8.2 – Examples of Presentation, Business, and Data Tier Testing

34
Web Testing Challenges – Examples
Presentation tier Business tier Data tier
Have a copy editor check Ensure data are Test for proper data
grammar and style. collected correctly. encryption and security
(credit card and user’s
personal information, in
particular).
Check cursor positioning when Test backend data entry
page loads to ensure it is in the and management routines
correct textbox. for usability and accuracy.
Confirm that default button is
selected when the page loads.
Check for consistent and user-
friendly feedback on interactive
operations.
Check for business- or industry-
specific terms and style.
Table 8.2 – Examples of Presentation, Business, and Data Tier Testing
35
Section Questions

Which challenges should we concern when


testing web applications?

How should we do to overcome these


challenges?
08 | Testing Internet Applications
8.2. Testing Internet Application
8.2.2. Testing strategies for web
applications
Section Overview
 In this section, we will review the following:
▪ Testing strategies for web applications. Topics
include: testing strategies for presentation tier,
business tier, and data tier

40
Guiding Questions
 What is an overall testing strategy for web
applications?

 Presentation layer testing: What is the testing


objective of this layer? What testing strategies for this
layer?

 Business layer testing: What is the testing objective


of this layer? What testing strategies for this layer?

 Data layer testing: What is the testing objective of this


layer? What testing strategies for this layer?
41
Testing Strategies for Web Applications

 Developing a testing strategy for Internet-based


applications requires a solid understanding of the
hardware and software components that make up the
application.

 An overall testing strategy is that you should test


each tier independently before system testing
▪ Presentation Layer Testing

▪ Business Layer Testing

▪ Data Layer Testing


42
Strategies for Presentation Layer Testing
Objective: Three major areas:
Find defects in the • Content Testing
GUI or front end of • Website Architecture
your application Presentation
• User Environment
Layer Testing

Testing Strategies
for
Web App.
Business Data Layer
Layer Testing Testing

43
Presentation Layer – Content Testing

 Objective
▪ Find defects relating to human-interface elements
of a website.

 Why is it important?
▪ Providing grammatically correct, but inaccurate,
information harms your company’s credibility as
much as any other GUI defect.

▪ Inaccurate information may also cause legal


problems for your company.

44
Presentation Layer – Content Testing
 What should you do for content testing?
▪ You need to search for defects in
• Overall aesthetics (screen layout, colors)

• Font type/size

• Graphic resolutions

• Default values

• Spelling

• And other features that directly affect the end-user


experience.

▪ Verify the accuracy of information on website


45
Presentation Layer – Website Architecture

 Objective
▪ Test the website architecture by trying to find
navigational and structural errors.

 What should you test for website


architecture?
▪ You need to search for:
• broken links

• missing pages

• wrong files

• or anything that sends the user to the wrong area of the site.
46
Presentation Layer – Website Architecture

 Where are the sources of defects?


▪ All a project team member needs to do is rename a
file, and its hyperlink becomes invalid.
▪ Similarly, if a graphic element is renamed or
moved, then a hole will exist in your Web page
because the file cannot be found.

 How should you do?


▪ You can validate your website’s architecture by
• creating a unit test that checks each page for architectural
problems.
• applying white-box testing techniques to validate the
navigation or many combinations of navigation events
among the web pages.
47
Presentation Layer – User Environment
 Objective
▪ Find defects caused by
• the combination of browsers and operating system
• the incompatibility issues among different web browsers
and different versions of the same web browser as well.

 What are the causes of incompatibility issues?


▪ There are several different browsers on the market today, and
each behaves differently because most vendors enhance their
products in an effort to attract a loyal user base.

▪ Vendors often improve some feature of their browsers with


each release, which may or may not be compatible with older
versions.

48
Presentation Layer – User Environment

 What should you do for browser-compatibility


testing?
▪ Test each browser configuration and different versions of the
same browser as well.

▪ Pay particular attention to browser-compatibility issues if you


use any of the following:
• ActiveX controls
• JavaScript
• VBScript
• Java applets
• HTML 5
• Adobe flash
• PHP

49
Strategies for Business Layer Testing

Strategies:
• Internal and external components Testing

• Performance Testing Presentation


• Data Validation Layer Testing
• Transactional Testing

Testing Strategies
for
Web App.
Business Data Layer
Objective: Layer Testing Testing
Focus on finding errors
in the business logic of
your Web application.

50
Test Internal and External Components

 For the components developed in-house


▪ Firstly, create unit test and perform code review.
▪ Integrate the components into your system only after verifying
that they meet the design specifications and functionality
outlined in the specification document.

 For the components purchased from third party


▪ Develop a series of system tests to validate that they perform
correctly, independently of your application.
▪ Integrate these components only once you have determined
that they perform acceptably.

51
Business Layer – Performance Testing
 Test to see whether the application meets
documented performance specifications (generally
specified in response times and throughput rates).

 Response time
▪ The length of time between sending of an inquiry from the
client, to the display of the last byte of the response at a user
terminal.

 Throughput
▪ The amount of work that can be performed by a computer
system or component in a given period of time.

52
Business Layer – Data Validation

 Objective
▪ Test to detect
errors in data
collected from
customers.

53
Business Layer – Transactional Testing

 Objective
▪ Test to uncover errors in transaction processing, which may
include credit card processing, e-mailing verifications, and
calculating sales tax.

 Why is it important?
▪ Your e-commerce site must process transactions correctly
100 percent of the time. No exceptions.

▪ Besides a tarnished reputation and lost customers, you may


also incur legalliabilities associated with failed transactions.

54
Business Layer – Transactional Testing

 How should you do?

▪ You test the business layer from start to finish, trying to


uncover errors.

▪ You must test and validate that you can communicate


with the external services and that you receive correct
data back from them.

55
Strategies for Data Layer Testing

Three major areas:


Presentation • Response Time Testing
Layer Testing • Data Integrity Testing

• Fault Tolerance and Recoverability


Testing

Testing Strategies
for
Web App.
Business Data Layer Objective:
Layer Testing Testing Focus primarily on testing
the DBMS that your app.
uses to store and retrieve
info.

56
Data Layer Testing – Challenges

 One of the biggest challenges associated with


testing this layer is duplicating the production
environment.

▪ You must use equivalent hardware platforms and software


versions to conduct valid tests.

▪ In addition, once you obtain the resources, both financial


and labor, you must develop a methodology for keeping
production and test environments synchronized.

57
Data Layer – Response Time Testing

 Objective
▪ Focus on identifying database operations that do not meet
performance objectives.

 How should you do?

▪ Ensure that individual database operations (select,


insert, update, delete) occur quickly so as not to
bottleneck other operations.

▪ You do by measuring the response time simply consists of


determining how long each operation takes.

▪ NOT to measure the speed of a complete transaction.


58
Data Layer – Response Time Testing

 Challenges

▪ You MUST HAVE a test environment that matches what


you use in production; otherwise, you may get invalid test
results.

▪ Also, you MUST HAVE a thorough understanding of


your database system to make certain that it is set up
correctly and operating efficiently.

59
Data Layer – Data Integrity Testing

 Objective
▪ Data integrity testing
strives to find defects
in how you store data.

60
Data Layer – Data Integrity Testing

 Many factors can affect how the database stores


data.

▪ The data type and length can cause data truncation or


loss of precision.

▪ For date and time fields, time zone issues come into play.
• For instance, do you store time based on the location of the client, the
Web server, the application server, or the RDBMS?

▪ Internationalization and character sets can also affect


data integrity.
• For example, multi-byte character sets can double the amount of
storage required, plus they can cause queries to return padded data.

61
Data Layer – Data Integrity Testing

 You should also investigate


the accuracy of the
reference tables (sales tax,
zip codes, time zone) used by
your application, and must
keep the information up to
date.

62
Fault Tolerance & Recoverability Testing

 Robustness
▪ is the ability of a computer system to cope with errors during
execution.

 Mean Time Between Failures (MTBF)


▪ is the predicted elapsed time between inherent failures of a
system during operation.
▪ can be calculated as the arithmetic mean (average) time
between failures of a system.

 Mean Time To Repair (MTTR)


▪ is a basic measure of the maintainability of repairable items.
▪ represents the average time required to repair a failed
component or device.
63
Fault Tolerance & Recoverability Testing

 Objective
▪ Your goal when testing the database system robustness is to
try to exceed the numbers of MTBF and MTTR.

64
Fault Tolerance & Recoverability Testing

 How should you do?

▪ Maximizing MTBF depends on the fault-tolerance level of


your database system.

• You might have a failover architecture that allows active transactions to


switch to a new database when the primary system fails.

• Another scenario is that you build fault tolerance into your application so
that a downed database affects the system very little.

▪ The types of tests you run depend on the architecture.

65
Fault Tolerance & Recoverability Testing

 How should you do?

▪ The objective of recoverability testing is to create a scenario


in which you cannot recover that database.

▪ At some point, your database will crash, so you need to have


procedures in place to recover it very quickly.

• The planning for recovery begins in obtaining valid backups.

• If you cannot recover the database during recoverability testing, then you
need to modify your backup plan.

66
Fault Tolerance & Recoverability Testing

 How should you do?

▪ A fault-tolerant database system may reside in multiple


locations connected over a private or shared network.

• If the local server fails, are the remote systems current, and can your
software connect to a remote system quickly?

• What happens if one or more network connections fail?

• What happens if a system failure occurs while data is being written?

67
Section Questions
What is an overall testing strategy for web applications?

Presentation layer testing: What is the testing objective


of this layer? What testing strategies for this layer?

Business layer testing: What is the testing objective of


this layer? What testing strategies for this layer?

Data layer testing: What is the testing objective of this


layer? What testing strategies for this layer?
Take Away

The best way to proceed testing


Internet-based applications is
to narrow your testing efforts
to specific areas.

69
Take Away

Apply white-box approaches for


components developed in-
house and integrate them into your
system only after verifying that they
meet the design spec. and
functionality outlined in the spec.
70
Take Away

Apply black-box approaches for


third-party components and
integrate them into your application
only once you have determined that
they perform acceptably.

71
References
1. Hung Q. Nguyen, Testing Applications on the Web,
John Wiley & Sons, 2001: Chapter 2 & 5

2. Glenford J Mayers, Tom Badgett and Corey Sandler,


The Art of Software Testing, 3rd edition, John Wiley &
Sons, Inc., 2012: Chapter 10

72
Questions & Answers

73

You might also like