0% found this document useful (0 votes)
87 views

Chapter 19 GUI Testing

The chapter discusses different types of testing for GUI applications, including unit testing, integration testing, and system testing. Unit testing involves testing individual components in isolation through a test driver. Integration testing checks how components work together, though it is less important for small GUIs. System testing focuses on testing the full application as a whole, including testing threads and using techniques like event-driven Petri nets.

Uploaded by

avuma22
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
87 views

Chapter 19 GUI Testing

The chapter discusses different types of testing for GUI applications, including unit testing, integration testing, and system testing. Unit testing involves testing individual components in isolation through a test driver. Integration testing checks how components work together, though it is less important for small GUIs. System testing focuses on testing the full application as a whole, including testing threads and using techniques like event-driven Petri nets.

Uploaded by

avuma22
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 38

Introduction The Currency Conversion Program Unit Testing Integration Testing System Testing Summary

Chapter 19: GUI Testing

Ian Tucker

December 3, 2006

Ian Tucker
Chapter 19: GUI Testing
Introduction The Currency Conversion Program Unit Testing Integration Testing System Testing Summary

1 Introduction
2 The Currency Conversion Program
An Introduction to the Program
Testing the program
3 Unit Testing
Unit Testing Considerations
Unit Testing Methods
4 Integration Testing
Integration Testing Considerations
5 System Testing
System Testing Considerations
System Level Threads
6 Summary

Ian Tucker
Chapter 19: GUI Testing
Introduction The Currency Conversion Program Unit Testing Integration Testing System Testing Summary

Introduction

Ian Tucker
Chapter 19: GUI Testing
Introduction The Currency Conversion Program Unit Testing Integration Testing System Testing Summary

Event driven
Unit “button level” testing
Not much integration testing
System level testing
UML Behavioral models
StateCharts
Finite State Machines

Ian Tucker
Chapter 19: GUI Testing
Introduction The Currency Conversion Program Unit Testing Integration Testing System Testing Summary

An Introduction to the Program

The Currency Conversion Program

Ian Tucker
Chapter 19: GUI Testing
Introduction The Currency Conversion Program Unit Testing Integration Testing System Testing Summary

Testing the program

The Program:
Testing the Program

Ian Tucker
Chapter 19: GUI Testing
Introduction The Currency Conversion Program Unit Testing Integration Testing System Testing Summary

Testing the program

Identify
User inputs
Visible & observable system outputs

Ian Tucker
Chapter 19: GUI Testing
Introduction The Currency Conversion Program Unit Testing Integration Testing System Testing Summary

Testing the program

Input Events

Input Event
ip1 Enter U.S. dollar amount
ip2 Click on a country button
ip2.1 Click on Brazil
ip2.2 Click on Canada
ip2.3 Click on European Community
ip2.4 Click on Japan
ip3 Click on Compute Button
ip4 Click on Clear Button
ip5 Click on Quit Button
ip6 Click on OK in error message

Ian Tucker
Chapter 19: GUI Testing
Introduction The Currency Conversion Program Unit Testing Integration Testing System Testing Summary

Testing the program

Output Events

Output Event
op1 Display U.S. dollar amount
op2 Display currency name
op2.1 Display Brazilian reals
op2.2 Display Canadian dollars
op2.3 Display European Community euros
op2.4 Display Japanese Yen
op2.5 Display ellipsis
op3 Indicate selected country
op3.1 Indicate Brazil
op3.2 Indicate Canada
op3.3 Indicate European Community
op3.4 Indicate Japan

Ian Tucker
Chapter 19: GUI Testing
Introduction The Currency Conversion Program Unit Testing Integration Testing System Testing Summary

Testing the program

Output Events

Output Event
op4 Reset selected country
op4.1 Reset Brazil
op4.2 Reset Canada
op4.3 Reset European Community
op4.4 Reset Japan
op5 Display foreign currency value
op6 Error msg: must select a country
op7 Error msg: must enter USD amount
op8 Error msg: must select country and enter USD amount
op9 Reset U.S. Dollar amount
op10 Reset equivalent currency amount

Ian Tucker
Chapter 19: GUI Testing
Introduction The Currency Conversion Program Unit Testing Integration Testing System Testing Summary

Testing the program

