SlideShare a Scribd company logo
1 of 67
Download to read offline
1
JASON ARBON
FOUNDER AND CEO
TARIQ KING
SR. DIRECTOR, QUALITY ENGINEERING
2
A Self-Testing Approach
for Autonomic Software
Tariq M. King
Major Advisor:
Dr. Peter J. Clarke
JASON ARBON
FOUNDER AND CEO
TARIQ KING
SR. DIRECTOR, QUALITY ENGINEERING
Joanne Tseng
Data Scientist
@test.ai
Gregg Tabot
Machine Learning Engineer
@test.ai
Dionny Santiago
Principal Quality Architect
@ultimatesoftware
David Adamo Jr.
Quality Engineer
@ultimatesoftware
ARCHITECTS, ENGINEERS AND SCIENTISTS
THE REAL
3
4
Artificial Intelligence for Software Testing (AIST)
is an emerging field aimed at the development
of AI systems to test software, methods to test
AI systems, and ultimately designing software
that is capable of self-testing and self-healing.
5
AI TESTING TESTING AI
SELF-TESTING
TOOLS METHODS
DESIGNS
THIS TUTORIAL
On completion, participants will be able to:
o Explai nfu nda ment al ter ms and concep ts
used in the field of AI and ML.
o D escrib e vari ou s ML ap p roaches su ch as
D ecisi on Tree L earni ng, Rei nf orce ment
Learning, Neural and Bayesian networks.
o Discuss the AI-driven testing techniques
used in practice to validate mobile and
web applications.
o Identify tools and frameworks to aid
the development of AI-driven software
testing systems.
LEARNING OBJECTIVES
AI-DRIVEN TESTING
TOOLS
6
OUTLINE
 INTRODUCTION TO AI AND ML
o Autonomous and Intelligent Agents
o Machine Learning Approaches
o Classification: Training, Validation, Evaluation
 AI-DRIVEN SOFTWARE TESTING
o Perceiving the Environment with Decision Trees
o Generating Inputs with Neural Nets and Reinforcement Learning
o Classifying Test Failures and Flakiness with Bayesian Nets
 FUTURE TRENDS IN AI-DRIVEN TESTING
INTELLIGENCEINTELLIGENCEQuickness of understanding, high mental capacity, sound judgment and reason.
7
AUTONOMOUSGOAL-DRIVEN
ADAPTIVECOGNITIVE
8
SENSE
ANALYZE
PLAN
ACT
AUTONOMOUSGOAL-DRIVEN
ADAPTIVECOGNITIVE
KNOWLEDGE
9
artificial intelligence:
: a branch of computer science dealing with the
simulation of intelligent behavior in computers
: the capability of a machine to imitate intelligent
human behavior
1
2
10
Perceive and act in its environment using sensors
and actuators, respectively.
Direct its activity toward goals and use knowledge
and learning in achieving those goals.
Analyze itself in terms of behavior, error, and success
and adapt online, possibly in real time.
Be organized with other agents, typically in a hierarchy
to tackle problems at different abstraction levels.
Typically referred to as bots or AI’s.
AN AUTONOMOUS ENTITY THAT CAN…
INTELLIGENT AGENT
11
TYPES OF INTELLIGENT AGENTS
SIMPLE REFLEX AGENTS MODEL-BASED AGENTS GOAL-BASED AGENTS
UTILITY-BASED AGENTS LEARNING AGENTS
To acquire knowledge of, or skill in, by study, instruction or experience.
12
MORE THAN
MEMORIZING
MORE THAN
MEMORIZING
RECOGNIZING
STRUCTURE
RECOGNIZING
STRUCTURE
GENERALIZING
EXAMPLES
AND THEN
MAGIC HAPPENS…
APPLYING TO
NEW CONTEXT
FOLLOWS
INSTRUCTIONS
FOLLOWS
INSTRUCTIONS
LEARNS FROM
EXPERIENCE
LEARNS FROM
EXPERIENCE
13
machine learning:
the science of getting computers to act without being explicitly programmed
14
If a program can improve how it performs a certain
task based on previous experience then you can
say the program has learnt.
If a program can improve how it performs a certain
task based on previous experience then you can
say the program has learnt.
If th ep erfo rm anc eP of a comp ut er p rog ram at
compl et ing a t ask T imp roves w ith exp erienc eE,
the program is said to learn from experience E.
15
RAINDROPS NOT RAINDROPS
EXPERIENCE? THE ANSWER IS IN THE DATA
CLASSIFICATION
EXPERIENCE? THE ANSWER IS IN THE DATA
CATEGORY X CATEGORY Y
CLUSTERING
16
SUPERVISED
MACHINE LEARNING CATEGORIES
UNSUPERVISED REINFORCEMENT
Well-Labeled Data
Knowledge of Data/Outcome
Learning Based on Known Patterns
Unlabeled Data
No Knowledge of Data/Outcome
Discovering Unknown Patterns
Generating Data through Actions
Reward/Punish Based on Outcome
Learning By Trial-and-Error
MACHINE LEARNING CATEGORIES
Desired Output
{ 1,…, }
Desired Output
{ 1,…, }
Model
{ 1,…, }
Model
{ 1,…, }
World (or Data)World (or Data)
SUPERVISED
Model
{ 1,…, }
Model
{ 1,…, }
World (or Data)World (or Data)
UNSUPERVISED
Model OutputModel Output
Model
{ 1,…, }
Model
{ 1,…, }
World (or Data)World (or Data)
ReinforcementReinforcement
REINFORCEMENT
17
MACHINE LEARNING CATEGORIES
SUPERVISED UNSUPERVISED
CLUSTERINGREGRESSIONCLASSIFICATION
BAYESIAN (BELIEF) NETWORKS
DECISION TREES
OUTLOOK
SUNNY OVERCAST RAIN
HUMIDITY WIND
HIGH NORMAL
YES
NO YES NOYES
NEURAL NETWORKS K-MEANS CLUSTERING
REINFORCEMENT LEARNING
MACHINE LEARNING APPROACHES
18
GETTING STARTED WITH AI & ML
HALITE II: MAY THE BEST BOT WIN
https://halite.io
GETTING STARTED WITH AI & ML
HALITE II: MAY THE BEST BOT WIN
https://halite.io
Starter Bot 1: Simple Reflex Agent
19
GETTING STARTED WITH AI & ML
HALITE II: MAY THE BEST BOT WIN
Starter Bot 2: Learning Agent
20
Labeled
Data
Training Set
Testing Set
Features
Outlook Temp Humidity Windy Play Tennis
1 Rainy Hot High False No
2 Rainy Hot High True No
3 Overcast Hot High False Yes
4 Sunny Mild High False Yes
5 Sunny Cool Normal True Yes
6 Sunny Cool Normal True Yes
7 Overcast Cool Normal True Yes
8 Rainy Mild High False No
Class
9 Rainy Hot High False ?
10 Rainy Hot High True ?
11 Overcast Hot High False ?
12 Sunny Mild High False ?
CLASSIFICATION
SUPERVISED LEARNING: TRAINING AND VALIDATION
Data
Training Set
Testing Set
ML Algorithm
Model
Builds
+
+
-
+
-
+
+
+
-
+
-
+
Predictions
Predicted Class
Yes No
Actual
Class
Yes 4 1
No 0 10
Confusion Matrix
Evaluation
CLASSIFICATION
SUPERVISED LEARNING: TRAINING AND VALIDATION
21
+
+
-
+
-
+
+
+
-
+
-
+
Predictions
Predicted Class
Yes No
Actual
Class
Yes 4 1
No 0 10
Confusion Matrix
Evaluation
Accuracy =
Number of Correct Predictions
Total Number of Predictions
= 14 ÷ 15 = ~93.3%
Error =
Number of Wrong Predictions
Total Number of Predictions
= 1 ÷ 15 = ~6.7%
CLASSIFICATION
PERFORMANCE MEASURES: ACCURACY AND ERROR
+
+
-
+
-
+
+
+
-
+
-
+
Predictions
Evaluation
CLASSIFICATION
PERFORMANCE MEASURES: PRECISION AND RECALL Predicted Class
Yes No
Actual
Class
Yes
No
Confusion Matrix
TRUE
POSITIVES
TRUE
NEGATIVES
FALSE
NEGATIVES
FALSE
POSITIVES
The confusion matrix produced by classifiers shows four entities:
o True Positives, False Positives, True Negatives, False Negatives
Precision =
Recall =
What percentage of positive
identifications were correct?
What percentage of actual
positives were identified?
22
+
+
-
+
-
+
+
+
-
+
-
+
Predictions
Evaluation
CLASSIFICATION
PERFORMANCE MEASURES: PRECISION AND RECALL
Precision =
Recall =
Predicted Class
Yes No
Actual
Class
Yes
No
Confusion Matrix
TRUE
POSITIVES
TRUE
NEGATIVES
FALSE
NEGATIVES
FALSE
POSITIVES
The confusion matrix produced by classifiers shows four entities:
o True Positives, False Positives, True Negatives, False Negatives
True Positives
True Positives + False Positives
True Positives
True Positives + False Negatives
F1 Score =
Harmonic mean of precision and recall
which reaches its best at 1, worst at 0.
Evaluation
CLASSIFICATION
PERFORMANCE MEASURES: PRECISION AND RECALL
Precision =
Recall =
Confusion Matrix
TRUE
POSITIVES
TRUE
NEGATIVES
FALSE
NEGATIVES
FALSE
POSITIVES
The confusion matrix produced by classifiers shows four entities:
o True Positives, False Positives, True Negatives, False Negatives
True Positives
True Positives + False Positives
True Positives
True Positives + False Negatives
F1 Score =
Precision ∙ Recall
Precision + Recall
2 ∙
23
CLASSIFICATION
GENERAL EXAMPLES
CLASSIFICATION
AI FOR SOFTWARE TESTING
24
OUTLINE
 AI-DRIVEN SOFTWARE TESTING
