SlideShare a Scribd company logo
GUI-based Testing 
Alessandro Marchetto 
Fondazione Bruno Kessler - IRST
2 
GUI-based Testing 
• One of the practical methods commonly used to detect the 
presence of errors (failures) in a computer program is to 
exercise it by using its Graphical User Interface. 
Our program 
The output 
is correct? 
I1, I2, I3, 
…, In, … 
Expected results 
= ? 
Obtained results 
“Inputs” 
GUI
GUI-based Testing: again four main questions 
 At which level conducting the testing? 
3 
 Unit 
 Integration 
 System 
 Regression 
 How to choose inputs? 
 using the specifications/use cases/requirements 
 using the code 
 only considering the GUI (functionality, structure) 
 How to identify the expected output? 
 test oracles 
 How good test cases are? 
 when we can stop the testing activity
4 
GUI …. what? 
 GUI as a means to use/interact with the software 
systems 
 GUI are nowadays almost ubiquitous, even in safety 
critical systems 
 Different types of device (web, pc, tablet, palm, mobile) 
 GUI interacts with the underlying code by method calls 
or messages 
 GUI can exercise remote code 
 GUI responds to user events (e.g., mouse clicks) 
 GUIs are event-driven systems 
 Testing GUI correctness is critical for system usability, 
robustness and safety 
 The whole system can be executed by means of the 
GUI
GUI …. more formally 
A GUI (Graphical User Interface) is a hierarchical, 
5 
graphical front end to a software system 
A GUI contains graphical objects w, called widgets, each 
with a set of properties p, which have discrete values 
v at run-time. 
At any time during the execution, the values of the 
properties of each widget of a GUI define the GUI 
state: {… (w, p, v), …} 
A graphical event e is a state transducer, which yields the 
GUI from a state S to the next state S’.
6 
GUI-based Testing 
 Testing GUI software systems is different 
from testing non-GUI software 
 Non-GUI testing: suites are composed of test cases 
that invoke methods of the system and catch the 
return value/s; 
 GUI-based testing: suites are composed of test 
cases that are: 
 able to recognize/identify the components of a GUI; 
 able to exercise GUI events (e.g., mouse clicks); 
 able to provide inputs to the GUI components (e.g., filling text 
fields); 
 able to test the functionality underlying a GUI set of components; 
 able to check the GUI representations to see if they are 
consistent with the expected ones; 
 often, strongly dependent on the used technology;
7 
GUI testing difficulties 
 GUI test automation is difficult 
 Often GUI test automation is technology-dependent 
 Observing and trace GUI states is difficult 
 UI state explosion problem 
 A lot of possible states of the GUI 
 Controlling GUI events is difficult 
 Explosion of the possible combinations of events to do 
the same thing 
 GUI test maintenance is hard and costly 
 ……
8 
GUI testing advantages 
 Automation is feasible 
 Several frameworks and tools support it 
 Easy to conduct for non-expert people 
 It is funny to do 
 ……
Which type of GUI-based testing? 
9 
 System testing 
 Test the whole system 
 Acceptance testing 
 Accept the system 
 Regression testing 
 Test the system w.r.t. changes
10 
GUI-based Acceptance Testing 
Acceptance Tests are specified by the customer and analyst to test that the 
overall system is functioning as required (Do developers build the right 
system?). 
How? 
 Manual Acceptance testing. User exercises the system 
manually using his creativity. 
 Acceptance testing with “GUI Test Drivers” (at the GUI level). 
These tools help the developer do functional/acceptance testing 
through a user interface such as a native GUI or web interface. 
 Table-based acceptance testing. Starting from a user story (or 
use case or textual requirement), the customer enters in a table 
the expectations of the program’s behavior. 
 Black-Box (aka functional) approaches can be used to define 
test specification then executed manually, by means of the GUI or 
by table-based testing.
Approaches for GUI-based testing 
11 
 Manual based 
 Based on the domain and application knowledge of the tester 
 Capture and Replay 
 Based on capture and replay of user sessions 
 Model-based testing 
 Based on the execution of user sessions selected from a 
model of the GUI 
 Which type of model to use? 
 Event-based model 
 State-based model 
 Domain model 
 How do obtain the model to be used? 
 Specification-based model 
 Model recovered from existing software systems 
 Log-based model
Coverage criteria for GUI-based testing 
 Conventional code-based coverage cannot be 
12 
adequate; 
 GUIs are implemented in terms of event-based 
system, hence, the abstraction level is different w.r.t. 
the conventional system code. So mapping between 
GUI events and system code can not be so easy. 
 Possible coverage criteria: 
 Event-coverage: all events of the GUI need to be executed at 
least once 
 State-coverage: “all states” of the GUI need to be exercised 
at least once 
 Functionality-coverage: .. using a functional point of view
Event-based Model 
Model the space of GUI event interactions as a graph 
Given a GUI: 
1. create a graph model of all the possible sequences 
that a user can execute 
2. use the model to generate event sequences 
13
14 
Event-based Model 
“Event-flow graph” 
File 
New Open Save … 
Edit 
Cut Copy Paste Replace Undo … 
Editbox0 Editbox1 Match case 
Find next Replace Replace all Cancel 
Top level 
TC: <S0, event1, event2, …> 
Oracle: <State1, State2, …> & !CRASH
15 
Event-based Model 
Model Type: 
 Complete event-model 
 Partial event-model 
Event types: 
 Structural events (Edit, Replace) 
 Termination events (Ok, cancel) 
 System interaction events (Editbox0, Find next) 
Coverage criteria 
 Event coverage 
 Event coverage according the exercised functionality 
 Coverage of semantically interactive events 
 2-way, 3-way coverage 
 ….
16 
State-based Model 
Model the space of GUI event interactions as a state 
model, e.g., by using a finite state machine (FSM): 
• States are screenshot/representation of the GUI 
• Transitions are GUI events that change the GUI state 
Given a GUI: 
1. create a FSM of the possible sequences that a user 
can execute, considering the GUI state 
2. use the FSM to generate event sequences 
e1 
e2 
e3 
e4 e5
17 
State-based Model 
<ok> 
FSM: 
- State: GUI 
screenshot 
-Transition: event 
that changes the GUI 
state 
<fill + ok> 
<click> 
<click> 
<click> 
<fill> 
<fill> 
<ok> 
<fill + ok>
18 
..example 
Problem: state explosion! 
 Use of a state abstraction function 
It maps concrete states into abstract states 
(i.e., sets of concrete states)
19 
Log-based Recovered Model 
 How do obtain the model? 
 starting from system specification or 