Ian Tucker
Chapter 19: GUI Testing
Introduction The Currency Conversion Program Unit Testing Integration Testing System Testing Summary

Testing the program

Ian Tucker
Chapter 19: GUI Testing
Introduction The Currency Conversion Program Unit Testing Integration Testing System Testing Summary

Unit Testing for the Currency


Conversion Program
All dem little bits

Ian Tucker
Chapter 19: GUI Testing
Introduction The Currency Conversion Program Unit Testing Integration Testing System Testing Summary

Unit Testing Considerations

Public domain GUI libraries


User supplied code
Compute, Clear, Quit

Ian Tucker
Chapter 19: GUI Testing
Introduction The Currency Conversion Program Unit Testing Integration Testing System Testing Summary

Unit Testing Methods

Unit Testing Methods

Test driver
GUI test bed
System level unit testing
What if computation correct, but fault in output software?
How do you get the test execution results?
Seat-of-the-pants testing
User input & observation errors
Repeating tests is time-consuming

Ian Tucker
Chapter 19: GUI Testing
Introduction The Currency Conversion Program Unit Testing Integration Testing System Testing Summary

Integration Testing for the


Currency Conversion Program
How all dem little bits fit together

Ian Tucker
Chapter 19: GUI Testing
Introduction The Currency Conversion Program Unit Testing Integration Testing System Testing Summary

Integration Testing Considerations

Depends heavily on implementation


Little need for most small GUIs

Ian Tucker
Chapter 19: GUI Testing
Introduction The Currency Conversion Program Unit Testing Integration Testing System Testing Summary

System Testing for the


Currency Conversion Program

Ian Tucker
Chapter 19: GUI Testing
Introduction The Currency Conversion Program Unit Testing Integration Testing System Testing Summary

System Testing Considerations

Unit and Integration testing minimally needed


Onus on System Testing
Testing threads
Event-driven Petri nets (EDPNs)

Ian Tucker
Chapter 19: GUI Testing
Introduction The Currency Conversion Program Unit Testing Integration Testing System Testing Summary

System Testing Considerations

Port Input Events

Port Input Events


p1 Enter U.S. dollar amount
p2 Click on Brazil
p3 Click on Canada
p4 Click on European Community
p5 Click on Japan
p6 Click on Compute Button
p7 Click on Clear Button
p8 Click on Quit Button

Ian Tucker
Chapter 19: GUI Testing
Introduction The Currency Conversion Program Unit Testing Integration Testing System Testing Summary

System Testing Considerations

Port Output Events

Port Output Events


p9 Display US Dollar Amount
p10 Display Brazilian reals
p11 Display Canadian dollars
p12 Display E.U. euros
p13 Display Japanese Yen
p14 Display ellipsis
p15 Indicate Brazil
p16 Indicate Canada
p17 Indicate European Community
p18 Indicate Japan

Ian Tucker
Chapter 19: GUI Testing
Introduction The Currency Conversion Program Unit Testing Integration Testing System Testing Summary

System Testing Considerations

Port Output Events

Port Output Events


p19 Reset Canada, E.U., Japan
p20 Reset Brazil, E.U., Japan
p21 Reset Brazil, Canada, Japan
p22 Reset Brazil, Canada, E.U.
p23 Reset U.S. Dollar amount
p24 Reset equivalent currency amount
p25 End Application
p26 Display equivalent currency amount

Ian Tucker
Chapter 19: GUI Testing
Introduction The Currency Conversion Program Unit Testing Integration Testing System Testing Summary

System Testing Considerations

Atomic System Functions

Atomic System Fuctions & Data Places


s1 US Dollar Amount Stored
s2 Sense Click on Brazil
s3 Sense Click on Canada
s4 Sense Click on EU
s5 Sense Click on Japan
s6 Sense Click on Compute Button
s7 Sense Click on Clear Button
s8 Sense Click on Quit Button
d1 US Dollar amount entered
d2 County selected

Ian Tucker
Chapter 19: GUI Testing
Introduction The Currency Conversion Program Unit Testing Integration Testing System Testing Summary

System Testing Considerations

EPDNs: A Simple Example

s1: Store Dollar Amount

Ian Tucker
Chapter 19: GUI Testing
Introduction The Currency Conversion Program Unit Testing Integration Testing System Testing Summary

System Testing Considerations