o Perceiving the Environment with Decision Trees
o Generating Inputs with Neural Nets and Reinforcement Learning
o Classifying Test Failures and Flakiness with Bayesian Nets
TESTING BOTS
AI-DRIVEN TESTING FROM THE OUTSIDE-IN
25
AI-DRIVEN TESTING IN PRACTICE
AI-DRIVEN TESTING IN PRACTICE
+
MACHINE LEARNING TEST DRIVERS CLOUD COMPUTING
+
Artificial Neural Networks
Decision Tree Learning
Reinforcement Learning
Bayesian Networks
Selenium, Sikuli, Robot
Appium, Calabash, Robotium
JUnit, Nunit, xUnit
Custom-Built
Test Execution
Environment Provisioning
Data Generation
Analysis/Reporting
26
TEST BOT TRAINING
HOW BOTS LEARN TO PERCEIVE THE APPLICATION
html
head body
title pdiv
font-size: 16px
Hello Worldimg
font-size : 16px
font-weight: bold
Compute Render Trees
PERCEIVE
What can we interact with?
Train Image Recognition
LOGINLOGIN
WEB UI CLASSIFICATION
Suppose you wanted to use ML to identify various
elements of a user interface.
EXAMPLE: PERCEIVING WEB PAGES, CONTROLS, ERROR MESSAGES
27
WEB UI CLASSIFICATION
MODEL TRAININGFEATURE ENGINEERINGDATA PREPARATION
Decision Trees
Random Forests
Determine attributes to modelGather and pre-process data
Web Page Labeling
Computed Render Trees
Is Text?
Distance from Nearest Input
Nearest Color
Value of Attribute For
Train the ML classifier
SUPERVISED LEARNING APPROACH
WEB UI CLASSIFICATION
PAGE LABELING IN PRACTICE
28
WEB UI CLASSIFICATION
RESULTS OF WEB PAGE CLASSIFICATION
Page Classification
29
DECISION TREES
A TREE-LIKE MODEL OF DECISIONS AND THEIR POSSIBLE OUTCOMES
Decision Node
Chance Node
Outcome Node
NOTATION
DECISION TREES
A TREE-LIKE MODEL OF DECISIONS AND THEIR POSSIBLE OUTCOMES
Go to
Work
Go
Fishing
75%
25%
64%
36%
Keep Job
Lose Job
Catch Fish
Fail to Catch Fish
30
DECISION TREES
KEY ADVANTAGES
EASY
Simple to Understand
Minimal Data Preparation
Explainable Results
VALUABLE
Picking Best Option Quantitatively
Useful Without Hard Data
Handles Categorical/Numerical Data
EXTENSIBLE
Allows for New Scenarios
Models Problems with Multiple Outputs
Combines with Other Decision Tools
1
2 3
DECISION TREES: AI FOR TESTING
TRAINING ELEMENT CLASSIFIERS
31
DECISION TREES
SAMPLE DECISION TREE FOR CLASSIFYING WEB ELEMENTS
Gini = 0.00
Samples = 7285
Value = [11534, 0]
Class = None
Is Text?
Gini = 0.01
Samples = 10943
Value = [17273, 86]
Class = None Gini = 0.00
Samples = 2332
Value = [3701, 0]
Class = None
Nearest Color <= 2.5?
Gini = 0.029
Samples = 3658
Value = [5739, 86]
Class = None
Input Distance <= 0.035
Gini = 0.07
Samples = 1326
Value = [2038, 86]
Class = None
Attr For <= 0.5
Gini = 0.499
Samples = 68
Value = [56, 61]
Class = LabelCandidate
Gini = 0.0
Samples = 191
Value = [328, 0]
Class = None
Nearest Color <= 1.5
Gini = 0.237
Samples = 259
Value = [384, 61]
Class = None
Font Weight <= 0.125
Gini = 0.086
Samples = 361
Value = [533, 25]
Class = None
Gini = 0.0
Samples = 706
Value = [1121, 0]
Class = None
Input Distance <= 0.191
Gini = 0.029
Samples = 1067
Value = [1654, 25]
Class = None
DECISION TREES
KEY DRAWBACKS
INSTABILITY
Small Changes in Data
Cause Great Change in Structure
No Efficient Way to Find Optimal
OVERFITTING
Tree Becomes Very Large
Model Too Specific to Training Set
Memorizing vs. Generalizing
LIMITED ACCURACY
Discretization of Continuous Attributes
Less Accurate for Regression
“Noisy” Data Causes Inaccuracies
32
RANDOM FORESTS
CONTROLLING OVERFITTING IN DECISION TREE LEARNING
MODELING THE APPLICATION
VECTOR AND GRAPH REPRESENTATIONS
33
MODELING THE APPLICATION
+
PLAYING DOMINOES WITH GRAPH PIECES
GENERATING TEST ACTIONS
SELECTING A FINITE NUMBER OF USER INPUTS FROM AN INFINITELY LARGE DOMAIN
INPUT SPACE
EXPLOSION
150 actions per page
35 steps
150 =
35
paths10
78
PROBABILISTIC
MODELING
Some elements
and actions are
more interesting
than others.
~20%
~5%
# atoms in
the universe
34
GENERATING TEST ACTIONS
HOW BOTS LEARN TO TAP, TYPE, AND SWIPE
PERCEIVE
What can we interact with?
ACT
ML determines action
LEARN
Feedback trains brain
UI Elements
Wrong
Rewrite
Correct
Reinforce
Artificial Neural Network
Input Hidden Output
REINFORCEMENT LEARNING
AGENTS LEARN OPTIMAL INTERACTIONS WITH DYNAMIC ENVIRONMENT BY TRIAL AND ERROR
In each experience, the agent takes an action a in state
s, receives a reward r, and moves to state s’.
35
REINFORCEMENT LEARNING
In each experience, the agent takes an action a in state
s, receives a reward r, and moves to state s’.
ACTION REWARD TRANSITION NEXT ACTIONPUNISHOR
AGENTS LEARN OPTIMAL INTERACTIONS WITH DYNAMIC ENVIRONMENT BY TRIAL AND ERROR
REINFORCEMENT LEARNING
THREE PARTS OF A REINFORCEMENT LEARNING PROBLEM
ENVIRONMENT
At least partially observable
by means of sensors
REWARD FUNCTION
Maps state-action pairs
to reward value
Defines how to choose a
“good” action in each state
VALUE FUNCTION
36
Q-LEARNING
TRACKING LONG-TERM REWARDS, NOT JUST IMMEDIATE ONES
OLD VALUE LEARNING
RATE
REWARD DISCOUNT
FACTOR ESTIMATE OF OPTIMAL
FUTURE REWARD
LEARNED VALUE
Maps an action in a particular state to
its expected long-term reward.
Q-LEARNING
EXAMPLE WALKTHROUGH
2
10
4
3
5
5
Select Choice: (2, 3)
0 1 2 3 4 5
0 0 0 0 0 0 0
1 0 0 0 0 0 0
2 0 0 0 0 0 0
3 0 0 0 0 0 0
4 0 0 0 0 0 0
5 0 0 0 0 0 0
Q-MATRIX
REWARDS
0 to 4, 4 to 0  0 1 to 5  100
3 to 4, 4 to 3  0 4 to 5  100
2 to 3, 3 to 2  0 5 to 5  100
3 to 1, 1 to 3  0
37
Q-LEARNING
EXAMPLE WALKTHROUGH
0 1 2 3 4 5
0 0 0 0 0 0 0
1 0 0 0 0 0 0
2 0 0 0 0 0 0
3 0 0 0 0 0 0
4 0 0 0 0 0 0
5 0 0 0 0 0 0
Q-MATRIX
REWARDS
0 to 4, 4 to 0  0 1 to 5  100
3 to 4, 4 to 3  0 4 to 5  100
2 to 3, 3 to 2  0 5 to 5  100
3 to 1, 1 to 3  0
2
10
4
3
5
5
2, 3 ← 0.0 0.8 · max 3, 1 , 3, 42, 3 ← 0.0 0.8 · max 3, 1 , 3, 4
2, 3 ← 0.0 0.8 · max 0 , 0 02, 3 ← 0.0 0.8 · max 0 , 0 0
Q-LEARNING
EXAMPLE WALKTHROUGH
0 1 2 3 4 5
0 0 0 0 0 0 0
1 0 0 0 0 0 0
2 0 0 0 0 0 0
3 0 0 0 0 0 0
4 0 0 0 0 0 0
5 0 0 0 0 0 0
Q-MATRIX
REWARDS
0 to 4, 4 to 0  0 1 to 5  100
3 to 4, 4 to 3  0 4 to 5  100
2 to 3, 3 to 2  0 5 to 5  100
3 to 1, 1 to 3  0
2
10
4
3
5
5
Select Choice: (3, 1)
38
Q-LEARNING
EXAMPLE WALKTHROUGH
0 1 2 3 4 5
0 0 0 0 0 0 0
1 0 0 0 0 0 0
2 0 0 0 0 0 0
3 0 0 0 0 0 0
4 0 0 0 0 0 0
5 0 0 0 0 0 0
Q-MATRIX
REWARDS
0 to 4, 4 to 0  0 1 to 5  100
3 to 4, 4 to 3  0 4 to 5  100
2 to 3, 3 to 2  0 5 to 5  100
3 to 1, 1 to 3  0
2
10
4
3
5
5
3, 1 ← 0.0 0.8 · max 1, 5 , 1, 33, 1 ← 0.0 0.8 · max 1, 5 , 1, 3
3, 1 ← 0.0 0.8 · max 0 , 0 03, 1 ← 0.0 0.8 · max 0 , 0 0
Q-LEARNING
EXAMPLE WALKTHROUGH
0 1 2 3 4 5
0 0 0 0 0 0 0
1 0 0 0 0 0 0
2 0 0 0 0 0 0
3 0 0 0 0 0 0
4 0 0 0 0 0 0
5 0 0 0 0 0 0
Q-MATRIX
REWARDS
0 to 4, 4 to 0  0 1 to 5  100
3 to 4, 4 to 3  0 4 to 5  100
2 to 3, 3 to 2  0 5 to 5  100
3 to 1, 1 to 3  0
2
10
4
3
5
5
Select Choice: (1, 5)
39
Q-LEARNING
EXAMPLE WALKTHROUGH
Q-MATRIX
REWARDS
0 to 4, 4 to 0  0 1 to 5  100
3 to 4, 4 to 3  0 4 to 5  100
2 to 3, 3 to 2  0 5 to 5  100
3 to 1, 1 to 3  0
2
10
4
3
5
5
0 1 2 3 4 5
0 0 0 0 0 0 0
1 0 0 0 0 0 0
2 0 0 0 0 0 0
3 0 0 0 0 0 0
4 0 0 0 0 0 0
5 0 0 0 0 0 0
1, 5 ← 100 0.8 · max 5, 5 , 5, 11, 5 ← 100 0.8 · max 5, 5 , 5, 1
1, 5 ← 100 0.8 · max 0 , 0 1001, 5 ← 100 0.8 · max 0 , 0 100
100
100
Q-LEARNING
EXAMPLE WALKTHROUGH
Q-MATRIX
REWARDS
0 to 4, 4 to 0  0 1 to 5  100
3 to 4, 4 to 3  0 4 to 5  100
2 to 3, 3 to 2  0 5 to 5  100
3 to 1, 1 to 3  0
2
10
4
3
5
5
Select Choice: (2, 3)
0 1 2 3 4 5
0 0 0 0 0 0 0
1 0 0 0 0 0 0
2 0 0 0 0 0 0
3 0 0 0 0 0 0
4 0 0 0 0 0 0
5 0 0 0 0 0 0
100
40
Q-LEARNING
EXAMPLE WALKTHROUGH
Q-MATRIX
REWARDS
0 to 4, 4 to 0  0 1 to 5  100
3 to 4, 4 to 3  0 4 to 5  100
2 to 3, 3 to 2  0 5 to 5  100
3 to 1, 1 to 3  0
2
10
4
3
5
5
2, 3 ← 0.0 0.8 · max 3, 1 , 3, 42, 3 ← 0.0 0.8 · max 3, 1 , 3, 4
2, 3 ← 0.0 0.8 · max 0 , 0 02, 3 ← 0.0 0.8 · max 0 , 0 0
0 1 2 3 4 5
0 0 0 0 0 0 0
1 0 0 0 0 0 100
2 0 0 0 0 0 0
3 0 0 0 0 0 0
4 0 0 0 0 0 0
5 0 0 0 0 0 0
Q-LEARNING
EXAMPLE WALKTHROUGH
Q-MATRIX
REWARDS
0 to 4, 4 to 0  0 1 to 5  100
3 to 4, 4 to 3  0 4 to 5  100
2 to 3, 3 to 2  0 5 to 5  100
3 to 1, 1 to 3  0
2
10
4
3
5
5
0 1 2 3 4 5
0 0 0 0 0 0 0
1 0 0 0 0 0 100
2 0 0 0 0 0 0
3 0 80 0 0 0 0
4 0 0 0 0 0 0
5 0 0 0 0 0 0
3, 1 ← 0.0 0.8 · max 1, 5 , 1, 33, 1 ← 0.0 0.8 · max 1, 5 , 1, 3
3, 1 ← 0.0 0.8 · max 100 , 0 803, 1 ← 0.0 0.8 · max 100 , 0 80
80
41
Q-LEARNING
EXAMPLE WALKTHROUGH
Q-MATRIX
REWARDS
0 to 4, 4 to 0  0 1 to 5  100
3 to 4, 4 to 3  0 4 to 5  100
2 to 3, 3 to 2  0 5 to 5  100
3 to 1, 1 to 3  0
2
10
4
3
5
5
Select Choice: (2, 3)
0 1 2 3 4 5
0 0 0 0 0 0 0
1 0 0 0 0 0 100
2 0 0 0 0 0 0
3 0 80 0 0 0 0
4 0 0 0 0 0 0
5 0 0 0 0 0 0
Q-LEARNING
EXAMPLE WALKTHROUGH
Q-MATRIX
REWARDS
0 to 4, 4 to 0  0 1 to 5  100
3 to 4, 4 to 3  0 4 to 5  100
2 to 3, 3 to 2  0 5 to 5  100
3 to 1, 1 to 3  0
2
10
4
3
5
5
2, 3 ← 0.0 0.8 · max 3, 1 , 3, 42, 3 ← 0.0 0.8 · max 3, 1 , 3, 4
2, 3 ← 0.0 0.8 · max 80 , 0 642, 3 ← 0.0 0.8 · max 80 , 0 64
0 1 2 3 4 5
0 0 0 0 0 0 0
1 0 0 0 0 0 100
2 0 0 0 64 0 0
3 0 80 0 0 0 0
4 0 0 0 0 0 0
5 0 0 0 0 0 0
64
42
Q-LEARNING
EXAMPLE WALKTHROUGH
Q-MATRIX
REWARDS
0 to 4, 4 to 0  0 1 to 5  100
3 to 4, 4 to 3  0 4 to 5  100
2 to 3, 3 to 2  0 5 to 5  100
3 to 1, 1 to 3  0
2
10
4
3
5
5
0 1 2 3 4 5
0 0 0 0 0 80 0
1 0 0 0 64 0 100
2 0 0 0 64 0 0
3 0 80 51 0 80 0
4 64 0 0 64 0 100
5 0 80 0 0 80 100
After many episodes…
Use Q-Values to select actions
Q-LEARNING: AI FOR TESTING
APPROACH
html
head body
title pdiv
font-size: 16px
Hello Worldimg
font-size : 16px
font-weight: bold
Compute Render Trees
AIT Test Case
Element/Screen Classifiers
Application Graph
Step Actions + Verifications
43
GENERATING TEST ACTIONS
HOW BOTS LEARN TO PERFORM TEST ATTACKS
PERCEIVE
What can we interact with?
ACT
ML determines action
LEARN
Feedback trains brain
Artificial Neural Network
Input Hidden Output
test@example.com’1 = 1 --
VALIDATING OUTPUT
HOW BOTS LEARN TO DETECT BUGS
PERCEIVE
What can we interact with?
ACT
ML determines action
LEARN
Feedback trains brain
Artificial Neural Network
Input Hidden Output
44
VALIDATING OUTPUT
HOW BOTS LEARN TO DETECT BUGS
Try again
Sorry for the Classification
BUG
45
LOOSELY INSPIRED BY BIOLOGY
ARTIFICIAL NEURAL NETWORKS
Human Brain
15 - 33 Billion Neurons Biological Neuron
Artificial Neuron
ARTIFICIAL NEURON
A perceptron is an algorithm for supervised learning of binary classifiers.
A SINGLE-LAYER PERCEPTRON
46
ARTIFICIAL NEURON
At its core, it is a function that maps inputs to outputs.
A SINGLE-LAYER PERCEPTRON
ARTIFICIAL NEURONA SIMPLE NEURAL NETWORK
“A feed-forward network with a single layer is sufficient
to represent any function…”
Ian Goodfellow
47
A SINGLE-LAYER PERCEPTRON: LOSS FUNCTION
ARTIFICIAL NEURON
Given examples,
find weights that map
inputs to outputs.
Initially, weights are
randomly initialized.
Value of predicted output
may be different from the
actual output .
A LOSS function is used to
measure this difference.
HOW DO ARTIFICIAL NEURAL NETWORKS LEARN?
FORWARD-PROPAGATION
TRAINING NEURAL NETWORKS
Hidden LayersInput Layer Output Layer
LOSS
 
  , ,
 
 
