SlideShare une entreprise Scribd logo
1  sur  55
Télécharger pour lire hors ligne
Testing Web Applications Through
User Interface Constraints
Sylvain Hallé
Université du Québec à Chicoutimi
CRSNG
NSERC
November 3rd, 2015
Exhibit A
Overlapping elements
Box has correct
size, if user not
logged in
Exhibit B
Elements extending outside
their container
Exhibit C
Incorrect z-index
Layout bugs don't
impact the application's
functionality...
Wait a minute...
Exhibit D
Tone on tone text
Exhibit E
Too much escaping
Exhibit F
Inaccessible elements
Can't scroll to
the left part of
the popup
Can't scroll to get the
missing buttons
Exhibit G
Form inconsistencies
Box pre-filled with 6 characters,
but has maxlength="5"
Textbox disappears if window
below specific width (scrolling
won't help)
Layout bugs can't probe
the application's
state...
Wait a minute...
Close button has no effect...
stuck in the pop-up!
Layout bugs are limited
to a single snapshot
of a page...
Wait a minute...
Incorrect search results
https://youtu.be/zCg537MZ6Ww
Crazy right click
https://youtu.be/iw7x3H51TFo
Incorrect button state
https://youtu.be/NGbl4vP350s
Summ
Experience reveals that many bugs
manifest themselves through their UI
They can be detected by observing
elements of the UI...
...in a single snapshot, or across
a sequence of snapshots
A language for expressing "high"-level
oracles over web UIs
- DOM + CSS attributes
- First-order quantification
- Temporal operators
1.
For each $x in $(css-selector)
something about $x.
There exists $x in $(css-selector)
such that
something about $x.
$x's prop is greater than
$y's prop
$x's height
$x's text
$x's color
$x's prop matches "a string"
...and most DOM/CSS
attributes
...and most common
functions
something And something else
Always something
Eventually something
something Until something else
The next time something,
then something else
...in other words, propositional logic + LTL
We say that pattern
When something.
Example:
We say that $x is wider than $y
When
$x's width is greater
than $y's width.
User-defined predicates to improve
legibility and create "mini-DSLs"
We say that I click on Go when (
There exists $b in $(button) such that (
($b’s text is "Go")
And
($b’s event is "mouseup"))).
Always (
If (I click on Go) Then (
There exists $x in $(.value) such that (
The next time (I click on Go)
Then (
There exists $y in $(.value) such that (
$x’s text equals $y’s text ))))).
$(document).mouseUp(function(event) {
var e = arguments.callee;
if ($(event.target).text() === "Go") {
var current_values = [];
$(".value").each(
current_values.push($(this).text());
);
if (e.lastValues !== undefined) {
var found = false;
for (var v in current_values) {
if ($.inArray(v, e.lastValues)) {
found = true;
break;
}
}
}
if (!found)
console.log("Error");
e.lastValues = current_values;}
};);
The same in jQuery
An architecture to instrument a web app
and report relevant UI attributes to an
interpreter
2.
Server
Application under test
<script ...
"getprobe?uid=39f2ac8">
Probe
creationRequest for probe code
Probe
interaction
Probe code
Probe (JS object)
Probe status report
Probe instructions (optional)
Probe log
Probe repository
Probe
retrieval
Developer
Probe ID
Dashboard
(analytics)
Developer
1
234
5
6
7
8
9
12
10
11
13 16
14
15
... $(ul li) ...
... 's width ...
... $(p#abc) ...
... 's color ...
The JavaScript probe is selective:
it only sends back the attributes
mentioned in the property
only for the elements matching one of
the selectors
A mechanism for explaining the violation
of a property when found
3.
Producing a witness for a violation does not
require to be coded in any way
It is just a by-product of evaluating the
logical expression
It works for temporal formulas
too!
See it in action
https://www.youtu.be/90YitGRRx2w
BEST
TOOL
Hallé, Bergeron, Guérin, Le Breton.
Testing Web Applications Through Layout
Constraints. Proc ICST 2015.
https://bitbucket.org/sylvainhalle/cornipickle
cIcI My 2 cents...
"Most browsers"
{ {Desktop
market share
Non-desktop
market share
75%
25%
cIcI My 2 cents...
In UI-based bugs, the browser matters
Don't take design choices that limit you from
the start (Selenium, any browser plugin)
If the app runs in browser X, so should your
testing tool
This may mean a lot of work ahead!
cIcI My 2 cents...
For each $x in $(selector)
blabla...
There exists $y in $(selector)
blabla...
CSS selectors are fragile. Simple changes to
the layout may break the property
cIcI My 2 cents...
...in search of a
carpenter
Hammer and
nails...
We still have to write the
properties, so what's the point?*
We're too busy to learn
another tool!*
Using this requires a higher level of
education. We'll have to increase the wages!*
*Really happened
We can already do all this (with a bunch
of home-brewed Python scripts)!*
Turn specifications into
sets of test cases
Run Cornipickle in tandem
with a crawler
Hub for sharing
specifications (à la
Greasemonkey)
https://lif-labs.github.io
http://lif.uqac.ca
http://leduotang.ca/sylvain

Contenu connexe

En vedette

Distributed Firewall Anomaly Detection Through LTL Model Checking
Distributed Firewall Anomaly Detection Through LTL Model CheckingDistributed Firewall Anomaly Detection Through LTL Model Checking
Distributed Firewall Anomaly Detection Through LTL Model Checking
Sylvain Hallé
 
2013 01 22 testing strategies for e commerce and social apps
2013 01 22   testing strategies for e commerce and social apps2013 01 22   testing strategies for e commerce and social apps
2013 01 22 testing strategies for e commerce and social apps
Cygnet Infotech
 

En vedette (20)

Fundamentals of Good User Interface Designing, Development & Testing
Fundamentals of  Good User Interface Designing, Development & TestingFundamentals of  Good User Interface Designing, Development & Testing
Fundamentals of Good User Interface Designing, Development & Testing
 
À la chasse aux bugs avec la Laboratoire d'informatique formelle
À la chasse aux bugs avec la Laboratoire d'informatique formelleÀ la chasse aux bugs avec la Laboratoire d'informatique formelle
À la chasse aux bugs avec la Laboratoire d'informatique formelle
 
Testing webapps, websites and mobile applications
Testing webapps, websites and mobile applicationsTesting webapps, websites and mobile applications
Testing webapps, websites and mobile applications
 
BeepBeep 3: A declarative event stream query engine (EDOC 2015)
BeepBeep 3: A declarative event stream query engine (EDOC 2015)BeepBeep 3: A declarative event stream query engine (EDOC 2015)
BeepBeep 3: A declarative event stream query engine (EDOC 2015)
 
Causality in Message-Based Interface Contracts: A Temporal Logic "Whodunit"
Causality in Message-Based Interface Contracts: A Temporal Logic "Whodunit"Causality in Message-Based Interface Contracts: A Temporal Logic "Whodunit"
Causality in Message-Based Interface Contracts: A Temporal Logic "Whodunit"
 
Activity Recognition Through Complex Event Processing: First Findings
Activity Recognition Through Complex Event Processing: First Findings Activity Recognition Through Complex Event Processing: First Findings
Activity Recognition Through Complex Event Processing: First Findings
 
A Case for "Piggyback" Runtime Monitoring
A Case for "Piggyback" Runtime MonitoringA Case for "Piggyback" Runtime Monitoring
A Case for "Piggyback" Runtime Monitoring
 
Decentralized Enforcement of Artifact Lifecycles
Decentralized Enforcement of Artifact LifecyclesDecentralized Enforcement of Artifact Lifecycles
Decentralized Enforcement of Artifact Lifecycles
 
Solving Equations on Words with Morphisms and Antimorphisms
Solving Equations on Words with Morphisms and AntimorphismsSolving Equations on Words with Morphisms and Antimorphisms
Solving Equations on Words with Morphisms and Antimorphisms
 
A Runtime Monitoring Framework for Event Streams with Non-Primitive Arguments
A Runtime Monitoring Framework for Event Streams with Non-Primitive ArgumentsA Runtime Monitoring Framework for Event Streams with Non-Primitive Arguments
A Runtime Monitoring Framework for Event Streams with Non-Primitive Arguments
 
Runtime Monitoring of Stream Logic Formulae (Talk @ FPS 2015)
Runtime Monitoring of Stream Logic Formulae (Talk @ FPS 2015)Runtime Monitoring of Stream Logic Formulae (Talk @ FPS 2015)
Runtime Monitoring of Stream Logic Formulae (Talk @ FPS 2015)
 
Runtime monitoring de propriétés temporelles par (streaming) XML
Runtime monitoring de propriétés temporelles par (streaming) XMLRuntime monitoring de propriétés temporelles par (streaming) XML
Runtime monitoring de propriétés temporelles par (streaming) XML
 
Distributed Firewall Anomaly Detection Through LTL Model Checking
Distributed Firewall Anomaly Detection Through LTL Model CheckingDistributed Firewall Anomaly Detection Through LTL Model Checking
Distributed Firewall Anomaly Detection Through LTL Model Checking
 
A formalization of complex event stream processing
A formalization of complex event stream processingA formalization of complex event stream processing
A formalization of complex event stream processing
 
Graph Methods for Generating Test Cases with Universal and Existential Constr...
Graph Methods for Generating Test Cases with Universal and Existential Constr...Graph Methods for Generating Test Cases with Universal and Existential Constr...
Graph Methods for Generating Test Cases with Universal and Existential Constr...
 
When RV Meets CEP (RV 2016 Tutorial)
When RV Meets CEP (RV 2016 Tutorial)When RV Meets CEP (RV 2016 Tutorial)
When RV Meets CEP (RV 2016 Tutorial)
 
MapReduce for Parallel Trace Validation of LTL Properties
MapReduce for Parallel Trace Validation of LTL PropertiesMapReduce for Parallel Trace Validation of LTL Properties
MapReduce for Parallel Trace Validation of LTL Properties
 
2013 01 22 testing strategies for e commerce and social apps
2013 01 22   testing strategies for e commerce and social apps2013 01 22   testing strategies for e commerce and social apps
2013 01 22 testing strategies for e commerce and social apps
 
Selenium-based Visual Test Automation
Selenium-based Visual Test AutomationSelenium-based Visual Test Automation
Selenium-based Visual Test Automation
 
Coded UI - Test automation Practices from the Field
Coded UI - Test automation Practices from the FieldCoded UI - Test automation Practices from the Field
Coded UI - Test automation Practices from the Field
 

Similaire à Testing Web Applications Through User Interface Constraints (CASCON 2015 Talk)

Progressive web and the problem of JavaScript
Progressive web and the problem of JavaScriptProgressive web and the problem of JavaScript
Progressive web and the problem of JavaScript
Christian Heilmann
 
I thought you were my friend - Malicious Markup
I thought you were my friend - Malicious MarkupI thought you were my friend - Malicious Markup
I thought you were my friend - Malicious Markup
Mario Heiderich
 
Grammarly AI-NLP Club #2 - Recent advances in applied chatbot technology - Jo...
Grammarly AI-NLP Club #2 - Recent advances in applied chatbot technology - Jo...Grammarly AI-NLP Club #2 - Recent advances in applied chatbot technology - Jo...
Grammarly AI-NLP Club #2 - Recent advances in applied chatbot technology - Jo...
Grammarly
 
Better. Faster. UXier. — AToMIC Design
Better. Faster. UXier. — AToMIC DesignBetter. Faster. UXier. — AToMIC Design
Better. Faster. UXier. — AToMIC Design
jennifer gergen
 

Similaire à Testing Web Applications Through User Interface Constraints (CASCON 2015 Talk) (20)

JavaScript isn't evil.
JavaScript isn't evil.JavaScript isn't evil.
JavaScript isn't evil.
 
Progressive web and the problem of JavaScript
Progressive web and the problem of JavaScriptProgressive web and the problem of JavaScript
Progressive web and the problem of JavaScript
 
Leveling up your JavaScipt - DrupalJam 2017
Leveling up your JavaScipt - DrupalJam 2017Leveling up your JavaScipt - DrupalJam 2017
Leveling up your JavaScipt - DrupalJam 2017
 
Google I/O State Of Ajax
Google I/O State Of AjaxGoogle I/O State Of Ajax
Google I/O State Of Ajax
 
I thought you were my friend - Malicious Markup
I thought you were my friend - Malicious MarkupI thought you were my friend - Malicious Markup
I thought you were my friend - Malicious Markup
 
All of Javascript
All of JavascriptAll of Javascript
All of Javascript
 
Sprachsteuerung mit dem Google Assistant – Add a new User Interface to your P...
Sprachsteuerung mit dem Google Assistant – Add a new User Interface to your P...Sprachsteuerung mit dem Google Assistant – Add a new User Interface to your P...
Sprachsteuerung mit dem Google Assistant – Add a new User Interface to your P...
 
Accessibility: A Journey to Accessible Rich Components
Accessibility: A Journey to Accessible Rich ComponentsAccessibility: A Journey to Accessible Rich Components
Accessibility: A Journey to Accessible Rich Components
 
Building a game engine with jQuery
Building a game engine with jQueryBuilding a game engine with jQuery
Building a game engine with jQuery
 
The power of CSS pseudo-elements
The power of CSS pseudo-elementsThe power of CSS pseudo-elements
The power of CSS pseudo-elements
 
Ig1 Mashups
Ig1   MashupsIg1   Mashups
Ig1 Mashups
 
The Real Story Behind JavaScript Performance on Mobile... Because Science!
The Real Story Behind JavaScript Performance on Mobile... Because Science!The Real Story Behind JavaScript Performance on Mobile... Because Science!
The Real Story Behind JavaScript Performance on Mobile... Because Science!
 
Grammarly AI-NLP Club #2 - Recent advances in applied chatbot technology - Jo...
Grammarly AI-NLP Club #2 - Recent advances in applied chatbot technology - Jo...Grammarly AI-NLP Club #2 - Recent advances in applied chatbot technology - Jo...
Grammarly AI-NLP Club #2 - Recent advances in applied chatbot technology - Jo...
 
Better. Faster. UXier. — AToMIC Design
Better. Faster. UXier. — AToMIC DesignBetter. Faster. UXier. — AToMIC Design
Better. Faster. UXier. — AToMIC Design
 
End-to-end testing with geb
End-to-end testing with gebEnd-to-end testing with geb
End-to-end testing with geb
 
The Inclusive Web: hands-on with HTML5 and jQuery
The Inclusive Web: hands-on with HTML5 and jQueryThe Inclusive Web: hands-on with HTML5 and jQuery
The Inclusive Web: hands-on with HTML5 and jQuery
 
jQuery in the [Aol.] Enterprise
jQuery in the [Aol.] EnterprisejQuery in the [Aol.] Enterprise
jQuery in the [Aol.] Enterprise
 
JavaScript Best Pratices
JavaScript Best PraticesJavaScript Best Pratices
JavaScript Best Pratices
 
Techniques For A Modern Web UI (With Notes)
Techniques For A Modern Web UI (With Notes)Techniques For A Modern Web UI (With Notes)
Techniques For A Modern Web UI (With Notes)
 
No estimates
No estimatesNo estimates
No estimates
 

Plus de Sylvain Hallé

A Stream-Based Approach to Intrusion Detection
A Stream-Based Approach to Intrusion DetectionA Stream-Based Approach to Intrusion Detection
A Stream-Based Approach to Intrusion Detection
Sylvain Hallé
 

Plus de Sylvain Hallé (20)

Monitoring Business Process Compliance Across Multiple Executions with Stream...
Monitoring Business Process Compliance Across Multiple Executions with Stream...Monitoring Business Process Compliance Across Multiple Executions with Stream...
Monitoring Business Process Compliance Across Multiple Executions with Stream...
 
A Stream-Based Approach to Intrusion Detection
A Stream-Based Approach to Intrusion DetectionA Stream-Based Approach to Intrusion Detection
A Stream-Based Approach to Intrusion Detection
 
Event Stream Processing with BeepBeep 3
Event Stream Processing with BeepBeep 3Event Stream Processing with BeepBeep 3
Event Stream Processing with BeepBeep 3
 
Smart Contracts-Enabled Simulation for Hyperconnected Logistics
Smart Contracts-Enabled Simulation for Hyperconnected LogisticsSmart Contracts-Enabled Simulation for Hyperconnected Logistics
Smart Contracts-Enabled Simulation for Hyperconnected Logistics
 
Test Suite Generation for Boolean Conditions with Equivalence Class Partitioning
Test Suite Generation for Boolean Conditions with Equivalence Class PartitioningTest Suite Generation for Boolean Conditions with Equivalence Class Partitioning
Test Suite Generation for Boolean Conditions with Equivalence Class Partitioning
 
Synthia: a Generic and Flexible Data Structure Generator (Long Version)
Synthia: a Generic and Flexible Data Structure Generator (Long Version)Synthia: a Generic and Flexible Data Structure Generator (Long Version)
Synthia: a Generic and Flexible Data Structure Generator (Long Version)
 
Test Sequence Generation with Cayley Graphs (Talk @ A-MOST 2021)
Test Sequence Generation with Cayley Graphs (Talk @ A-MOST 2021)Test Sequence Generation with Cayley Graphs (Talk @ A-MOST 2021)
Test Sequence Generation with Cayley Graphs (Talk @ A-MOST 2021)
 
Efficient Offline Monitoring of LTL with Bit Vectors (Talk at SAC 2021)
Efficient Offline Monitoring of LTL with Bit Vectors (Talk at SAC 2021)Efficient Offline Monitoring of LTL with Bit Vectors (Talk at SAC 2021)
Efficient Offline Monitoring of LTL with Bit Vectors (Talk at SAC 2021)
 
A Generic Explainability Framework for Function Circuits
A Generic Explainability Framework for Function CircuitsA Generic Explainability Framework for Function Circuits
A Generic Explainability Framework for Function Circuits
 
Detecting Responsive Web Design Bugs with Declarative Specifications
Detecting Responsive Web Design Bugs with Declarative SpecificationsDetecting Responsive Web Design Bugs with Declarative Specifications
Detecting Responsive Web Design Bugs with Declarative Specifications
 
Streamlining the Inclusion of Computer Experiments in Research Papers
Streamlining the Inclusion of Computer Experiments in Research PapersStreamlining the Inclusion of Computer Experiments in Research Papers
Streamlining the Inclusion of Computer Experiments in Research Papers
 
Writing Domain-Specific Languages for BeepBeep
Writing Domain-Specific Languages for BeepBeepWriting Domain-Specific Languages for BeepBeep
Writing Domain-Specific Languages for BeepBeep
 
Real-Time Data Mining for Event Streams
Real-Time Data Mining for Event StreamsReal-Time Data Mining for Event Streams
Real-Time Data Mining for Event Streams
 
Technologies intelligentes d'aide au développement d'applications web (WAQ 2018)
Technologies intelligentes d'aide au développement d'applications web (WAQ 2018)Technologies intelligentes d'aide au développement d'applications web (WAQ 2018)
Technologies intelligentes d'aide au développement d'applications web (WAQ 2018)
 
Mining event streams with BeepBeep 3
Mining event streams with BeepBeep 3Mining event streams with BeepBeep 3
Mining event streams with BeepBeep 3
 
LabPal: Repeatable Computer Experiments Made Easy (ACM Workshop Talk)
LabPal: Repeatable Computer Experiments Made Easy (ACM Workshop Talk)LabPal: Repeatable Computer Experiments Made Easy (ACM Workshop Talk)
LabPal: Repeatable Computer Experiments Made Easy (ACM Workshop Talk)
 
A "Do-It-Yourself" Specification Language with BeepBeep 3 (Talk @ Dagstuhl 2017)
A "Do-It-Yourself" Specification Language with BeepBeep 3 (Talk @ Dagstuhl 2017)A "Do-It-Yourself" Specification Language with BeepBeep 3 (Talk @ Dagstuhl 2017)
A "Do-It-Yourself" Specification Language with BeepBeep 3 (Talk @ Dagstuhl 2017)
 
Event Stream Processing with Multiple Threads
Event Stream Processing with Multiple ThreadsEvent Stream Processing with Multiple Threads
Event Stream Processing with Multiple Threads
 
A Few Things We Heard About RV Tools (Position Paper)
A Few Things We Heard About RV Tools (Position Paper)A Few Things We Heard About RV Tools (Position Paper)
A Few Things We Heard About RV Tools (Position Paper)
 
La quantification du premier ordre en logique temporelle
La quantification du premier ordre en logique temporelleLa quantification du premier ordre en logique temporelle
La quantification du premier ordre en logique temporelle
 

Dernier

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Dernier (20)

Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 

Testing Web Applications Through User Interface Constraints (CASCON 2015 Talk)

  • 1. Testing Web Applications Through User Interface Constraints Sylvain Hallé Université du Québec à Chicoutimi CRSNG NSERC November 3rd, 2015
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8. Box has correct size, if user not logged in
  • 9. Exhibit B Elements extending outside their container
  • 10.
  • 12.
  • 13.
  • 14. Layout bugs don't impact the application's functionality... Wait a minute...
  • 15. Exhibit D Tone on tone text
  • 16.
  • 17. Exhibit E Too much escaping
  • 18.
  • 19.
  • 21. Can't scroll to the left part of the popup
  • 22. Can't scroll to get the missing buttons
  • 24. Box pre-filled with 6 characters, but has maxlength="5"
  • 25. Textbox disappears if window below specific width (scrolling won't help)
  • 26. Layout bugs can't probe the application's state... Wait a minute...
  • 27. Close button has no effect... stuck in the pop-up!
  • 28.
  • 29.
  • 30.
  • 31. Layout bugs are limited to a single snapshot of a page... Wait a minute...
  • 32. Incorrect search results https://youtu.be/zCg537MZ6Ww Crazy right click https://youtu.be/iw7x3H51TFo Incorrect button state https://youtu.be/NGbl4vP350s Summ
  • 33. Experience reveals that many bugs manifest themselves through their UI They can be detected by observing elements of the UI... ...in a single snapshot, or across a sequence of snapshots
  • 34. A language for expressing "high"-level oracles over web UIs - DOM + CSS attributes - First-order quantification - Temporal operators 1.
  • 35. For each $x in $(css-selector) something about $x. There exists $x in $(css-selector) such that something about $x.
  • 36. $x's prop is greater than $y's prop $x's height $x's text $x's color $x's prop matches "a string" ...and most DOM/CSS attributes ...and most common functions
  • 37. something And something else Always something Eventually something something Until something else The next time something, then something else ...in other words, propositional logic + LTL
  • 38. We say that pattern When something. Example: We say that $x is wider than $y When $x's width is greater than $y's width. User-defined predicates to improve legibility and create "mini-DSLs"
  • 39. We say that I click on Go when ( There exists $b in $(button) such that ( ($b’s text is "Go") And ($b’s event is "mouseup"))). Always ( If (I click on Go) Then ( There exists $x in $(.value) such that ( The next time (I click on Go) Then ( There exists $y in $(.value) such that ( $x’s text equals $y’s text ))))).
  • 40. $(document).mouseUp(function(event) { var e = arguments.callee; if ($(event.target).text() === "Go") { var current_values = []; $(".value").each( current_values.push($(this).text()); ); if (e.lastValues !== undefined) { var found = false; for (var v in current_values) { if ($.inArray(v, e.lastValues)) { found = true; break; } } } if (!found) console.log("Error"); e.lastValues = current_values;} };); The same in jQuery
  • 41. An architecture to instrument a web app and report relevant UI attributes to an interpreter 2.
  • 42. Server Application under test <script ... "getprobe?uid=39f2ac8"> Probe creationRequest for probe code Probe interaction Probe code Probe (JS object) Probe status report Probe instructions (optional) Probe log Probe repository Probe retrieval Developer Probe ID Dashboard (analytics) Developer 1 234 5 6 7 8 9 12 10 11 13 16 14 15
  • 43. ... $(ul li) ... ... 's width ... ... $(p#abc) ... ... 's color ... The JavaScript probe is selective: it only sends back the attributes mentioned in the property only for the elements matching one of the selectors
  • 44. A mechanism for explaining the violation of a property when found 3.
  • 45.
  • 46.
  • 47. Producing a witness for a violation does not require to be coded in any way It is just a by-product of evaluating the logical expression It works for temporal formulas too!
  • 48. See it in action https://www.youtu.be/90YitGRRx2w BEST TOOL Hallé, Bergeron, Guérin, Le Breton. Testing Web Applications Through Layout Constraints. Proc ICST 2015. https://bitbucket.org/sylvainhalle/cornipickle
  • 49. cIcI My 2 cents... "Most browsers" { {Desktop market share Non-desktop market share 75% 25%
  • 50. cIcI My 2 cents... In UI-based bugs, the browser matters Don't take design choices that limit you from the start (Selenium, any browser plugin) If the app runs in browser X, so should your testing tool This may mean a lot of work ahead!
  • 51. cIcI My 2 cents... For each $x in $(selector) blabla... There exists $y in $(selector) blabla... CSS selectors are fragile. Simple changes to the layout may break the property
  • 52. cIcI My 2 cents... ...in search of a carpenter Hammer and nails...
  • 53. We still have to write the properties, so what's the point?* We're too busy to learn another tool!* Using this requires a higher level of education. We'll have to increase the wages!* *Really happened We can already do all this (with a bunch of home-brewed Python scripts)!*
  • 54. Turn specifications into sets of test cases Run Cornipickle in tandem with a crawler Hub for sharing specifications (à la Greasemonkey)