EPDNs: Little bit harder now

s4: Sense Click on E.U.


Ian Tucker
Chapter 19: GUI Testing
Introduction The Currency Conversion Program Unit Testing Integration Testing System Testing Summary

System Testing Considerations

EPDNs: Getting tougher

s6 Sense Click on Compute button

Ian Tucker
Chapter 19: GUI Testing
Introduction The Currency Conversion Program Unit Testing Integration Testing System Testing Summary

System Testing Considerations

EPDNs: Good luck

s7: Sense Click on Clear button


Ian Tucker
Chapter 19: GUI Testing
Introduction The Currency Conversion Program Unit Testing Integration Testing System Testing Summary

System Level Threads

Can combine ASF EDPNs into sequences:


System Level Threads

Ian Tucker
Chapter 19: GUI Testing
Introduction The Currency Conversion Program Unit Testing Integration Testing System Testing Summary

System Level Threads

EPDN Composition of four ASFs into a System Level Thread


Ian Tucker
Chapter 19: GUI Testing
Introduction The Currency Conversion Program Unit Testing Integration Testing System Testing Summary

System Level Threads

Partial Directed graph of mainline ASF Sequences


Ian Tucker
Chapter 19: GUI Testing
Introduction The Currency Conversion Program Unit Testing Integration Testing System Testing Summary

System Level Threads

How we test a GUI System

Lowest Level: exercise all ASFs


Not a good idea – no visible system-level outputs
Even worse – ASFs with no port outputs (s1)
Cannot tell if an amount is correctly stored
Next idea: exercise a suitable set of threads...
What the hell is a “suitable” set?

Ian Tucker
Chapter 19: GUI Testing
Introduction The Currency Conversion Program Unit Testing Integration Testing System Testing Summary

System Level Threads

Some possibilities

Every ASF
Every Port Input
Every Port Output

Ian Tucker
Chapter 19: GUI Testing
Introduction The Currency Conversion Program Unit Testing Integration Testing System Testing Summary

System Level Threads

Partial Directed graph of mainline ASF Sequences


Ian Tucker
Chapter 19: GUI Testing
Introduction The Currency Conversion Program Unit Testing Integration Testing System Testing Summary

System Level Threads

Consider a set of threads T [T1, T2, T3, T4]


T1 = [s1, s4, s6, s7]
T2 = [s1, s2, s6, s7]
T3 = [s3, s1, s6, s7]
T4 = [s5, s1, s7, s8]
Coverage:
Every ASF
Every port input
Every port output

Ian Tucker
Chapter 19: GUI Testing
Introduction The Currency Conversion Program Unit Testing Integration Testing System Testing Summary

System Level Threads

More Detail?

Next-level user behavior


A good example:
T5 = [s1, s2, s6, s3, s6, s4, s6, s5, s6, s7, s8]
Converts amount to all 4 currencies, clears and quits
Abnormal behavior sequences
T6 = [s1, s2, s3, s4, s5, s6, s7, s8]
Changes mind about currency
Silly threads
T7 = [s1, s2, s3, s2, s3, s2, s3, s8]
Toggles between 2 countries, then quits
An infinite amount of threads for this GUI

Ian Tucker
Chapter 19: GUI Testing
Introduction The Currency Conversion Program Unit Testing Integration Testing System Testing Summary

System Level Threads

An Incidence Matrix

s1 s2 s3 s4 s5 s6 s7 s8
s1 1 1 1 1 1 1 1 1
s2 1 0 1 1 1 1 1 1
s3 1 1 0 1 1 1 1 1
s4 1 1 1 0 1 1 1 1
s5 1 1 1 1 0 1 1 1
s6 1 1 1 1 1 1 1 1
s7 1 1 1 1 1 1 1 1
s8 0 0 0 0 0 0 0 0

Ian Tucker
Chapter 19: GUI Testing
Introduction The Currency Conversion Program Unit Testing Integration Testing System Testing Summary

Summary

Unit testing & integration testing not important


System testing most complicated test.
ASFs and EDPNs can help identify and validate test cases

Ian Tucker
Chapter 19: GUI Testing
Introduction The Currency Conversion Program Unit Testing Integration Testing System Testing Summary

Any Questions?

www.xkcd.com

Ian Tucker
Chapter 19: GUI Testing

You might also like