EVALUATION
48
BACK-PROPAGATION
TRAINING NEURAL NETWORKS
Hidden LayersInput Layer Output Layer
LOSS
∆
∆ Adjust weights
FORWARD-PROPAGATION AGAIN
TRAINING NEURAL NETWORKS
REDUCED
LOSS
∆
∆ Adjust weights
49
TENSORFLOW PLAYGROUND
NEURAL NETWORKS IN ACTION
https://playground.tensorflow.org
FEED-FORWARD
CONVOLUTIONAL
RECURRENT
LONG SHORT-TERM MEMORY
TYPES OF NEURAL NETWORKS
DEEP LEARNING
50
LEARNING FROM EXISTING TESTS
TEST GENERATION FROM ABSTRACT TEST FLOWS
ABSTRACT TEST
FLOW LANGUAGE
ABSTRACT TEST
FLOW LANGUAGE
LONG SHORT-TERM MEMORY RECURRENT NEURAL NETWORK
https://machinelearningmastery.com
JASON BROWNLEE
51
TEXT GENERATION WITH
LONG SHORT-TERM MEMORY
RECURRENT NEURAL NETWORKS
IN PYTHON WITH KERAS
https://machinelearningmastery.com/text-generation-lstm-recurrent-neural-networks-python-keras/
52
Freely downloadable and usable for
machine learning experiments.
www.gutenberg.org
~150,000 Characters
Total in the book
47 Distinct Characters
When converted to lowercase
100-Length Subsequence Training
N-Length Subsequence → Character Output
CHAPT → E
HAPTE → R
Example (N=5)
53
be no mistake about it: it was
neither more nor less than a pig,
and she felt that it would be quit
e aelin that she was a little want oe
toiet ano a grtpersent to the tas a
little war th tee the tase oa teettee the
had been tinhgtt a little toiee at the
cadl in a long tuiee aedun thet sheer
was a little tare gereen to be a gentle
of the tabdit soenee the gad ouw ie
the tay a tirt of toiet at the was a
little anonersen, and thiu had been
woite io a lott of tueh a tiie and
taede bot her aeain she cere thth the
bene tith the tere bane to tee toaete to
tee the harter was a little tire the
same oare cade an anl ano the garee
and the was so seat the was a little
gareen and the sabdit, and the
white rabbit wese tilel an the caoe
and the sabbit se teeteer, and the
white rabbit wese tilel an the cade in
a lonk tfne the sabdi ano aroing to
tea the was sf teet whitg the was a
little tane oo thete the sabeit she
was a little tartig to the tar tf tee
the tame of the cagd, and the white
rabbit was a little toiee to be anle
tite thete ofs and the tabdit was the
wiite rabbit, and
256 Memory Units, 1 Hidden Layer
gooder head. and said to herself, ‘it
was a little little shated of the
mouse of the good of the courte, and
it was a little little shated in a little
that the was a little little shated of
the thmee said to see it was a little
book of the was a little that she was
so sereated to hare a little the began
sitee of the was of the was a little
that she was so seally and the
sabbit was a little lad good to the
little gooder head of the gad seared
to see it was a little lad good to the
little good
256 Memory Units, 2 Hidden Layers
herself lying on the bank, with her
head in the lap of her sister, who was
gently brushing away so siee, and
she sabbit said to herself and the
sabbit said to herself and the sood
way of the was a little that she was
a little lad good to the garden, and
the sood of the mock turtle said to
herself, 'it was a little that the mock
turtle said to see it said to sea it
said to sea it say it the marge hard
sat hn a little that she was so
sereated to herself, and she sabbit
said to herself, 'it was a little little
shated of the sooe of the coomouse it
was a little lad good to the little
54
LEARNING FROM EXISTING TESTS
test.ai
Observe ErrorMessage
IF
Perceived Conditions
Input BLANK FirstName Invoke SubmitObserve Required TextBox FirstName
First Name* Last Name*
Company
ABSTRACT TEST FLOW LANGUAGE
A Model-Based AI-Driven Test Generation System, Dionny Santiago.
Masters Thesis Proposal, Florida International University (2018).
LEARNING FROM EXISTING TESTS
test.ai
Observe ErrorMessage
IF
Perceived Conditions
WHEN
Input Actions
Input BLANK FirstName Invoke SubmitObserve Required TextBox FirstName
First Name* Last Name*
Company
ABSTRACT TEST FLOW LANGUAGE
A Model-Based AI-Driven Test Generation System, Dionny Santiago.
Masters Thesis Proposal, Florida International University (2018).
55
LEARNING FROM EXISTING TESTS
Observe ErrorMessage
IF
Perceived Conditions
WHEN
Input Actions
THEN
Required Observations
Input BLANK FirstName Invoke SubmitObserve Required TextBox FirstName
First Name* Last Name*
Company
Please enter first name. Please enter last name.
ABSTRACT TEST FLOW LANGUAGE
A Model-Based AI-Driven Test Generation System, Dionny Santiago.
Masters Thesis Proposal, Florida International University (2018).
LEARNING FROM EXISTING TESTS
GRAMMAR FOR ABSTRACT TEST FLOW LANGUAGE
<flow> ::= <observation-list> <component-action-list> <observation-list>
<observation-list> ::= <observation> ‘ ’ <observation-list> | <observation>
<observation> ::= ‘Observe’ <qualifier-list> <component> | ‘NotObserve’ <qualifier-list> <component>
<qualifier-list> ::= <qualifier> ‘ ’ <qualifier-list> | <qualifier> | ‘’
<qualifier> ::= ‘Required’ | <learned-qualifier>
<component> ::= <element-class> <ident> | <ident>
<component-action-list> ::= <component-action> ‘ ’ <component-action-list> | <component-action>
<component-action> ::= ‘Input’ <equivalence-class> <component> | ‘Invoke’ <element-class>
<equivalence-class> ::= “VALID’ | ‘BLANK’ | ‘WHITESPACE’ | <learned-eq-class>
<element-class> ::= ‘Textbox’ | ‘Dropdown’ | ‘ErrorMessage’ | ‘Submit’ | ‘Cancel’ | <learned-el-class>
<learned-qualifier> ::= <ident>
<learned-eq-class> ::= <ident>
<learned-el-class> ::= <ident>
A Model-Based AI-Driven Test Generation System, Dionny Santiago, Masters Thesis Proposal, Florida International University (2018).
56
LEARNING FROM EXISTING TESTS
PREPARING TRAINING DATA
Input Sentence Predicted Next Word
Perceive Required
Perceive Required Textbox
Perceive Required Textbox FirstName
Perceive Required Textbox FirstName Input
Perceive Required Textbox FirstName Input VALID
Perceive Required TextBox FirstName Input VALID FirstName Invoke
Perceive Required TextBox FirstName Input VALID FirstName Invoke Submit
Perceive Required TextBox FirstName Input VALID FirstName Invoke Submit NotObserve
Perceive Required Textbox FirstName Input VALID FirstName Invoke Submit NotObserve ErrorMessage
A Model-Based AI-Driven Test Generation System, Dionny Santiago.
Masters Thesis Proposal, Florida International University (2018).
LEARNING FROM EXISTING TESTS
TEST GENERATION FROM ABSTRACT TEST FLOWS
57
LEARNING FROM EXISTING TESTS
SAMPLE RESULTS FROM TEST FLOW SENTENCE TRAINING
Loss
2.9
0.5
A Model-Based AI-Driven Test Generation System, Dionny Santiago.
Masters Thesis Proposal, Florida International University (2018).
LEARNING FROM EXISTING TESTS
SAMPLE RESULTS FROM TEST FLOW SENTENCE TRAINING
Executed Query: Perceive Required TextBox FirstName
ML leverages
the trained
model to fill in
next steps.
At first it sucks!
Loss
2.9
0.5
But then it
gets better.
58
LEARNING FROM EXISTING TESTS
SAMPLE RESULTS FROM TEST FLOW SENTENCE TRAINING
Most importantly it generalizes…
This fragment did not appear in training set.
NEURAL NETS IN PRACTICE
PROGRAMMING FRAMEWORKS
59
TENSORFLOW TRAINING
JUPYTER NOTEBOOKS
EXECUTING TEST FLOWS
TRACKING AS BOTS STEP THROUGH THE APPLICATION
60
EXECUTING TEST FLOWS
TRACKING AS BOTS STEP THROUGH THE APPLICATION
BENEFITS OF AI-DRIVEN TESTING
PESTICIDE FREE
Generates New Tests Each Time
Eliminates Pesticide Paradox
GENERAL PURPOSE
Different Testing Types
Any Application or Domain
LARGE SCALE
Deep Learning
Cloud Infrastructure
61
BAYES’ THEOREM: INTRODUCTION
BAYESIAN NETWORKS
Conditional probability is the probability of an event
happening, given that it has some relationship to
one or more other events.
FINDING AN OPEN PARKING SPACE ?
BAYESIAN NETWORKS
BAYES’ THEOREM: INTRODUCTION
62
Conditional probability is the probability of an event
happening, given that it has some relationship to
one or more other events.
BAYESIAN NETWORKS
BAYES’ THEOREM: INTRODUCTION
TIME OF DAYLOCATION EVENTS
BAYES’ THEOREM
BAYESIAN NETWORKS
: GRAPHICAL MODELING
SMOKERSMOKER
LUNG
DISEASE
LUNG
DISEASE
SHORTNESS
OF BREATH
SHORTNESS
OF BREATH
CHEST
PAIN
CHEST
PAIN COUGHCOUGH FEVERFEVER
COLDCOLD
63
CONCURRENT SESSION
BAYESIAN NETWORKS
: FIGHTING TEST FLAKINESS
OUTLINE
 FUTURE TRENDS IN AI-DRIVEN TESTING