requirements 
 starting from the system (i.e., reverse 
engineering) 
1. trace some system executions (at method calls 
level) 
2. infer a model 
3. refine it manually, if needed
Test oracles for GUI-based testing 
 It could be difficult to detect faults looking the GUI 
20 
 Crash testing is often used; 
 In a GUI test case, an incorrect GUI states can take the 
user to an unexpected/wrong interface screen or it 
can make the user unable to do a specific action; 
 e.g., after the click of a button, we try to click the button again 
but we fail since the button no longer exists, after the first click. 
 A GUI state can be “represented” by the components 
expected to be part of the GUI in a give time and their 
state/value 
 e.g., window position, GUI objects, GUI title, GUI content, GUI 
screenshots,
21 
GUI errors: examples 
 Incorrect functioning 
 Missing commands (e.g., GUI events) 
 Incorrect GUI screenshots/states 
 The absence of mandatory UI components (e.g., text 
fields and buttons) 
 Incorrect default values for fields or UI objects 
 Data validation errors 
 Incorrect messages to the user, after errors 
 Wrong UI construction 
 ….
22 
GUI-based Testing: process 
1. Identify the testing objective by defining a coverage 
criteria 
2. Generate test cases from GUI structure, specification, 
model 
 Generate sequences of GUI events 
 Complete them with inputs and expected oracles 
3. Define executable test cases 
4. Run them and check the results
23 
GUI-based Regression Testing 
 GUI-based testing means to execute the GUI of a 
system exercising its GUI components; 
 A small changes in the GUI layout can make the GUI 
test cases old and useless; 
 Hence, GUI-based test suite need to be maintained 
and often chagned 
 supporting tools are welcomed 
 Often, GUIs are realized by means of rapid prototyping 
or automatic framework. This requires an efficient 
approach to generate and maintain GUI test suite 
 supporting tools are welcomed
Capture and Replay 
A capture and replay testing tool captures user 
sessions (user inputs and events) and store 
them in scripts (one per session) suitable 
to be used to replay the user session. 
An ad-hoc infrastructure is needed to intercept GUI events, 
GUI states, thus storing user sessions and also to be 
able to replay them. 
- they can work at application or VM level 
24
25 
Recorded information 
 Inputs, outputs, and other information needed 
to replay a user session need to be recorded 
during the capture process. 
 Examples: 
 General information: date/time of recording, etc. 
 System start-up information 
 Events from test tool to system 
 Point of control, event 
 Events from system to test tool 
 Checkpoints / expected outputs 
 Time stamps
26 
Capture and Replay: the process 
1. The tester interacts with the system GUI to run the 
system, thus generating sessions of sequence of 
mouse clicks, UI and keyboard events; 
2. The tool captures and stores the user events and the 
GUI screenshots; 
 a script is produced per each user session 
3. The tester can automatically replay the execution by 
running the script 
 the script can be also changed by the tester 
 the script can be enriched with expected output, 
checkpoints 
 the script can be replicated to generate many variants (e.g., 
changing the input values) 
4. In case of GUI changes, the script must be updated
27 
Tools for GUI-based testing 
 Marathon 
 Abbot 
Java 
 Guitar 
 HtmlUnit, HttpUnit,JWebUnit 
 HtmlFixture 
 Selenium 
 …. 
Web
28 
Running Example: Calculator 
Calc_1 : 
 Logic mixed to GUI 
 GUI realized by using 
Swing 
Calc_2 : 
 Logic mixed to GUI 
 GUI realized by using AWT 
Calc_3 : 
 Logic separated from the 
GUI 
 GUI realized by using AWT 
+Swing 
These apps are from the net hence please refer to the author’s copyright
Marathon 
 Is a tool that helps writing System/GUI tests 
29 
for Java/Swing applications 
 Consists of a recorder, player, and an editor 
 Records tests script in Python 
 It is possible to use it without knowing Python … 
 Allows to insert assertions in the script easily 
 Using a specific GUI 
 Shows testing results using JUnit’s control bar 
 Red/green 
 http://www.marathontesting.com 
 download Marathon and its user manual
30 
Marathon example (1) 
 A calculator application 
was developed (Swing) 
 We want to write tests 
for the calculator 
 Ex. add two values 
 Steps: 
1. create a new Marathon 
project 
2. create a new empty test 
(a test is a Python script 
file) 
3. build the test (recording)
31 
Marathon example (2) 
Record the script 
• click on the record button in 
the toolbar 
– the red circle 
• enter “12 + 4 =”, the result is 
displayed (16) 
• press control + right-click in 
the text area, to open the 
contextual menu 
• select Assert Text 
• stop recording (the button 
with a red square), the script 
now looks like: 
• save the script
32 
Marathon example (3) 
Run the script 
• Select the “JUnit” tab 
• Click the test view, you should 
see your new created test 
• Click on the “Run all tests” 
button, in the JUnit’s control 
bar 
• and … 
• get the green bar …
33 
Abbot 
 Is a tool that helps writing System/GUI tests for Java 
AWT/Swing applications 
 Consists of a recorder, player, and an editor (via Costello, built 
on top of Abbot) 
 Records tests script in Java 
 Allows to write test cases directly from Java code (named 
programmatic GUI testing) 
 Allows to insert assertions in the script easily 
 Shows testing results using JUnit’s control bar 
 Red/green 
 Two main building blocks: 
 ComponentReferences to get a handle on a GUI component 
 Robot: to perform user-level actions on various GUI 
components 
 http://abbot.sourceforge.net 
 download Marathon and its user manual
34 
Abbot example (1) 
 A calculator application 
was developed 
(AWT/Swing) 
 We want to write tests 
for the calculator 
 Ex. add two values 
 Steps: 