64
FUTURE TRENDS
ENHANCE
PORTIONS OF EXISTING
TESTING TOOLS
REPLACE
ENTIRE TOOL STACKS
BUT NEED HUMAN INPUT
TAKE OVER
HUMAN ACTIVITY AFTER
LEARNING OVER TIME
65
FUTURE TRENDS
SELF-TESTING
AI-DRIVEN TESTING FROM THE INSIDE-OUT
66
Self-
Configure
Self-
Optimize
Self-
Heal
Self-
Protect
Self-
Test
AUTONOMIC SELF-TESTING
Software Component
Monitor
Analyze Plan
Execute
Knowledge
(Brain)
Autonomic Test Manager
A Self-Testing Approach for Autonomic Software, Tariq M. King.
ProQuest Electronic Theses and Dissertations (2009).
67
The AI for testing problem, and testing in
general, is too important and large of a problem
for any one company or effort to solve, and
hence we formed an association around it.
www.aitesting.org

More Related Content

What's hot

소프트웨어 테스팅
소프트웨어 테스팅소프트웨어 테스팅
소프트웨어 테스팅
영기 김
 
Overview on TDD (Test Driven Development) & ATDD (Acceptance Test Driven Deve...
Overview on TDD (Test Driven Development) & ATDD (Acceptance Test Driven Deve...Overview on TDD (Test Driven Development) & ATDD (Acceptance Test Driven Deve...
Overview on TDD (Test Driven Development) & ATDD (Acceptance Test Driven Deve...
Zohirul Alam Tiemoon
 

What's hot (20)

AI Testing What Why and How To Do It?
AI Testing What Why and How To Do It?AI Testing What Why and How To Do It?
AI Testing What Why and How To Do It?
 
RESTful API Testing using Postman, Newman, and Jenkins
RESTful API Testing using Postman, Newman, and JenkinsRESTful API Testing using Postman, Newman, and Jenkins
RESTful API Testing using Postman, Newman, and Jenkins
 
認試軟體測試的世界 & TDD/BDD 入門
認試軟體測試的世界 & TDD/BDD 入門認試軟體測試的世界 & TDD/BDD 入門
認試軟體測試的世界 & TDD/BDD 入門
 
Appium Presentation
Appium Presentation Appium Presentation
Appium Presentation
 
Introduction to APIs & how to automate APIs testing with selenium web driver?
Introduction to APIs & how to automate APIs testing with selenium web driver?Introduction to APIs & how to automate APIs testing with selenium web driver?
Introduction to APIs & how to automate APIs testing with selenium web driver?
 
AWS_Meetup_BLR_July_22_Social.pdf
AWS_Meetup_BLR_July_22_Social.pdfAWS_Meetup_BLR_July_22_Social.pdf
AWS_Meetup_BLR_July_22_Social.pdf
 
API TESTING
API TESTINGAPI TESTING
API TESTING
 
Mobile Test Automation - Appium
Mobile Test Automation - AppiumMobile Test Automation - Appium
Mobile Test Automation - Appium
 
모바일 게임 테스트 자동화 (Appium 확장)
모바일 게임 테스트 자동화 (Appium 확장)모바일 게임 테스트 자동화 (Appium 확장)
모바일 게임 테스트 자동화 (Appium 확장)
 
API Testing: The heart of functional testing" with Bj Rollison
API Testing: The heart of functional testing" with Bj RollisonAPI Testing: The heart of functional testing" with Bj Rollison
API Testing: The heart of functional testing" with Bj Rollison
 
Chaos engineering
Chaos engineering Chaos engineering
Chaos engineering
 
Monitoring and alerting as code with Terraform and New Relic
Monitoring and alerting as code with Terraform and New RelicMonitoring and alerting as code with Terraform and New Relic
Monitoring and alerting as code with Terraform and New Relic
 
자동화된 Test Case의 효과
자동화된 Test Case의 효과자동화된 Test Case의 효과
자동화된 Test Case의 효과
 
Ai in software automation testing - testim.io
Ai in software automation testing - testim.ioAi in software automation testing - testim.io
Ai in software automation testing - testim.io
 
Api Testing
Api TestingApi Testing
Api Testing
 
Postman
PostmanPostman
Postman
 
Belajar Postman test runner
Belajar Postman test runnerBelajar Postman test runner
Belajar Postman test runner
 
소프트웨어 테스팅
소프트웨어 테스팅소프트웨어 테스팅
소프트웨어 테스팅
 
An Introduction to Chaos Engineering
An Introduction to Chaos EngineeringAn Introduction to Chaos Engineering
An Introduction to Chaos Engineering
 
Overview on TDD (Test Driven Development) & ATDD (Acceptance Test Driven Deve...
Overview on TDD (Test Driven Development) & ATDD (Acceptance Test Driven Deve...Overview on TDD (Test Driven Development) & ATDD (Acceptance Test Driven Deve...
Overview on TDD (Test Driven Development) & ATDD (Acceptance Test Driven Deve...
 

Similar to AI and ML Skills for the Testing World Tutorial

Meetup 29042015
Meetup 29042015Meetup 29042015
Meetup 29042015
lbishal
 
Internship - Python - AI ML.pptx
Internship - Python - AI ML.pptxInternship - Python - AI ML.pptx
Internship - Python - AI ML.pptx
Hchethankumar
 
Internship - Python - AI ML.pptx
Internship - Python - AI ML.pptxInternship - Python - AI ML.pptx
Internship - Python - AI ML.pptx
Hchethankumar
 

Similar to AI and ML Skills for the Testing World Tutorial (20)

Machine learning for sensor Data Analytics
Machine learning for sensor Data AnalyticsMachine learning for sensor Data Analytics
Machine learning for sensor Data Analytics
 
Machine Learning Interview Questions
Machine Learning Interview QuestionsMachine Learning Interview Questions
Machine Learning Interview Questions
 
Machine_Learning_with_MATLAB_Seminar_Latest.pdf
Machine_Learning_with_MATLAB_Seminar_Latest.pdfMachine_Learning_with_MATLAB_Seminar_Latest.pdf
Machine_Learning_with_MATLAB_Seminar_Latest.pdf
 
B4UConference_machine learning_deeplearning
B4UConference_machine learning_deeplearningB4UConference_machine learning_deeplearning
B4UConference_machine learning_deeplearning
 
Meetup 29042015
Meetup 29042015Meetup 29042015
Meetup 29042015
 
Machine Learning Ch 1.ppt
Machine Learning Ch 1.pptMachine Learning Ch 1.ppt
Machine Learning Ch 1.ppt
 
Machine Learning an Research Overview
Machine Learning an Research OverviewMachine Learning an Research Overview
Machine Learning an Research Overview
 
Artificial Intelligence with Python | Edureka
Artificial Intelligence with Python | EdurekaArtificial Intelligence with Python | Edureka
Artificial Intelligence with Python | Edureka
 
Intro to ai application emeritus uob-final
Intro to ai application emeritus uob-finalIntro to ai application emeritus uob-final
Intro to ai application emeritus uob-final
 
Machine learning
 Machine learning Machine learning
Machine learning
 
Debugging AI
Debugging AIDebugging AI
Debugging AI
 
How to use Artificial Intelligence with Python? Edureka
How to use Artificial Intelligence with Python? EdurekaHow to use Artificial Intelligence with Python? Edureka
How to use Artificial Intelligence with Python? Edureka
 
Internship - Python - AI ML.pptx
Internship - Python - AI ML.pptxInternship - Python - AI ML.pptx
Internship - Python - AI ML.pptx
 
Internship - Python - AI ML.pptx
Internship - Python - AI ML.pptxInternship - Python - AI ML.pptx
Internship - Python - AI ML.pptx
 
2020 04 10 Catch IT - Getting started with ML.Net
2020 04 10 Catch IT - Getting started with ML.Net2020 04 10 Catch IT - Getting started with ML.Net
2020 04 10 Catch IT - Getting started with ML.Net
 
Barga Data Science lecture 9
Barga Data Science lecture 9Barga Data Science lecture 9
Barga Data Science lecture 9
 
Reinforcement Learning, Application and Q-Learning
Reinforcement Learning, Application and Q-LearningReinforcement Learning, Application and Q-Learning
Reinforcement Learning, Application and Q-Learning
 
1 machine learning demystified
1 machine learning demystified1 machine learning demystified
1 machine learning demystified
 
Machine Learning AND Deep Learning for OpenPOWER
Machine Learning AND Deep Learning for OpenPOWERMachine Learning AND Deep Learning for OpenPOWER
Machine Learning AND Deep Learning for OpenPOWER
 
Using the Machine to predict Testability
Using the Machine to predict TestabilityUsing the Machine to predict Testability
Using the Machine to predict Testability
 

Recently uploaded

%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
masabamasaba
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
masabamasaba
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
masabamasaba
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
VictoriaMetrics
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
masabamasaba
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 

Recently uploaded (20)

%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptx
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
tonesoftg
tonesoftgtonesoftg
tonesoftg
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 

AI and ML Skills for the Testing World Tutorial

  • 1. 1 JASON ARBON FOUNDER AND CEO TARIQ KING SR. DIRECTOR, QUALITY ENGINEERING
  • 2. 2 A Self-Testing Approach for Autonomic Software Tariq M. King Major Advisor: Dr. Peter J. Clarke JASON ARBON FOUNDER AND CEO TARIQ KING SR. DIRECTOR, QUALITY ENGINEERING Joanne Tseng Data Scientist @test.ai Gregg Tabot Machine Learning Engineer @test.ai Dionny Santiago Principal Quality Architect @ultimatesoftware David Adamo Jr. Quality Engineer @ultimatesoftware ARCHITECTS, ENGINEERS AND SCIENTISTS THE REAL
  • 3. 3
  • 4. 4 Artificial Intelligence for Software Testing (AIST) is an emerging field aimed at the development of AI systems to test software, methods to test AI systems, and ultimately designing software that is capable of self-testing and self-healing.
  • 5. 5 AI TESTING TESTING AI SELF-TESTING TOOLS METHODS DESIGNS THIS TUTORIAL On completion, participants will be able to: o Explai nfu nda ment al ter ms and concep ts used in the field of AI and ML. o D escrib e vari ou s ML ap p roaches su ch as D ecisi on Tree L earni ng, Rei nf orce ment Learning, Neural and Bayesian networks. o Discuss the AI-driven testing techniques used in practice to validate mobile and web applications. o Identify tools and frameworks to aid the development of AI-driven software testing systems. LEARNING OBJECTIVES AI-DRIVEN TESTING TOOLS
  • 6. 6 OUTLINE  INTRODUCTION TO AI AND ML o Autonomous and Intelligent Agents o Machine Learning Approaches o Classification: Training, Validation, Evaluation  AI-DRIVEN SOFTWARE TESTING o Perceiving the Environment with Decision Trees o Generating Inputs with Neural Nets and Reinforcement Learning o Classifying Test Failures and Flakiness with Bayesian Nets  FUTURE TRENDS IN AI-DRIVEN TESTING INTELLIGENCEINTELLIGENCEQuickness of understanding, high mental capacity, sound judgment and reason.
  • 9. 9 artificial intelligence: : a branch of computer science dealing with the simulation of intelligent behavior in computers : the capability of a machine to imitate intelligent human behavior 1 2
  • 10. 10 Perceive and act in its environment using sensors and actuators, respectively. Direct its activity toward goals and use knowledge and learning in achieving those goals. Analyze itself in terms of behavior, error, and success and adapt online, possibly in real time. Be organized with other agents, typically in a hierarchy to tackle problems at different abstraction levels. Typically referred to as bots or AI’s. AN AUTONOMOUS ENTITY THAT CAN… INTELLIGENT AGENT
  • 11. 11 TYPES OF INTELLIGENT AGENTS SIMPLE REFLEX AGENTS MODEL-BASED AGENTS GOAL-BASED AGENTS UTILITY-BASED AGENTS LEARNING AGENTS To acquire knowledge of, or skill in, by study, instruction or experience.
  • 12. 12 MORE THAN MEMORIZING MORE THAN MEMORIZING RECOGNIZING STRUCTURE RECOGNIZING STRUCTURE GENERALIZING EXAMPLES AND THEN MAGIC HAPPENS… APPLYING TO NEW CONTEXT FOLLOWS INSTRUCTIONS FOLLOWS INSTRUCTIONS LEARNS FROM EXPERIENCE LEARNS FROM EXPERIENCE
  • 13. 13 machine learning: the science of getting computers to act without being explicitly programmed
  • 14. 14 If a program can improve how it performs a certain task based on previous experience then you can say the program has learnt. If a program can improve how it performs a certain task based on previous experience then you can say the program has learnt. If th ep erfo rm anc eP of a comp ut er p rog ram at compl et ing a t ask T imp roves w ith exp erienc eE, the program is said to learn from experience E.
  • 15. 15 RAINDROPS NOT RAINDROPS EXPERIENCE? THE ANSWER IS IN THE DATA CLASSIFICATION EXPERIENCE? THE ANSWER IS IN THE DATA CATEGORY X CATEGORY Y CLUSTERING
  • 16. 16 SUPERVISED MACHINE LEARNING CATEGORIES UNSUPERVISED REINFORCEMENT Well-Labeled Data Knowledge of Data/Outcome Learning Based on Known Patterns Unlabeled Data No Knowledge of Data/Outcome Discovering Unknown Patterns Generating Data through Actions Reward/Punish Based on Outcome Learning By Trial-and-Error MACHINE LEARNING CATEGORIES Desired Output { 1,…, } Desired Output { 1,…, } Model { 1,…, } Model { 1,…, } World (or Data)World (or Data) SUPERVISED Model { 1,…, } Model { 1,…, } World (or Data)World (or Data) UNSUPERVISED Model OutputModel Output Model { 1,…, } Model { 1,…, } World (or Data)World (or Data) ReinforcementReinforcement REINFORCEMENT
  • 17. 17 MACHINE LEARNING CATEGORIES SUPERVISED UNSUPERVISED CLUSTERINGREGRESSIONCLASSIFICATION BAYESIAN (BELIEF) NETWORKS DECISION TREES OUTLOOK SUNNY OVERCAST RAIN HUMIDITY WIND HIGH NORMAL YES NO YES NOYES NEURAL NETWORKS K-MEANS CLUSTERING REINFORCEMENT LEARNING MACHINE LEARNING APPROACHES
  • 18. 18 GETTING STARTED WITH AI & ML HALITE II: MAY THE BEST BOT WIN https://halite.io GETTING STARTED WITH AI & ML HALITE II: MAY THE BEST BOT WIN https://halite.io Starter Bot 1: Simple Reflex Agent
  • 19. 19 GETTING STARTED WITH AI & ML HALITE II: MAY THE BEST BOT WIN Starter Bot 2: Learning Agent
  • 20. 20 Labeled Data Training Set Testing Set Features Outlook Temp Humidity Windy Play Tennis 1 Rainy Hot High False No 2 Rainy Hot High True No 3 Overcast Hot High False Yes 4 Sunny Mild High False Yes 5 Sunny Cool Normal True Yes 6 Sunny Cool Normal True Yes 7 Overcast Cool Normal True Yes 8 Rainy Mild High False No Class 9 Rainy Hot High False ? 10 Rainy Hot High True ? 11 Overcast Hot High False ? 12 Sunny Mild High False ? CLASSIFICATION SUPERVISED LEARNING: TRAINING AND VALIDATION Data Training Set Testing Set ML Algorithm Model Builds + + - + - + + + - + - + Predictions Predicted Class Yes No Actual Class Yes 4 1 No 0 10 Confusion Matrix Evaluation CLASSIFICATION SUPERVISED LEARNING: TRAINING AND VALIDATION
  • 21. 21 + + - + - + + + - + - + Predictions Predicted Class Yes No Actual Class Yes 4 1 No 0 10 Confusion Matrix Evaluation Accuracy = Number of Correct Predictions Total Number of Predictions = 14 ÷ 15 = ~93.3% Error = Number of Wrong Predictions Total Number of Predictions = 1 ÷ 15 = ~6.7% CLASSIFICATION PERFORMANCE MEASURES: ACCURACY AND ERROR + + - + - + + + - + - + Predictions Evaluation CLASSIFICATION PERFORMANCE MEASURES: PRECISION AND RECALL Predicted Class Yes No Actual Class Yes No Confusion Matrix TRUE POSITIVES TRUE NEGATIVES FALSE NEGATIVES FALSE POSITIVES The confusion matrix produced by classifiers shows four entities: o True Positives, False Positives, True Negatives, False Negatives Precision = Recall = What percentage of positive identifications were correct? What percentage of actual positives were identified?
  • 22. 22 + + - + - + + + - + - + Predictions Evaluation CLASSIFICATION PERFORMANCE MEASURES: PRECISION AND RECALL Precision = Recall = Predicted Class Yes No Actual Class Yes No Confusion Matrix TRUE POSITIVES TRUE NEGATIVES FALSE NEGATIVES FALSE POSITIVES The confusion matrix produced by classifiers shows four entities: o True Positives, False Positives, True Negatives, False Negatives True Positives True Positives + False Positives True Positives True Positives + False Negatives F1 Score = Harmonic mean of precision and recall which reaches its best at 1, worst at 0. Evaluation CLASSIFICATION PERFORMANCE MEASURES: PRECISION AND RECALL Precision = Recall = Confusion Matrix TRUE POSITIVES TRUE NEGATIVES FALSE NEGATIVES FALSE POSITIVES The confusion matrix produced by classifiers shows four entities: o True Positives, False Positives, True Negatives, False Negatives True Positives True Positives + False Positives True Positives True Positives + False Negatives F1 Score = Precision ∙ Recall Precision + Recall 2 ∙
  • 24. 24 OUTLINE  AI-DRIVEN SOFTWARE TESTING o Perceiving the Environment with Decision Trees o Generating Inputs with Neural Nets and Reinforcement Learning o Classifying Test Failures and Flakiness with Bayesian Nets TESTING BOTS AI-DRIVEN TESTING FROM THE OUTSIDE-IN
  • 25. 25 AI-DRIVEN TESTING IN PRACTICE AI-DRIVEN TESTING IN PRACTICE + MACHINE LEARNING TEST DRIVERS CLOUD COMPUTING + Artificial Neural Networks Decision Tree Learning Reinforcement Learning Bayesian Networks Selenium, Sikuli, Robot Appium, Calabash, Robotium JUnit, Nunit, xUnit Custom-Built Test Execution Environment Provisioning Data Generation Analysis/Reporting
  • 26. 26 TEST BOT TRAINING HOW BOTS LEARN TO PERCEIVE THE APPLICATION html head body title pdiv font-size: 16px Hello Worldimg font-size : 16px font-weight: bold Compute Render Trees PERCEIVE What can we interact with? Train Image Recognition LOGINLOGIN WEB UI CLASSIFICATION Suppose you wanted to use ML to identify various elements of a user interface. EXAMPLE: PERCEIVING WEB PAGES, CONTROLS, ERROR MESSAGES
  • 27. 27 WEB UI CLASSIFICATION MODEL TRAININGFEATURE ENGINEERINGDATA PREPARATION Decision Trees Random Forests Determine attributes to modelGather and pre-process data Web Page Labeling Computed Render Trees Is Text? Distance from Nearest Input Nearest Color Value of Attribute For Train the ML classifier SUPERVISED LEARNING APPROACH WEB UI CLASSIFICATION PAGE LABELING IN PRACTICE
  • 28. 28 WEB UI CLASSIFICATION RESULTS OF WEB PAGE CLASSIFICATION Page Classification
  • 29. 29 DECISION TREES A TREE-LIKE MODEL OF DECISIONS AND THEIR POSSIBLE OUTCOMES Decision Node Chance Node Outcome Node NOTATION DECISION TREES A TREE-LIKE MODEL OF DECISIONS AND THEIR POSSIBLE OUTCOMES Go to Work Go Fishing 75% 25% 64% 36% Keep Job Lose Job Catch Fish Fail to Catch Fish
  • 30. 30 DECISION TREES KEY ADVANTAGES EASY Simple to Understand Minimal Data Preparation Explainable Results VALUABLE Picking Best Option Quantitatively Useful Without Hard Data Handles Categorical/Numerical Data EXTENSIBLE Allows for New Scenarios Models Problems with Multiple Outputs Combines with Other Decision Tools 1 2 3 DECISION TREES: AI FOR TESTING TRAINING ELEMENT CLASSIFIERS
  • 31. 31 DECISION TREES SAMPLE DECISION TREE FOR CLASSIFYING WEB ELEMENTS Gini = 0.00 Samples = 7285 Value = [11534, 0] Class = None Is Text? Gini = 0.01 Samples = 10943 Value = [17273, 86] Class = None Gini = 0.00 Samples = 2332 Value = [3701, 0] Class = None Nearest Color <= 2.5? Gini = 0.029 Samples = 3658 Value = [5739, 86] Class = None Input Distance <= 0.035 Gini = 0.07 Samples = 1326 Value = [2038, 86] Class = None Attr For <= 0.5 Gini = 0.499 Samples = 68 Value = [56, 61] Class = LabelCandidate Gini = 0.0 Samples = 191 Value = [328, 0] Class = None Nearest Color <= 1.5 Gini = 0.237 Samples = 259 Value = [384, 61] Class = None Font Weight <= 0.125 Gini = 0.086 Samples = 361 Value = [533, 25] Class = None Gini = 0.0 Samples = 706 Value = [1121, 0] Class = None Input Distance <= 0.191 Gini = 0.029 Samples = 1067 Value = [1654, 25] Class = None DECISION TREES KEY DRAWBACKS INSTABILITY Small Changes in Data Cause Great Change in Structure No Efficient Way to Find Optimal OVERFITTING Tree Becomes Very Large Model Too Specific to Training Set Memorizing vs. Generalizing LIMITED ACCURACY Discretization of Continuous Attributes Less Accurate for Regression “Noisy” Data Causes Inaccuracies
  • 32. 32 RANDOM FORESTS CONTROLLING OVERFITTING IN DECISION TREE LEARNING MODELING THE APPLICATION VECTOR AND GRAPH REPRESENTATIONS
  • 33. 33 MODELING THE APPLICATION + PLAYING DOMINOES WITH GRAPH PIECES GENERATING TEST ACTIONS SELECTING A FINITE NUMBER OF USER INPUTS FROM AN INFINITELY LARGE DOMAIN INPUT SPACE EXPLOSION 150 actions per page 35 steps 150 = 35 paths10 78 PROBABILISTIC MODELING Some elements and actions are more interesting than others. ~20% ~5% # atoms in the universe
  • 34. 34 GENERATING TEST ACTIONS HOW BOTS LEARN TO TAP, TYPE, AND SWIPE PERCEIVE What can we interact with? ACT ML determines action LEARN Feedback trains brain UI Elements Wrong Rewrite Correct Reinforce Artificial Neural Network Input Hidden Output REINFORCEMENT LEARNING AGENTS LEARN OPTIMAL INTERACTIONS WITH DYNAMIC ENVIRONMENT BY TRIAL AND ERROR In each experience, the agent takes an action a in state s, receives a reward r, and moves to state s’.
  • 35. 35 REINFORCEMENT LEARNING In each experience, the agent takes an action a in state s, receives a reward r, and moves to state s’. ACTION REWARD TRANSITION NEXT ACTIONPUNISHOR AGENTS LEARN OPTIMAL INTERACTIONS WITH DYNAMIC ENVIRONMENT BY TRIAL AND ERROR REINFORCEMENT LEARNING THREE PARTS OF A REINFORCEMENT LEARNING PROBLEM ENVIRONMENT At least partially observable by means of sensors REWARD FUNCTION Maps state-action pairs to reward value Defines how to choose a “good” action in each state VALUE FUNCTION
  • 36. 36 Q-LEARNING TRACKING LONG-TERM REWARDS, NOT JUST IMMEDIATE ONES OLD VALUE LEARNING RATE REWARD DISCOUNT FACTOR ESTIMATE OF OPTIMAL FUTURE REWARD LEARNED VALUE Maps an action in a particular state to its expected long-term reward. Q-LEARNING EXAMPLE WALKTHROUGH 2 10 4 3 5 5 Select Choice: (2, 3) 0 1 2 3 4 5 0 0 0 0 0 0 0 1 0 0 0 0 0 0 2 0 0 0 0 0 0 3 0 0 0 0 0 0 4 0 0 0 0 0 0 5 0 0 0 0 0 0 Q-MATRIX REWARDS 0 to 4, 4 to 0  0 1 to 5  100 3 to 4, 4 to 3  0 4 to 5  100 2 to 3, 3 to 2  0 5 to 5  100 3 to 1, 1 to 3  0
  • 37. 37 Q-LEARNING EXAMPLE WALKTHROUGH 0 1 2 3 4 5 0 0 0 0 0 0 0 1 0 0 0 0 0 0 2 0 0 0 0 0 0 3 0 0 0 0 0 0 4 0 0 0 0 0 0 5 0 0 0 0 0 0 Q-MATRIX REWARDS 0 to 4, 4 to 0  0 1 to 5  100 3 to 4, 4 to 3  0 4 to 5  100 2 to 3, 3 to 2  0 5 to 5  100 3 to 1, 1 to 3  0 2 10 4 3 5 5 2, 3 ← 0.0 0.8 · max 3, 1 , 3, 42, 3 ← 0.0 0.8 · max 3, 1 , 3, 4 2, 3 ← 0.0 0.8 · max 0 , 0 02, 3 ← 0.0 0.8 · max 0 , 0 0 Q-LEARNING EXAMPLE WALKTHROUGH 0 1 2 3 4 5 0 0 0 0 0 0 0 1 0 0 0 0 0 0 2 0 0 0 0 0 0 3 0 0 0 0 0 0 4 0 0 0 0 0 0 5 0 0 0 0 0 0 Q-MATRIX REWARDS 0 to 4, 4 to 0  0 1 to 5  100 3 to 4, 4 to 3  0 4 to 5  100 2 to 3, 3 to 2  0 5 to 5  100 3 to 1, 1 to 3  0 2 10 4 3 5 5 Select Choice: (3, 1)
  • 38. 38 Q-LEARNING EXAMPLE WALKTHROUGH 0 1 2 3 4 5 0 0 0 0 0 0 0 1 0 0 0 0 0 0 2 0 0 0 0 0 0 3 0 0 0 0 0 0 4 0 0 0 0 0 0 5 0 0 0 0 0 0 Q-MATRIX REWARDS 0 to 4, 4 to 0  0 1 to 5  100 3 to 4, 4 to 3  0 4 to 5  100 2 to 3, 3 to 2  0 5 to 5  100 3 to 1, 1 to 3  0 2 10 4 3 5 5 3, 1 ← 0.0 0.8 · max 1, 5 , 1, 33, 1 ← 0.0 0.8 · max 1, 5 , 1, 3 3, 1 ← 0.0 0.8 · max 0 , 0 03, 1 ← 0.0 0.8 · max 0 , 0 0 Q-LEARNING EXAMPLE WALKTHROUGH 0 1 2 3 4 5 0 0 0 0 0 0 0 1 0 0 0 0 0 0 2 0 0 0 0 0 0 3 0 0 0 0 0 0 4 0 0 0 0 0 0 5 0 0 0 0 0 0 Q-MATRIX REWARDS 0 to 4, 4 to 0  0 1 to 5  100 3 to 4, 4 to 3  0 4 to 5  100 2 to 3, 3 to 2  0 5 to 5  100 3 to 1, 1 to 3  0 2 10 4 3 5 5 Select Choice: (1, 5)
  • 39. 39 Q-LEARNING EXAMPLE WALKTHROUGH Q-MATRIX REWARDS 0 to 4, 4 to 0  0 1 to 5  100 3 to 4, 4 to 3  0 4 to 5  100 2 to 3, 3 to 2  0 5 to 5  100 3 to 1, 1 to 3  0 2 10 4 3 5 5 0 1 2 3 4 5 0 0 0 0 0 0 0 1 0 0 0 0 0 0 2 0 0 0 0 0 0 3 0 0 0 0 0 0 4 0 0 0 0 0 0 5 0 0 0 0 0 0 1, 5 ← 100 0.8 · max 5, 5 , 5, 11, 5 ← 100 0.8 · max 5, 5 , 5, 1 1, 5 ← 100 0.8 · max 0 , 0 1001, 5 ← 100 0.8 · max 0 , 0 100 100 100 Q-LEARNING EXAMPLE WALKTHROUGH Q-MATRIX REWARDS 0 to 4, 4 to 0  0 1 to 5  100 3 to 4, 4 to 3  0 4 to 5  100 2 to 3, 3 to 2  0 5 to 5  100 3 to 1, 1 to 3  0 2 10 4 3 5 5 Select Choice: (2, 3) 0 1 2 3 4 5 0 0 0 0 0 0 0 1 0 0 0 0 0 0 2 0 0 0 0 0 0 3 0 0 0 0 0 0 4 0 0 0 0 0 0 5 0 0 0 0 0 0 100
  • 40. 40 Q-LEARNING EXAMPLE WALKTHROUGH Q-MATRIX REWARDS 0 to 4, 4 to 0  0 1 to 5  100 3 to 4, 4 to 3  0 4 to 5  100 2 to 3, 3 to 2  0 5 to 5  100 3 to 1, 1 to 3  0 2 10 4 3 5 5 2, 3 ← 0.0 0.8 · max 3, 1 , 3, 42, 3 ← 0.0 0.8 · max 3, 1 , 3, 4 2, 3 ← 0.0 0.8 · max 0 , 0 02, 3 ← 0.0 0.8 · max 0 , 0 0 0 1 2 3 4 5 0 0 0 0 0 0 0 1 0 0 0 0 0 100 2 0 0 0 0 0 0 3 0 0 0 0 0 0 4 0 0 0 0 0 0 5 0 0 0 0 0 0 Q-LEARNING EXAMPLE WALKTHROUGH Q-MATRIX REWARDS 0 to 4, 4 to 0  0 1 to 5  100 3 to 4, 4 to 3  0 4 to 5  100 2 to 3, 3 to 2  0 5 to 5  100 3 to 1, 1 to 3  0 2 10 4 3 5 5 0 1 2 3 4 5 0 0 0 0 0 0 0 1 0 0 0 0 0 100 2 0 0 0 0 0 0 3 0 80 0 0 0 0 4 0 0 0 0 0 0 5 0 0 0 0 0 0 3, 1 ← 0.0 0.8 · max 1, 5 , 1, 33, 1 ← 0.0 0.8 · max 1, 5 , 1, 3 3, 1 ← 0.0 0.8 · max 100 , 0 803, 1 ← 0.0 0.8 · max 100 , 0 80 80
  • 41. 41 Q-LEARNING EXAMPLE WALKTHROUGH Q-MATRIX REWARDS 0 to 4, 4 to 0  0 1 to 5  100 3 to 4, 4 to 3  0 4 to 5  100 2 to 3, 3 to 2  0 5 to 5  100 3 to 1, 1 to 3  0 2 10 4 3 5 5 Select Choice: (2, 3) 0 1 2 3 4 5 0 0 0 0 0 0 0 1 0 0 0 0 0 100 2 0 0 0 0 0 0 3 0 80 0 0 0 0 4 0 0 0 0 0 0 5 0 0 0 0 0 0 Q-LEARNING EXAMPLE WALKTHROUGH Q-MATRIX REWARDS 0 to 4, 4 to 0  0 1 to 5  100 3 to 4, 4 to 3  0 4 to 5  100 2 to 3, 3 to 2  0 5 to 5  100 3 to 1, 1 to 3  0 2 10 4 3 5 5 2, 3 ← 0.0 0.8 · max 3, 1 , 3, 42, 3 ← 0.0 0.8 · max 3, 1 , 3, 4 2, 3 ← 0.0 0.8 · max 80 , 0 642, 3 ← 0.0 0.8 · max 80 , 0 64 0 1 2 3 4 5 0 0 0 0 0 0 0 1 0 0 0 0 0 100 2 0 0 0 64 0 0 3 0 80 0 0 0 0 4 0 0 0 0 0 0 5 0 0 0 0 0 0 64
  • 42. 42 Q-LEARNING EXAMPLE WALKTHROUGH Q-MATRIX REWARDS 0 to 4, 4 to 0  0 1 to 5  100 3 to 4, 4 to 3  0 4 to 5  100 2 to 3, 3 to 2  0 5 to 5  100 3 to 1, 1 to 3  0 2 10 4 3 5 5 0 1 2 3 4 5 0 0 0 0 0 80 0 1 0 0 0 64 0 100 2 0 0 0 64 0 0 3 0 80 51 0 80 0 4 64 0 0 64 0 100 5 0 80 0 0 80 100 After many episodes… Use Q-Values to select actions Q-LEARNING: AI FOR TESTING APPROACH html head body title pdiv font-size: 16px Hello Worldimg font-size : 16px font-weight: bold Compute Render Trees AIT Test Case Element/Screen Classifiers Application Graph Step Actions + Verifications
  • 43. 43 GENERATING TEST ACTIONS HOW BOTS LEARN TO PERFORM TEST ATTACKS PERCEIVE What can we interact with? ACT ML determines action LEARN Feedback trains brain Artificial Neural Network Input Hidden Output test@example.com’1 = 1 -- VALIDATING OUTPUT HOW BOTS LEARN TO DETECT BUGS PERCEIVE What can we interact with? ACT ML determines action LEARN Feedback trains brain Artificial Neural Network Input Hidden Output
  • 44. 44 VALIDATING OUTPUT HOW BOTS LEARN TO DETECT BUGS Try again Sorry for the Classification BUG
  • 45. 45 LOOSELY INSPIRED BY BIOLOGY ARTIFICIAL NEURAL NETWORKS Human Brain 15 - 33 Billion Neurons Biological Neuron Artificial Neuron ARTIFICIAL NEURON A perceptron is an algorithm for supervised learning of binary classifiers. A SINGLE-LAYER PERCEPTRON
  • 46. 46 ARTIFICIAL NEURON At its core, it is a function that maps inputs to outputs. A SINGLE-LAYER PERCEPTRON ARTIFICIAL NEURONA SIMPLE NEURAL NETWORK “A feed-forward network with a single layer is sufficient to represent any function…” Ian Goodfellow
  • 47. 47 A SINGLE-LAYER PERCEPTRON: LOSS FUNCTION ARTIFICIAL NEURON Given examples, find weights that map inputs to outputs. Initially, weights are randomly initialized. Value of predicted output may be different from the actual output . A LOSS function is used to measure this difference. HOW DO ARTIFICIAL NEURAL NETWORKS LEARN? FORWARD-PROPAGATION TRAINING NEURAL NETWORKS Hidden LayersInput Layer Output Layer LOSS     , ,     EVALUATION
  • 48. 48 BACK-PROPAGATION TRAINING NEURAL NETWORKS Hidden LayersInput Layer Output Layer LOSS ∆ ∆ Adjust weights FORWARD-PROPAGATION AGAIN TRAINING NEURAL NETWORKS REDUCED LOSS ∆ ∆ Adjust weights
  • 49. 49 TENSORFLOW PLAYGROUND NEURAL NETWORKS IN ACTION https://playground.tensorflow.org FEED-FORWARD CONVOLUTIONAL RECURRENT LONG SHORT-TERM MEMORY TYPES OF NEURAL NETWORKS DEEP LEARNING
  • 50. 50 LEARNING FROM EXISTING TESTS TEST GENERATION FROM ABSTRACT TEST FLOWS ABSTRACT TEST FLOW LANGUAGE ABSTRACT TEST FLOW LANGUAGE LONG SHORT-TERM MEMORY RECURRENT NEURAL NETWORK https://machinelearningmastery.com JASON BROWNLEE
  • 51. 51 TEXT GENERATION WITH LONG SHORT-TERM MEMORY RECURRENT NEURAL NETWORKS IN PYTHON WITH KERAS https://machinelearningmastery.com/text-generation-lstm-recurrent-neural-networks-python-keras/
  • 52. 52 Freely downloadable and usable for machine learning experiments. www.gutenberg.org ~150,000 Characters Total in the book 47 Distinct Characters When converted to lowercase 100-Length Subsequence Training N-Length Subsequence → Character Output CHAPT → E HAPTE → R Example (N=5)
  • 53. 53 be no mistake about it: it was neither more nor less than a pig, and she felt that it would be quit e aelin that she was a little want oe toiet ano a grtpersent to the tas a little war th tee the tase oa teettee the had been tinhgtt a little toiee at the cadl in a long tuiee aedun thet sheer was a little tare gereen to be a gentle of the tabdit soenee the gad ouw ie the tay a tirt of toiet at the was a little anonersen, and thiu had been woite io a lott of tueh a tiie and taede bot her aeain she cere thth the bene tith the tere bane to tee toaete to tee the harter was a little tire the same oare cade an anl ano the garee and the was so seat the was a little gareen and the sabdit, and the white rabbit wese tilel an the caoe and the sabbit se teeteer, and the white rabbit wese tilel an the cade in a lonk tfne the sabdi ano aroing to tea the was sf teet whitg the was a little tane oo thete the sabeit she was a little tartig to the tar tf tee the tame of the cagd, and the white rabbit was a little toiee to be anle tite thete ofs and the tabdit was the wiite rabbit, and 256 Memory Units, 1 Hidden Layer gooder head. and said to herself, ‘it was a little little shated of the mouse of the good of the courte, and it was a little little shated in a little that the was a little little shated of the thmee said to see it was a little book of the was a little that she was so sereated to hare a little the began sitee of the was of the was a little that she was so seally and the sabbit was a little lad good to the little gooder head of the gad seared to see it was a little lad good to the little good 256 Memory Units, 2 Hidden Layers herself lying on the bank, with her head in the lap of her sister, who was gently brushing away so siee, and she sabbit said to herself and the sabbit said to herself and the sood way of the was a little that she was a little lad good to the garden, and the sood of the mock turtle said to herself, 'it was a little that the mock turtle said to see it said to sea it said to sea it say it the marge hard sat hn a little that she was so sereated to herself, and she sabbit said to herself, 'it was a little little shated of the sooe of the coomouse it was a little lad good to the little
  • 54. 54 LEARNING FROM EXISTING TESTS test.ai Observe ErrorMessage IF Perceived Conditions Input BLANK FirstName Invoke SubmitObserve Required TextBox FirstName First Name* Last Name* Company ABSTRACT TEST FLOW LANGUAGE A Model-Based AI-Driven Test Generation System, Dionny Santiago. Masters Thesis Proposal, Florida International University (2018). LEARNING FROM EXISTING TESTS test.ai Observe ErrorMessage IF Perceived Conditions WHEN Input Actions Input BLANK FirstName Invoke SubmitObserve Required TextBox FirstName First Name* Last Name* Company ABSTRACT TEST FLOW LANGUAGE A Model-Based AI-Driven Test Generation System, Dionny Santiago. Masters Thesis Proposal, Florida International University (2018).
  • 55. 55 LEARNING FROM EXISTING TESTS Observe ErrorMessage IF Perceived Conditions WHEN Input Actions THEN Required Observations Input BLANK FirstName Invoke SubmitObserve Required TextBox FirstName First Name* Last Name* Company Please enter first name. Please enter last name. ABSTRACT TEST FLOW LANGUAGE A Model-Based AI-Driven Test Generation System, Dionny Santiago. Masters Thesis Proposal, Florida International University (2018). LEARNING FROM EXISTING TESTS GRAMMAR FOR ABSTRACT TEST FLOW LANGUAGE <flow> ::= <observation-list> <component-action-list> <observation-list> <observation-list> ::= <observation> ‘ ’ <observation-list> | <observation> <observation> ::= ‘Observe’ <qualifier-list> <component> | ‘NotObserve’ <qualifier-list> <component> <qualifier-list> ::= <qualifier> ‘ ’ <qualifier-list> | <qualifier> | ‘’ <qualifier> ::= ‘Required’ | <learned-qualifier> <component> ::= <element-class> <ident> | <ident> <component-action-list> ::= <component-action> ‘ ’ <component-action-list> | <component-action> <component-action> ::= ‘Input’ <equivalence-class> <component> | ‘Invoke’ <element-class> <equivalence-class> ::= “VALID’ | ‘BLANK’ | ‘WHITESPACE’ | <learned-eq-class> <element-class> ::= ‘Textbox’ | ‘Dropdown’ | ‘ErrorMessage’ | ‘Submit’ | ‘Cancel’ | <learned-el-class> <learned-qualifier> ::= <ident> <learned-eq-class> ::= <ident> <learned-el-class> ::= <ident> A Model-Based AI-Driven Test Generation System, Dionny Santiago, Masters Thesis Proposal, Florida International University (2018).
  • 56. 56 LEARNING FROM EXISTING TESTS PREPARING TRAINING DATA Input Sentence Predicted Next Word Perceive Required Perceive Required Textbox Perceive Required Textbox FirstName Perceive Required Textbox FirstName Input Perceive Required Textbox FirstName Input VALID Perceive Required TextBox FirstName Input VALID FirstName Invoke Perceive Required TextBox FirstName Input VALID FirstName Invoke Submit Perceive Required TextBox FirstName Input VALID FirstName Invoke Submit NotObserve Perceive Required Textbox FirstName Input VALID FirstName Invoke Submit NotObserve ErrorMessage A Model-Based AI-Driven Test Generation System, Dionny Santiago. Masters Thesis Proposal, Florida International University (2018). LEARNING FROM EXISTING TESTS TEST GENERATION FROM ABSTRACT TEST FLOWS
  • 57. 57 LEARNING FROM EXISTING TESTS SAMPLE RESULTS FROM TEST FLOW SENTENCE TRAINING Loss 2.9 0.5 A Model-Based AI-Driven Test Generation System, Dionny Santiago. Masters Thesis Proposal, Florida International University (2018). LEARNING FROM EXISTING TESTS SAMPLE RESULTS FROM TEST FLOW SENTENCE TRAINING Executed Query: Perceive Required TextBox FirstName ML leverages the trained model to fill in next steps. At first it sucks! Loss 2.9 0.5 But then it gets better.
  • 58. 58 LEARNING FROM EXISTING TESTS SAMPLE RESULTS FROM TEST FLOW SENTENCE TRAINING Most importantly it generalizes… This fragment did not appear in training set. NEURAL NETS IN PRACTICE PROGRAMMING FRAMEWORKS
  • 59. 59 TENSORFLOW TRAINING JUPYTER NOTEBOOKS EXECUTING TEST FLOWS TRACKING AS BOTS STEP THROUGH THE APPLICATION
  • 60. 60 EXECUTING TEST FLOWS TRACKING AS BOTS STEP THROUGH THE APPLICATION BENEFITS OF AI-DRIVEN TESTING PESTICIDE FREE Generates New Tests Each Time Eliminates Pesticide Paradox GENERAL PURPOSE Different Testing Types Any Application or Domain LARGE SCALE Deep Learning Cloud Infrastructure
  • 61. 61 BAYES’ THEOREM: INTRODUCTION BAYESIAN NETWORKS Conditional probability is the probability of an event happening, given that it has some relationship to one or more other events. FINDING AN OPEN PARKING SPACE ? BAYESIAN NETWORKS BAYES’ THEOREM: INTRODUCTION
  • 62. 62 Conditional probability is the probability of an event happening, given that it has some relationship to one or more other events. BAYESIAN NETWORKS BAYES’ THEOREM: INTRODUCTION TIME OF DAYLOCATION EVENTS BAYES’ THEOREM BAYESIAN NETWORKS : GRAPHICAL MODELING SMOKERSMOKER LUNG DISEASE LUNG DISEASE SHORTNESS OF BREATH SHORTNESS OF BREATH CHEST PAIN CHEST PAIN COUGHCOUGH FEVERFEVER COLDCOLD
  • 63. 63 CONCURRENT SESSION BAYESIAN NETWORKS : FIGHTING TEST FLAKINESS OUTLINE  FUTURE TRENDS IN AI-DRIVEN TESTING
  • 64. 64 FUTURE TRENDS ENHANCE PORTIONS OF EXISTING TESTING TOOLS REPLACE ENTIRE TOOL STACKS BUT NEED HUMAN INPUT TAKE OVER HUMAN ACTIVITY AFTER LEARNING OVER TIME
  • 66. 66 Self- Configure Self- Optimize Self- Heal Self- Protect Self- Test AUTONOMIC SELF-TESTING Software Component Monitor Analyze Plan Execute Knowledge (Brain) Autonomic Test Manager A Self-Testing Approach for Autonomic Software, Tariq M. King. ProQuest Electronic Theses and Dissertations (2009).
  • 67. 67 The AI for testing problem, and testing in general, is too important and large of a problem for any one company or effort to solve, and hence we formed an association around it. www.aitesting.org