1. create a new empty 
Abbot test 
2. Initialize the test with the 
application under test 
information 
3. build the test (recording)
35 
Abbot example (2) 
Recording 
1. Start recording of all 
actions 
2. Execute the software 
3. Add assertions 
1. select the GUI element 
with SHIFT+F1 
2. select the property (e.g., 
(“Text”) 
3. set the expected value 
4. Stop recording
36 
Guitar 
 A testing framework implementing the “Event-flow 
graph” approach 
 Four main components: 
 The GUIRipper: extract GUI information from a program 
 The GUIStructure2Graph: build a traversable graph 
representation of the GUI elements 
 The TestCaseGenerator: create an extensive set of test 
cases based on the graph 
 The GUIReplayer: run the program as instructed by these 
tests 
 It is a research tool… 
 http://guitar.cs.umd.edu 
 It requires ANT to be executed
37 
Guitar (1) 
Four main components: 
(1) GUIRipper: GUI information extraction 
>ant -Dproperties=jfcripper.properties -f jfcripper.xml 
(2) GUIStructure2Graph: Event-flow graph inference 
>ant -v -f GUIStructure2GraphConvert.xml
Guitar (2) 
(3) TestCaseGenerator: Test cases generation traversing the graph 
38 
>ant -v -f TestCaseGenerator.xml 
(4) GUIReplayer: Run the program GUI 
according to the generated test cases 
>ant -Dproperties=jfcreplayer.properties -f jfcreplayer.xml
Tools for other GUI-based testing of Java 
 HtmlUnit, HttpUnit, JWebUnit 
 HtmlFixture 
 Selenium 
 …. 
39
40 
XUnit Web tools 
HtmlUnit, HTTPUnit, JWebUnit, etc. 
- They are inspired by JUnit 
- They let us to verify the functionalities of Web sites 
- They emulate the relevant portions of browser behavior 
form submission, JavaScript, http authentication, cookies, automatic page 
redirection, etc. 
- They allow Java test code to examine returned pages 
in terms of text, DOM, or containers of forms, tables, and links 
- They make it easy to write Junit tests that verify HTTP requests 
and responses
Send the request 
41 
… HttpUnit example 
import junit.framework.TestCase; 
import com.meterware.httpunit.WebResponse; 
import com.meterware.httpunit.WebConversation; 
import com.meterware.httpunit.WebForm; 
import com.meterware.httpunit.WebRequest; 
public class SearchExample extends TestCase { 
public void testSearch() throws Exception { 
WebConversation wc = new WebConversation(); 
WebResponse resp = wc.getResponse("http://www.google.com"); 
WebForm form = resp.getForms()[0]; 
form.setParameter("q", "HttpUnit"); 
WebRequest req = form.getRequest("btnG"); 
resp = wc.getResponse(req); 
assertNotNull(resp.getLinkWith("HttpUnit")); 
resp = resp.getLinkWith("HttpUnit").click(); 
assertEquals(resp.getTitle(), "HttpUnit"); 
assertNotNull(resp.getLinkWith("User's Manual")); 
} 
} 
Set the google page 
Fill the google form 
get the google response 
verify the response
HtmlFixture 
http://fitnesse.org/FitNesse.HtmlFixture 
- It is used to exercise and test web pages. 
- It allows us make assertions about the structure of a page and to 
navigate between pages. 
- We can also fire java script, submit forms, "click" links, etc. 
- It is based on a fixture that lets us navigate to any element of 
the 
page DOM. 
To use this we need some knowledge about the DOM (Document 
Object Model). 
42
43 
… example
44 
Capture and Replay for Web 
Selenium 
http://seleniumhq.org/ 
Selenium IDE: a Firefox add-on 
that will do simple record-and- 
playback of interactions 
with the browser 
Selenium WebDriver: a 
collection of language specific 
bindings to drive a browser -- 
the way it is meant to be 
driven.
Additional references 
-Atif M. Memon. An event-flow model of GUI-based applications for testing. 
Software Testing, Verification and Reliability, 2007, John Wiley & Sons 
http://www.cs.umd.edu/~atif/papers/MemonSTVR2007-abstract.html 
-Atif M. Memon, M.E. Pollack, Mary Lou Soffa. A planning-based Approach to GUI 
testing. International Software/Internet Quality Week, May 2000 
http://www.cs.umd.edu/~atif/papers/MemonSQW2000-abstract.html 
-Marlon Vieira, Johanne Leduc, Bill Hasling, Rajesh Subramanyan, Juergen 
Kazmeier. Automation of GUI Testing Using a Model-driven Approach AST’06 
http://www.irisa.fr/lande/lande/icse-proceedings/ast/p9.pdf 
-Jessica Chen and Suganthan Subramaniam. A GUI Environment to Manipulate 
FSMs for Testing GUI-based Applications in Java. International Conference on 
System Sciences, 2001 
http://wenku.baidu.com/view/5f544c5377232f60ddcca145.html?from=related 
-Alessandro Marchetto, Paolo Tonella and Filippo Ricca. State-based testing of 
Ajax Applications. In Proceedings of the International Conference on Software 
Testing, 2008 http://selab.fbk.eu/tonella/papers/icst2008.pdf 
45

More Related Content

Viewers also liked

The fundamental problems of GUI applications and why people choose React
The fundamental problems of GUI applications and why people choose ReactThe fundamental problems of GUI applications and why people choose React
The fundamental problems of GUI applications and why people choose React
Oliver N
 
GUI -THESIS123
GUI -THESIS123GUI -THESIS123
GUI -THESIS123
Aparna Reddy
 
Gui in matlab :
Gui in matlab :Gui in matlab :
Gui in matlab :
elboob2025
 
Gui Development with qooxdoo
Gui Development with qooxdooGui Development with qooxdoo
Gui Development with qooxdoo
Sebastian Werner
 
Go & multi platform GUI Trials and Errors
Go & multi platform GUI Trials and ErrorsGo & multi platform GUI Trials and Errors
Go & multi platform GUI Trials and Errors
Yoshiki Shibukawa
 
Symbian OS - GUI Architectures
Symbian OS - GUI ArchitecturesSymbian OS - GUI Architectures
Symbian OS - GUI Architectures
Andreas Jakl
 
Matlab GUI
Matlab GUIMatlab GUI
VB.Net GUI Unit_01
VB.Net GUI Unit_01VB.Net GUI Unit_01
VB.Net GUI Unit_01
Prashanth Shivakumar
 
GUI Programming in JAVA (Using Netbeans) - A Review
GUI Programming in JAVA (Using Netbeans) -  A ReviewGUI Programming in JAVA (Using Netbeans) -  A Review
GUI Programming in JAVA (Using Netbeans) - A Review
Fernando Torres
 
Java GUI PART II
Java GUI PART IIJava GUI PART II
Java GUI PART II
OXUS 20
 
Python Programming - XIII. GUI Programming
Python Programming - XIII. GUI ProgrammingPython Programming - XIII. GUI Programming
Python Programming - XIII. GUI ProgrammingRanel Padon
 
GUI Programming In Java
GUI Programming In JavaGUI Programming In Java
GUI Programming In Java
yht4ever
 
Graphical User Interface (GUI) - 1
Graphical User Interface (GUI) - 1Graphical User Interface (GUI) - 1
Graphical User Interface (GUI) - 1
PRN USM
 
UI/GUI Design Guide Process Tutorial
UI/GUI Design Guide Process TutorialUI/GUI Design Guide Process Tutorial
UI/GUI Design Guide Process Tutorial
witstudio
 
GUI Test Patterns
GUI Test PatternsGUI Test Patterns
GUI Test Patterns
Rafael Pires
 
Graphical User Interface (Gui)
Graphical User Interface (Gui)Graphical User Interface (Gui)
Graphical User Interface (Gui)
Bilal Amjad
 
Guy haviv - History of GUI visual design
Guy haviv - History of GUI visual designGuy haviv - History of GUI visual design
Guy haviv - History of GUI visual design
Guy Haviv
 

Viewers also liked (17)

The fundamental problems of GUI applications and why people choose React
The fundamental problems of GUI applications and why people choose ReactThe fundamental problems of GUI applications and why people choose React
The fundamental problems of GUI applications and why people choose React
 
GUI -THESIS123
GUI -THESIS123GUI -THESIS123
GUI -THESIS123
 
Gui in matlab :
Gui in matlab :Gui in matlab :
Gui in matlab :
 
Gui Development with qooxdoo
Gui Development with qooxdooGui Development with qooxdoo
Gui Development with qooxdoo
 
Go & multi platform GUI Trials and Errors
Go & multi platform GUI Trials and ErrorsGo & multi platform GUI Trials and Errors
Go & multi platform GUI Trials and Errors
 
Symbian OS - GUI Architectures
Symbian OS - GUI ArchitecturesSymbian OS - GUI Architectures
Symbian OS - GUI Architectures
 
Matlab GUI
Matlab GUIMatlab GUI
Matlab GUI
 
VB.Net GUI Unit_01
VB.Net GUI Unit_01VB.Net GUI Unit_01
VB.Net GUI Unit_01
 
GUI Programming in JAVA (Using Netbeans) - A Review
GUI Programming in JAVA (Using Netbeans) -  A ReviewGUI Programming in JAVA (Using Netbeans) -  A Review
GUI Programming in JAVA (Using Netbeans) - A Review
 
Java GUI PART II
Java GUI PART IIJava GUI PART II
Java GUI PART II
 
Python Programming - XIII. GUI Programming
Python Programming - XIII. GUI ProgrammingPython Programming - XIII. GUI Programming
Python Programming - XIII. GUI Programming
 
GUI Programming In Java
GUI Programming In JavaGUI Programming In Java
GUI Programming In Java
 
Graphical User Interface (GUI) - 1
Graphical User Interface (GUI) - 1Graphical User Interface (GUI) - 1
Graphical User Interface (GUI) - 1
 
UI/GUI Design Guide Process Tutorial
UI/GUI Design Guide Process TutorialUI/GUI Design Guide Process Tutorial
UI/GUI Design Guide Process Tutorial
 
GUI Test Patterns
GUI Test PatternsGUI Test Patterns
GUI Test Patterns
 
Graphical User Interface (Gui)
Graphical User Interface (Gui)Graphical User Interface (Gui)
Graphical User Interface (Gui)
 
Guy haviv - History of GUI visual design
Guy haviv - History of GUI visual designGuy haviv - History of GUI visual design
Guy haviv - History of GUI visual design
 

Similar to 2.5 gui

A distinct approach for xmotif application gui test automation
A distinct approach for xmotif application gui test automationA distinct approach for xmotif application gui test automation
A distinct approach for xmotif application gui test automation
eSAT Publishing House
 
Hidden Object Detection for Computer Vision Based Test Automation System
Hidden Object Detection for Computer Vision Based Test Automation SystemHidden Object Detection for Computer Vision Based Test Automation System
Hidden Object Detection for Computer Vision Based Test Automation SystemSyeful Islam
 
Automated Generation, Evolution and Maintenance: a perspective for mobile GUI...
Automated Generation, Evolution and Maintenance: a perspective for mobile GUI...Automated Generation, Evolution and Maintenance: a perspective for mobile GUI...
Automated Generation, Evolution and Maintenance: a perspective for mobile GUI...
Riccardo Coppola
 
WinRunner Training
WinRunner TrainingWinRunner Training
WinRunner Training
sunny.deb
 
Gui path oriented test generation algorithms paper
Gui path oriented test generation algorithms paperGui path oriented test generation algorithms paper
Gui path oriented test generation algorithms paperIzzat Alsmadi
 
Win runner testing tool
Win runner testing toolWin runner testing tool
Win runner testing tool
mansirajpara
 
cse581_03_EventProgramming.ppt
cse581_03_EventProgramming.pptcse581_03_EventProgramming.ppt
cse581_03_EventProgramming.ppt
tadudemise
 
YuryMakedonov_GUI_TestAutomation_QAI_Canada_2007_14h
YuryMakedonov_GUI_TestAutomation_QAI_Canada_2007_14hYuryMakedonov_GUI_TestAutomation_QAI_Canada_2007_14h
YuryMakedonov_GUI_TestAutomation_QAI_Canada_2007_14hYury M
 
Testing
Testing Testing
Testing
vamshi batchu
 
IJCER (www.ijceronline.com) International Journal of computational Engineerin...
IJCER (www.ijceronline.com) International Journal of computational Engineerin...IJCER (www.ijceronline.com) International Journal of computational Engineerin...
IJCER (www.ijceronline.com) International Journal of computational Engineerin...ijceronline
 
Event driven theory
Event driven theoryEvent driven theory
Event driven theory
nickywalters
 
Selenium Testing Training in Bangalore
Selenium Testing Training in BangaloreSelenium Testing Training in Bangalore
Selenium Testing Training in Bangalore
rajkamal560066
 
RPA Developer Kickstarter | Day 3: UI Automation and UiPath Selectors
RPA Developer Kickstarter | Day 3: UI Automation and UiPath SelectorsRPA Developer Kickstarter | Day 3: UI Automation and UiPath Selectors
RPA Developer Kickstarter | Day 3: UI Automation and UiPath Selectors
Rohit Radhakrishnan
 
3 App Compat Win7
3 App Compat Win73 App Compat Win7
3 App Compat Win7
llangit
 
6months industrial training in software testing, ludhiana
6months industrial training in software testing, ludhiana6months industrial training in software testing, ludhiana
6months industrial training in software testing, ludhiana
deepikakaler1
 
6months industrial training in software testing, jalandhar
6months industrial training in software testing, jalandhar6months industrial training in software testing, jalandhar
6months industrial training in software testing, jalandhar
deepikakaler1
 
6 weeks summer training in software testing,ludhiana
6 weeks summer training in software testing,ludhiana6 weeks summer training in software testing,ludhiana
6 weeks summer training in software testing,ludhiana
deepikakaler1
 
6 weeks summer training in software testing,jalandhar
6 weeks summer training in software testing,jalandhar6 weeks summer training in software testing,jalandhar
6 weeks summer training in software testing,jalandhar
deepikakaler1
 
[Presentation] Automated Model-Based Android GUI Testing using Multi-Level GU...
[Presentation] Automated Model-Based Android GUI Testing using Multi-Level GU...[Presentation] Automated Model-Based Android GUI Testing using Multi-Level GU...
[Presentation] Automated Model-Based Android GUI Testing using Multi-Level GU...
Young-Min Baek
 

Similar to 2.5 gui (20)

A distinct approach for xmotif application gui test automation
A distinct approach for xmotif application gui test automationA distinct approach for xmotif application gui test automation
A distinct approach for xmotif application gui test automation
 
Hidden Object Detection for Computer Vision Based Test Automation System
Hidden Object Detection for Computer Vision Based Test Automation SystemHidden Object Detection for Computer Vision Based Test Automation System
Hidden Object Detection for Computer Vision Based Test Automation System
 
Automated Generation, Evolution and Maintenance: a perspective for mobile GUI...
Automated Generation, Evolution and Maintenance: a perspective for mobile GUI...Automated Generation, Evolution and Maintenance: a perspective for mobile GUI...
Automated Generation, Evolution and Maintenance: a perspective for mobile GUI...
 
WinRunner Training
WinRunner TrainingWinRunner Training
WinRunner Training
 
Gui path oriented test generation algorithms paper
Gui path oriented test generation algorithms paperGui path oriented test generation algorithms paper
Gui path oriented test generation algorithms paper
 
Win runner testing tool
Win runner testing toolWin runner testing tool
Win runner testing tool
 
cse581_03_EventProgramming.ppt
cse581_03_EventProgramming.pptcse581_03_EventProgramming.ppt
cse581_03_EventProgramming.ppt
 
YuryMakedonov_GUI_TestAutomation_QAI_Canada_2007_14h
YuryMakedonov_GUI_TestAutomation_QAI_Canada_2007_14hYuryMakedonov_GUI_TestAutomation_QAI_Canada_2007_14h
YuryMakedonov_GUI_TestAutomation_QAI_Canada_2007_14h
 
Testing
Testing Testing
Testing
 
IJCER (www.ijceronline.com) International Journal of computational Engineerin...
IJCER (www.ijceronline.com) International Journal of computational Engineerin...IJCER (www.ijceronline.com) International Journal of computational Engineerin...
IJCER (www.ijceronline.com) International Journal of computational Engineerin...
 
Event driven theory
Event driven theoryEvent driven theory
Event driven theory
 
Selenium Testing Training in Bangalore
Selenium Testing Training in BangaloreSelenium Testing Training in Bangalore
Selenium Testing Training in Bangalore
 
RPA Developer Kickstarter | Day 3: UI Automation and UiPath Selectors
RPA Developer Kickstarter | Day 3: UI Automation and UiPath SelectorsRPA Developer Kickstarter | Day 3: UI Automation and UiPath Selectors
RPA Developer Kickstarter | Day 3: UI Automation and UiPath Selectors
 
3 App Compat Win7
3 App Compat Win73 App Compat Win7
3 App Compat Win7
 
6months industrial training in software testing, ludhiana
6months industrial training in software testing, ludhiana6months industrial training in software testing, ludhiana
6months industrial training in software testing, ludhiana
 
6months industrial training in software testing, jalandhar
6months industrial training in software testing, jalandhar6months industrial training in software testing, jalandhar
6months industrial training in software testing, jalandhar
 
6 weeks summer training in software testing,ludhiana
6 weeks summer training in software testing,ludhiana6 weeks summer training in software testing,ludhiana
6 weeks summer training in software testing,ludhiana
 
6 weeks summer training in software testing,jalandhar
6 weeks summer training in software testing,jalandhar6 weeks summer training in software testing,jalandhar
6 weeks summer training in software testing,jalandhar
 
Software Testing 5/5
Software Testing 5/5Software Testing 5/5
Software Testing 5/5
 
[Presentation] Automated Model-Based Android GUI Testing using Multi-Level GU...
[Presentation] Automated Model-Based Android GUI Testing using Multi-Level GU...[Presentation] Automated Model-Based Android GUI Testing using Multi-Level GU...
[Presentation] Automated Model-Based Android GUI Testing using Multi-Level GU...
 

More from Jyothi Vbs

Kidney book-in-telugu
Kidney book-in-teluguKidney book-in-telugu
Kidney book-in-telugu
Jyothi Vbs
 
Shri anjaneya dhadakam_telugu
Shri anjaneya dhadakam_teluguShri anjaneya dhadakam_telugu
Shri anjaneya dhadakam_telugu
Jyothi Vbs
 
Aditya hrudayam-in-telugu
Aditya hrudayam-in-teluguAditya hrudayam-in-telugu
Aditya hrudayam-in-telugu
Jyothi Vbs
 
Vratam
VratamVratam
Vratam
Jyothi Vbs
 
Lalitha sahasra namamulu_telugu
Lalitha sahasra namamulu_teluguLalitha sahasra namamulu_telugu
Lalitha sahasra namamulu_telugu
Jyothi Vbs
 
Telugu strotras
Telugu strotrasTelugu strotras
Telugu strotras
Jyothi Vbs
 
Stotrams
StotramsStotrams
Stotrams
Jyothi Vbs
 
Hanuman dandakam
Hanuman dandakamHanuman dandakam
Hanuman dandakam
Jyothi Vbs
 
Bilvaashtakam in-telugu
Bilvaashtakam in-teluguBilvaashtakam in-telugu
Bilvaashtakam in-telugu
Jyothi Vbs
 
Shri anjaneya dhadakam_telugu
Shri anjaneya dhadakam_teluguShri anjaneya dhadakam_telugu
Shri anjaneya dhadakam_telugu
Jyothi Vbs
 
SDLC or Software Development Life Cycle
SDLC or Software Development Life CycleSDLC or Software Development Life Cycle
SDLC or Software Development Life Cycle
Jyothi Vbs
 
Completed slides
Completed slidesCompleted slides
Completed slides
Jyothi Vbs
 
20100310 liwen-waterfall (1)
20100310 liwen-waterfall (1)20100310 liwen-waterfall (1)
20100310 liwen-waterfall (1)
Jyothi Vbs
 
21 patra with telugu names and mantra for vinayaka chavithi
21 patra with telugu names and mantra for vinayaka chavithi21 patra with telugu names and mantra for vinayaka chavithi
21 patra with telugu names and mantra for vinayaka chavithi
Jyothi Vbs
 
Warren buffet principles & philosophy
Warren buffet principles & philosophyWarren buffet principles & philosophy
Warren buffet principles & philosophy
Jyothi Vbs
 
sdlc or Software Development LifeCycle
sdlc or Software Development LifeCyclesdlc or Software Development LifeCycle
sdlc or Software Development LifeCycle
Jyothi Vbs
 
Move forward in life life is yours rightway to achieve and win
Move forward in life  life is yours rightway to achieve and winMove forward in life  life is yours rightway to achieve and win
Move forward in life life is yours rightway to achieve and win
Jyothi Vbs
 
Slides1 - testing
Slides1 - testingSlides1 - testing
Slides1 - testingJyothi Vbs
 

More from Jyothi Vbs (18)

Kidney book-in-telugu
Kidney book-in-teluguKidney book-in-telugu
Kidney book-in-telugu
 
Shri anjaneya dhadakam_telugu
Shri anjaneya dhadakam_teluguShri anjaneya dhadakam_telugu
Shri anjaneya dhadakam_telugu
 
Aditya hrudayam-in-telugu
Aditya hrudayam-in-teluguAditya hrudayam-in-telugu
Aditya hrudayam-in-telugu
 
Vratam
VratamVratam
Vratam
 
Lalitha sahasra namamulu_telugu
Lalitha sahasra namamulu_teluguLalitha sahasra namamulu_telugu
Lalitha sahasra namamulu_telugu
 
Telugu strotras
Telugu strotrasTelugu strotras
Telugu strotras
 
Stotrams
StotramsStotrams
Stotrams
 
Hanuman dandakam
Hanuman dandakamHanuman dandakam
Hanuman dandakam
 
Bilvaashtakam in-telugu
Bilvaashtakam in-teluguBilvaashtakam in-telugu
Bilvaashtakam in-telugu
 
Shri anjaneya dhadakam_telugu
Shri anjaneya dhadakam_teluguShri anjaneya dhadakam_telugu
Shri anjaneya dhadakam_telugu
 
SDLC or Software Development Life Cycle
SDLC or Software Development Life CycleSDLC or Software Development Life Cycle
SDLC or Software Development Life Cycle
 
Completed slides
Completed slidesCompleted slides
Completed slides
 
20100310 liwen-waterfall (1)
20100310 liwen-waterfall (1)20100310 liwen-waterfall (1)
20100310 liwen-waterfall (1)
 
21 patra with telugu names and mantra for vinayaka chavithi
21 patra with telugu names and mantra for vinayaka chavithi21 patra with telugu names and mantra for vinayaka chavithi
21 patra with telugu names and mantra for vinayaka chavithi
 
Warren buffet principles & philosophy
Warren buffet principles & philosophyWarren buffet principles & philosophy
Warren buffet principles & philosophy
 
sdlc or Software Development LifeCycle
sdlc or Software Development LifeCyclesdlc or Software Development LifeCycle
sdlc or Software Development LifeCycle
 
Move forward in life life is yours rightway to achieve and win
Move forward in life  life is yours rightway to achieve and winMove forward in life  life is yours rightway to achieve and win
Move forward in life life is yours rightway to achieve and win
 
Slides1 - testing
Slides1 - testingSlides1 - testing
Slides1 - testing
 

Recently uploaded

Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Globus
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
Donna Lenk
 
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
Globus
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
Matt Welsh
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke
 
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Shahin Sheidaei
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Natan Silnitsky
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
Adele Miller
 
Accelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with PlatformlessAccelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with Platformless
WSO2
 
top nidhi software solution freedownload
top nidhi software solution freedownloadtop nidhi software solution freedownload
top nidhi software solution freedownload
vrstrong314
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Globus
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
Globus
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
Globus
 
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Mind IT Systems
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
Globus
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
rickgrimesss22
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
AMB-Review
 

Recently uploaded (20)

Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
 
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBroker
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
 
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
 
Accelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with PlatformlessAccelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with Platformless
 
top nidhi software solution freedownload
top nidhi software solution freedownloadtop nidhi software solution freedownload
top nidhi software solution freedownload
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
 
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
 

2.5 gui

  • 1. GUI-based Testing Alessandro Marchetto Fondazione Bruno Kessler - IRST
  • 2. 2 GUI-based Testing • One of the practical methods commonly used to detect the presence of errors (failures) in a computer program is to exercise it by using its Graphical User Interface. Our program The output is correct? I1, I2, I3, …, In, … Expected results = ? Obtained results “Inputs” GUI
  • 3. GUI-based Testing: again four main questions  At which level conducting the testing? 3  Unit  Integration  System  Regression  How to choose inputs?  using the specifications/use cases/requirements  using the code  only considering the GUI (functionality, structure)  How to identify the expected output?  test oracles  How good test cases are?  when we can stop the testing activity
  • 4. 4 GUI …. what?  GUI as a means to use/interact with the software systems  GUI are nowadays almost ubiquitous, even in safety critical systems  Different types of device (web, pc, tablet, palm, mobile)  GUI interacts with the underlying code by method calls or messages  GUI can exercise remote code  GUI responds to user events (e.g., mouse clicks)  GUIs are event-driven systems  Testing GUI correctness is critical for system usability, robustness and safety  The whole system can be executed by means of the GUI
  • 5. GUI …. more formally A GUI (Graphical User Interface) is a hierarchical, 5 graphical front end to a software system A GUI contains graphical objects w, called widgets, each with a set of properties p, which have discrete values v at run-time. At any time during the execution, the values of the properties of each widget of a GUI define the GUI state: {… (w, p, v), …} A graphical event e is a state transducer, which yields the GUI from a state S to the next state S’.
  • 6. 6 GUI-based Testing  Testing GUI software systems is different from testing non-GUI software  Non-GUI testing: suites are composed of test cases that invoke methods of the system and catch the return value/s;  GUI-based testing: suites are composed of test cases that are:  able to recognize/identify the components of a GUI;  able to exercise GUI events (e.g., mouse clicks);  able to provide inputs to the GUI components (e.g., filling text fields);  able to test the functionality underlying a GUI set of components;  able to check the GUI representations to see if they are consistent with the expected ones;  often, strongly dependent on the used technology;
  • 7. 7 GUI testing difficulties  GUI test automation is difficult  Often GUI test automation is technology-dependent  Observing and trace GUI states is difficult  UI state explosion problem  A lot of possible states of the GUI  Controlling GUI events is difficult  Explosion of the possible combinations of events to do the same thing  GUI test maintenance is hard and costly  ……
  • 8. 8 GUI testing advantages  Automation is feasible  Several frameworks and tools support it  Easy to conduct for non-expert people  It is funny to do  ……
  • 9. Which type of GUI-based testing? 9  System testing  Test the whole system  Acceptance testing  Accept the system  Regression testing  Test the system w.r.t. changes
  • 10. 10 GUI-based Acceptance Testing Acceptance Tests are specified by the customer and analyst to test that the overall system is functioning as required (Do developers build the right system?). How?  Manual Acceptance testing. User exercises the system manually using his creativity.  Acceptance testing with “GUI Test Drivers” (at the GUI level). These tools help the developer do functional/acceptance testing through a user interface such as a native GUI or web interface.  Table-based acceptance testing. Starting from a user story (or use case or textual requirement), the customer enters in a table the expectations of the program’s behavior.  Black-Box (aka functional) approaches can be used to define test specification then executed manually, by means of the GUI or by table-based testing.
  • 11. Approaches for GUI-based testing 11  Manual based  Based on the domain and application knowledge of the tester  Capture and Replay  Based on capture and replay of user sessions  Model-based testing  Based on the execution of user sessions selected from a model of the GUI  Which type of model to use?  Event-based model  State-based model  Domain model  How do obtain the model to be used?  Specification-based model  Model recovered from existing software systems  Log-based model
  • 12. Coverage criteria for GUI-based testing  Conventional code-based coverage cannot be 12 adequate;  GUIs are implemented in terms of event-based system, hence, the abstraction level is different w.r.t. the conventional system code. So mapping between GUI events and system code can not be so easy.  Possible coverage criteria:  Event-coverage: all events of the GUI need to be executed at least once  State-coverage: “all states” of the GUI need to be exercised at least once  Functionality-coverage: .. using a functional point of view
  • 13. Event-based Model Model the space of GUI event interactions as a graph Given a GUI: 1. create a graph model of all the possible sequences that a user can execute 2. use the model to generate event sequences 13
  • 14. 14 Event-based Model “Event-flow graph” File New Open Save … Edit Cut Copy Paste Replace Undo … Editbox0 Editbox1 Match case Find next Replace Replace all Cancel Top level TC: <S0, event1, event2, …> Oracle: <State1, State2, …> & !CRASH
  • 15. 15 Event-based Model Model Type:  Complete event-model  Partial event-model Event types:  Structural events (Edit, Replace)  Termination events (Ok, cancel)  System interaction events (Editbox0, Find next) Coverage criteria  Event coverage  Event coverage according the exercised functionality  Coverage of semantically interactive events  2-way, 3-way coverage  ….
  • 16. 16 State-based Model Model the space of GUI event interactions as a state model, e.g., by using a finite state machine (FSM): • States are screenshot/representation of the GUI • Transitions are GUI events that change the GUI state Given a GUI: 1. create a FSM of the possible sequences that a user can execute, considering the GUI state 2. use the FSM to generate event sequences e1 e2 e3 e4 e5
  • 17. 17 State-based Model <ok> FSM: - State: GUI screenshot -Transition: event that changes the GUI state <fill + ok> <click> <click> <click> <fill> <fill> <ok> <fill + ok>
  • 18. 18 ..example Problem: state explosion!  Use of a state abstraction function It maps concrete states into abstract states (i.e., sets of concrete states)
  • 19. 19 Log-based Recovered Model  How do obtain the model?  starting from system specification or requirements  starting from the system (i.e., reverse engineering) 1. trace some system executions (at method calls level) 2. infer a model 3. refine it manually, if needed
  • 20. Test oracles for GUI-based testing  It could be difficult to detect faults looking the GUI 20  Crash testing is often used;  In a GUI test case, an incorrect GUI states can take the user to an unexpected/wrong interface screen or it can make the user unable to do a specific action;  e.g., after the click of a button, we try to click the button again but we fail since the button no longer exists, after the first click.  A GUI state can be “represented” by the components expected to be part of the GUI in a give time and their state/value  e.g., window position, GUI objects, GUI title, GUI content, GUI screenshots,
  • 21. 21 GUI errors: examples  Incorrect functioning  Missing commands (e.g., GUI events)  Incorrect GUI screenshots/states  The absence of mandatory UI components (e.g., text fields and buttons)  Incorrect default values for fields or UI objects  Data validation errors  Incorrect messages to the user, after errors  Wrong UI construction  ….
  • 22. 22 GUI-based Testing: process 1. Identify the testing objective by defining a coverage criteria 2. Generate test cases from GUI structure, specification, model  Generate sequences of GUI events  Complete them with inputs and expected oracles 3. Define executable test cases 4. Run them and check the results
  • 23. 23 GUI-based Regression Testing  GUI-based testing means to execute the GUI of a system exercising its GUI components;  A small changes in the GUI layout can make the GUI test cases old and useless;  Hence, GUI-based test suite need to be maintained and often chagned  supporting tools are welcomed  Often, GUIs are realized by means of rapid prototyping or automatic framework. This requires an efficient approach to generate and maintain GUI test suite  supporting tools are welcomed
  • 24. Capture and Replay A capture and replay testing tool captures user sessions (user inputs and events) and store them in scripts (one per session) suitable to be used to replay the user session. An ad-hoc infrastructure is needed to intercept GUI events, GUI states, thus storing user sessions and also to be able to replay them. - they can work at application or VM level 24
  • 25. 25 Recorded information  Inputs, outputs, and other information needed to replay a user session need to be recorded during the capture process.  Examples:  General information: date/time of recording, etc.  System start-up information  Events from test tool to system  Point of control, event  Events from system to test tool  Checkpoints / expected outputs  Time stamps
  • 26. 26 Capture and Replay: the process 1. The tester interacts with the system GUI to run the system, thus generating sessions of sequence of mouse clicks, UI and keyboard events; 2. The tool captures and stores the user events and the GUI screenshots;  a script is produced per each user session 3. The tester can automatically replay the execution by running the script  the script can be also changed by the tester  the script can be enriched with expected output, checkpoints  the script can be replicated to generate many variants (e.g., changing the input values) 4. In case of GUI changes, the script must be updated
  • 27. 27 Tools for GUI-based testing  Marathon  Abbot Java  Guitar  HtmlUnit, HttpUnit,JWebUnit  HtmlFixture  Selenium  …. Web
  • 28. 28 Running Example: Calculator Calc_1 :  Logic mixed to GUI  GUI realized by using Swing Calc_2 :  Logic mixed to GUI  GUI realized by using AWT Calc_3 :  Logic separated from the GUI  GUI realized by using AWT +Swing These apps are from the net hence please refer to the author’s copyright
  • 29. Marathon  Is a tool that helps writing System/GUI tests 29 for Java/Swing applications  Consists of a recorder, player, and an editor  Records tests script in Python  It is possible to use it without knowing Python …  Allows to insert assertions in the script easily  Using a specific GUI  Shows testing results using JUnit’s control bar  Red/green  http://www.marathontesting.com  download Marathon and its user manual
  • 30. 30 Marathon example (1)  A calculator application was developed (Swing)  We want to write tests for the calculator  Ex. add two values  Steps: 1. create a new Marathon project 2. create a new empty test (a test is a Python script file) 3. build the test (recording)
  • 31. 31 Marathon example (2) Record the script • click on the record button in the toolbar – the red circle • enter “12 + 4 =”, the result is displayed (16) • press control + right-click in the text area, to open the contextual menu • select Assert Text • stop recording (the button with a red square), the script now looks like: • save the script
  • 32. 32 Marathon example (3) Run the script • Select the “JUnit” tab • Click the test view, you should see your new created test • Click on the “Run all tests” button, in the JUnit’s control bar • and … • get the green bar …
  • 33. 33 Abbot  Is a tool that helps writing System/GUI tests for Java AWT/Swing applications  Consists of a recorder, player, and an editor (via Costello, built on top of Abbot)  Records tests script in Java  Allows to write test cases directly from Java code (named programmatic GUI testing)  Allows to insert assertions in the script easily  Shows testing results using JUnit’s control bar  Red/green  Two main building blocks:  ComponentReferences to get a handle on a GUI component  Robot: to perform user-level actions on various GUI components  http://abbot.sourceforge.net  download Marathon and its user manual
  • 34. 34 Abbot example (1)  A calculator application was developed (AWT/Swing)  We want to write tests for the calculator  Ex. add two values  Steps: 1. create a new empty Abbot test 2. Initialize the test with the application under test information 3. build the test (recording)
  • 35. 35 Abbot example (2) Recording 1. Start recording of all actions 2. Execute the software 3. Add assertions 1. select the GUI element with SHIFT+F1 2. select the property (e.g., (“Text”) 3. set the expected value 4. Stop recording
  • 36. 36 Guitar  A testing framework implementing the “Event-flow graph” approach  Four main components:  The GUIRipper: extract GUI information from a program  The GUIStructure2Graph: build a traversable graph representation of the GUI elements  The TestCaseGenerator: create an extensive set of test cases based on the graph  The GUIReplayer: run the program as instructed by these tests  It is a research tool…  http://guitar.cs.umd.edu  It requires ANT to be executed
  • 37. 37 Guitar (1) Four main components: (1) GUIRipper: GUI information extraction >ant -Dproperties=jfcripper.properties -f jfcripper.xml (2) GUIStructure2Graph: Event-flow graph inference >ant -v -f GUIStructure2GraphConvert.xml
  • 38. Guitar (2) (3) TestCaseGenerator: Test cases generation traversing the graph 38 >ant -v -f TestCaseGenerator.xml (4) GUIReplayer: Run the program GUI according to the generated test cases >ant -Dproperties=jfcreplayer.properties -f jfcreplayer.xml
  • 39. Tools for other GUI-based testing of Java  HtmlUnit, HttpUnit, JWebUnit  HtmlFixture  Selenium  …. 39
  • 40. 40 XUnit Web tools HtmlUnit, HTTPUnit, JWebUnit, etc. - They are inspired by JUnit - They let us to verify the functionalities of Web sites - They emulate the relevant portions of browser behavior form submission, JavaScript, http authentication, cookies, automatic page redirection, etc. - They allow Java test code to examine returned pages in terms of text, DOM, or containers of forms, tables, and links - They make it easy to write Junit tests that verify HTTP requests and responses
  • 41. Send the request 41 … HttpUnit example import junit.framework.TestCase; import com.meterware.httpunit.WebResponse; import com.meterware.httpunit.WebConversation; import com.meterware.httpunit.WebForm; import com.meterware.httpunit.WebRequest; public class SearchExample extends TestCase { public void testSearch() throws Exception { WebConversation wc = new WebConversation(); WebResponse resp = wc.getResponse("http://www.google.com"); WebForm form = resp.getForms()[0]; form.setParameter("q", "HttpUnit"); WebRequest req = form.getRequest("btnG"); resp = wc.getResponse(req); assertNotNull(resp.getLinkWith("HttpUnit")); resp = resp.getLinkWith("HttpUnit").click(); assertEquals(resp.getTitle(), "HttpUnit"); assertNotNull(resp.getLinkWith("User's Manual")); } } Set the google page Fill the google form get the google response verify the response
  • 42. HtmlFixture http://fitnesse.org/FitNesse.HtmlFixture - It is used to exercise and test web pages. - It allows us make assertions about the structure of a page and to navigate between pages. - We can also fire java script, submit forms, "click" links, etc. - It is based on a fixture that lets us navigate to any element of the page DOM. To use this we need some knowledge about the DOM (Document Object Model). 42
  • 44. 44 Capture and Replay for Web Selenium http://seleniumhq.org/ Selenium IDE: a Firefox add-on that will do simple record-and- playback of interactions with the browser Selenium WebDriver: a collection of language specific bindings to drive a browser -- the way it is meant to be driven.
  • 45. Additional references -Atif M. Memon. An event-flow model of GUI-based applications for testing. Software Testing, Verification and Reliability, 2007, John Wiley & Sons http://www.cs.umd.edu/~atif/papers/MemonSTVR2007-abstract.html -Atif M. Memon, M.E. Pollack, Mary Lou Soffa. A planning-based Approach to GUI testing. International Software/Internet Quality Week, May 2000 http://www.cs.umd.edu/~atif/papers/MemonSQW2000-abstract.html -Marlon Vieira, Johanne Leduc, Bill Hasling, Rajesh Subramanyan, Juergen Kazmeier. Automation of GUI Testing Using a Model-driven Approach AST’06 http://www.irisa.fr/lande/lande/icse-proceedings/ast/p9.pdf -Jessica Chen and Suganthan Subramaniam. A GUI Environment to Manipulate FSMs for Testing GUI-based Applications in Java. International Conference on System Sciences, 2001 http://wenku.baidu.com/view/5f544c5377232f60ddcca145.html?from=related -Alessandro Marchetto, Paolo Tonella and Filippo Ricca. State-based testing of Ajax Applications. In Proceedings of the International Conference on Software Testing, 2008 http://selab.fbk.eu/tonella/papers/icst2008.pdf 45