AI (Artificial Intelligence) can make software testing better, and it is already happening. My presentation at Test & Quality Summit online 16.9.2020 talks a bit about Artificial Intelligence / Machine Learning theory, then discusses through NASA code quality case the fact that AI can be very precise in spotting problems. Finally, I take a look at software testing industry, which already proves to have many AI-powered tools and projects. Thanks to the team at Knowit and all the references in the content. I hope all of us start accelerating towards reaping off the AI benefits.
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
AI improves software testing by Kari Kakkonen at TQS
1.
2. 2
• ROLES
• Knowit Solutions Oy, Director of Training and Competences,
Lead Consultant, Trainer and Coach
• Secretary of ISTQB Executive Committee
• Treasurer of Finnish Software Testing Board (FiSTB)
• Children’s and testing author at Dragons Out Oy
• ACHIEVEMENTS
• Influencing testing since 1996
• Ranked in 100 most influential IT persons in Finland (Tivi
magazine)
• Great number of presentations in Finnish and international
conferences
• TestausOSY/FAST founding member.
• Co-author of Agile Testing Foundations book
• Regular blogger in Tivi-magazine
• EDUCATION
• ISTQB Expert Level Test Management & Advanced Full &
Agile Tester certified
• DASA DevOps, Scrum Master and SAFe certified
• SPICE provisionary assessor certified
• M.Sc.(Eng), Helsinki University of Technology (present Aalto
University), Otaniemi, Espoo
• Marketing studies, University of Wisconsin-Madison, the
USA.
BUSINESS DOMAINS
• Wide spread of business domain knowledge
• Embedded, Industry, Public,
• Training, Telecom, Commerce,
• Insurance, Banking, Pension
SERVICES
• ISTQB Advanced, Foundation and Agile Testing +
Knowit Quality Professional
• DASA DevOps
• Quality & Test process and organization
development, Metrics
• Agile testing, Scrum, Kanban, Lean
• Leadership
• Test automation, Mobile, Cloud, DevOps, AI
• Quality, Cost, Benefits.
Kari Kakkonen twitter.com/kkakkonen
linkedin.com/in/karikakkonen/
Dragonsout.com
Copyright Knowit Solutions Oy 2020 #TQS2020
3. 2400
Employees, 150 in
Finland
In 5
countries
Sweden, Norway,
Denmark, Finland and
Germany
315 million
Turnover
Nasdaq
OMX Mid Cap
30 million
Profit, margin 9,6 %
Copyright Knowit Solutions Oy 2020 #TQS2020 3
4. • Artificial Intelligence (AI) in short
• Case of NASA code quality metrics
using AI
• Other AI and testing developments
Agenda
Copyright Knowit Solutions Oy 2020 #TQS2020 4
5. Drivers of artifical intelligence
1. Models everywhere.
2. Amount of data is exploding.
3. Manual analytics is slow and costly.
• Interest to automate analytics and
modeling is growing.
• Development speed of analytics
algorithms is accelerating.
• Algorithms, that automatically process
data to information, can produce data
and better models independently.
Figure: Amount of data in world. Forbes, 27 Nov. 2018.
Copyright Knowit Solutions Oy 2020 #TQS2020 5
6. Quality management as top use-case for AI
Source: AI software platform adoption survey, IDC, February 2019 [Percent of respondents: N=505]
Copyright Knowit Solutions Oy 2020 #TQS2020 6
7. • When talking about AI, it is
important to ask if we are
talking about modelling
humans or how to work in
ideal way.
• Machine learning is a sub-
category of AI, which
considers algorithms that
enable AI to learn ideal way to
work.
Artificial intelligence == machine learning?
Figure: Example of concepts related to AI.
Copyright Knowit Solutions Oy 2020 #TQS2020 7
8. Three methods of machine learning
Machine learning methods
Supervised Learning
• The aim is to learn
mapping from input to
output.
• Output is known by
supervisor.
Unsupervised Learning
• The aim is to find
”something interesting”.
• Output is not known
(known also as density
estimation in statistics).
Reinforcement Learning
• Seemingly good
solutions are
encouraged to
develop further.
AI literature review[1]
1 Reagan, A., et al., The emotional arcs of stories are dominated by six basic shapes, EPJ Data Science (2016).
Copyright Knowit Solutions Oy 2020 #TQS2020 8
9. No one tool for all
Copyright Knowit Solutions Oy 2020 #TQS2020
Performance
Amount of data, time, and computing power
• Linear discriminant
analysis
• Logistic regression
• Medium-sized ANNs
• Genetic algorithms
• Extreme learning
machines
• Convolution neural
networks
• Generative neural
networks
• Deep belief networks
• Recurrent neural
networks
• Simple neural networks
9
10. Planning
descriptions
Code Unit testing
Integration testing
System testing
Acceptance
testing
Definition
descriptions
Requirements
• Static methods
• Reviews
• Dynamic methods
• Test runs
Remember there are different kinds of testing
Copyright Knowit Solutions Oy 2020 #TQS2020 10
11. AI in software testing
Copyright Knowit Solutions Oy 2020 #TQS2020
• In static testing, several machine learning
algorithms can be used to measure code
quality.[1] NASA’s code review.
• In dynamic testing, model-based regression
tests can be replaced by algorithms that
generate test flows on-the-fly.[2] Chaos
monkey of Netflix.
• In maintenance testing, machine learning can
be used to plan more realistic statistical
models of how application is actually used.
Figure: Margaret Hamilton standing next
to source code of guidance system of
Apollo spacecraft.
www.nasa.gov/
11
14. • Detecting:
• abnormal behaviour
• new kind of customers
• etc.
Anomaly detection
Copyright Knowit Solutions Oy 2020 #TQS2020
Figure: Example of time series
14
15. • Several code quality metrics are currently
being used. The most popular ones have
been introduced in 1970.[1,2]
1 T.J. McCabe, A Complexity Measure, IEEE Transactions on Software Engineering (1976) SE-2, 4, 308.
2 M.H. Halstead, Elements of Software Science, Elsevier (1977).
3 N.E. Fenton, S.L. Pfleeger, Software Metrics: A Rigorous & Practical Approach, International Thompson Press (1997).
4 S.J. Sayyad, T.J. Menzies, The PROMISE Repository of Software Engineering Databases (2005).
• Goal is to provide feedback:
1. for developers about code quality.
2. for testers about needed test coverage.
3. for management about the development
project
• Although traditional metrics are extensively
used, benefit of using them has been
questioned.[3]
0
50
100
150
200
250
300
350
400
450
0 20 40 60 80 100 120
Numberoflines.
Cyclomatic complexity
Scattering of defects in NASA CM1 project
OK Defected
Figure: NASA Metrics Data Program, CM1 Project[4]
In real applications defected modules do not separate from
non-defected by standard metrics.
AI code quality metrics
Copyright Knowit Solutions Oy 2020 #TQS2020 15
18. • Goal is to understand technical quality and test coverage of modules.
Also, goal is to guide and focus testing:
• Focusing technical debt reduction
• Found defects per module
• Guide for test coverage in automating system level testing.
AI code quality metrics
Copyright Knowit Solutions Oy 2020 #TQS2020
Requires that there is link from components (version control) and tests (test management) to feature descriptions and from reported defects to modules (observation control)
Module Developer Benchmark
(order.numb.)
Relative
risk
Number of
reported
bugs
Module_1 Jaakko 50 58 4
Module_2 Jaakko 4 5 1
Module_3 Mikko 180 95 7
SCRUM TEAM
18
19. • Goal is to provide overview:
• How fast the development is advancing
• Maturity for release
• Quality and technical debt of the software
• Defect probabilities
• Risks related to modifications of the
software.
AI code quality metrics
Copyright Knowit Solutions Oy 2020 #TQS2020
Interpretation:
• Module 5 has high defect probability and is
related to five most important features of
the application. This results into high risk in
release at this moment.
• Defect probability of module 10 has fallen
to acceptable level.
Start-up
phase
Development
phase
Maturing
phase
MANAGEMENT
19
20. 1
2
𝑤 2
+ 𝐶
𝑖=1
𝑁
ξ𝑖
1-𝑦𝑖 𝑤, 𝑓(𝑥𝑖) + 𝑏 ≤ ξ𝑖
Minimize
Subject to with all values of i.
Quality metric 1
Qualitymetric2
• Machine learning approach was tested for NASA’s CM1
software repository[1].
• Support vector type of machine learning algorithm was
developed for this demonstration.
• This task can be solved by supervised machine learning
methods because both input (quality metrics) and output
(defects) is known.
• Goal is to find such hyperplane in multidimensional data
space that separate defected modules from non-
defected.
• Mathematically, problem can be described with algorithm:
AI-guided software testing, demonstration
Copyright Knowit Solutions Oy 2020 #TQS2020 20
21. 0,0
0,2
0,4
0,6
0,8
Tested on real data against NASA CM1 project[1]
Performance(F)
Training set: 1595
Test set: 400
𝐹 =
2 ∗ 𝑎𝑐𝑐𝑢𝑟𝑎𝑐𝑦 ∗ 𝑟𝑒𝑐𝑎𝑙𝑙
𝑎𝑐𝑐𝑢𝑟𝑎𝑐𝑦 + 𝑟𝑒𝑐𝑎𝑙𝑙
AI-guided software testing, demonstration
Copyright Knowit Solutions Oy 2020 #TQS2020 21
22. Stages of execution
4. DEPLOYMENT AND UTILIZATION OF THE ALGORITHM
Monitoring and analysing results
2. DEFINING QUALITY METRICS
Defining quality and defect metrics
Building the metrics
3. DEFINING HOW RESULTS ARE PRESENTED
Defining who will use results and how
Building data visualization
1. DEFINING DATA SOURCES
From where data is collected
How will the data be collected
Copyright Knowit Solutions Oy 2020 #TQS2020 22
24. • Enhanced automation
• Test automation
• Robotic Process Automation -> Intelligent automation
• AI-powered test automation
• Enhanced test selection
• Risk analysis
• Test case selection
• Code analysis
General direction at businesses
on AI and testing
Copyright Knowit Solutions Oy 2020 #TQS2020 24
25. • Start from screenshots
• Detect layout issues
• Cross-browser testing for differences
• Ignore invisible rendering, size, position differences
• Case: Applitools
• https://applitools.com / Visual AI
AI-powered comparison of visual elements
Copyright Knowit Solutions Oy 2020 #TQS2020 25
26. • AI-based test generation
• Checking functional differences
• Checking visual differences
• Automatically learning the test
automation
• For: regression testing after changes
• Case: retest
• Unfortunately a victim of Covid-19
• https://retest.de/ai-based-test-
generation/
AI with regression testing
Copyright Knowit Solutions Oy 2020 #TQS2020 26
27. • “World’s first”
• Go automatically through mobile apps
• Use general test cases
• Reinforcement learning
• Case: test.ai
• https://www.test.ai/
AI-powered mobile test automation platform
Copyright Knowit Solutions Oy 2020 #TQS2020 27
28. • Default tests to web sites
• Teach your own tests
• Running on containers in virtual
machines
• Use for regression testing, cross-
browser testing
• Case: Mabl
• https://www.mabl.com/
Auto-healing automated testing of web
Copyright Knowit Solutions Oy 2020 #TQS2020 28
29. • Build test through interface backed by ML
• Plain English
• New life for “record-playback”
• ML algorithms maintain the tests
• Case: Functionize
• https://www.functionize.com/
Intelligent testing
Copyright Knowit Solutions Oy 2020 #TQS2020 29
30. • Support test automation engine data selection with AI
• Can be used for testing with large quantities of data
• Can be used automating production as Robotic Process Automation
(RPA)
• Cases:
• Robot Framework test automation framework
• Aito AI tool
• https://robotframework.org/
• https://aito.ai/
• https://aito.ai/blog/machine-learning-in-robot-framework/
Automating tests or production with lots of
repetitive data
Copyright Knowit Solutions Oy 2020 #TQS2020 30
31. • Go through functionalities
• Identify risky areas
• Focus testing
• Case: Eggplant
• https://www.eggplantsoftwar
e.com/
Predict quality issues
Copyright Knowit Solutions Oy 2020 #TQS2020 31
32. • Analyze risk in commits to the code
• Select the tests that test the risky areas
• Reduce number of test cases needed to run
• Case: Appsurify
• https://appsurify.com/
Select most suitable test cases
Copyright Knowit Solutions Oy 2020 #TQS2020 32
33. • Power of open source
developers
• Machine learning
algorithms learn from the
community automatically
• Analyse code and
propose improvements
• Case: DeepCode
• https://www.deepcode.ai/
Code analysis using AI
Copyright Knowit Solutions Oy 2020 #TQS2020 33
34. • Trainings and certifications
• https://www.alliance4qualification.info/a4q-ai-and-software-testing
• https://www.brightest.org/en/certifications/AiU-Certified-Tester-in-Artificial-
Intelligence/
• Associations
• https://www.aitesting.org/
• www.istqb.org
• Standards
• ISO
• Focus on AI https://jtc1info.org/technology/artificial-intelligence/
• Under development: Testing of AI-based systems
https://www.iso.org/standard/79016.html?browse=tc
• IEEE
• https://ieeexplore.ieee.org/document/8705808
Promoting and teaching AI and testing
Copyright Knowit Solutions Oy 2020 #TQS2020 34
36. • AI-enabled testing is already a reality
• Many companies are enhancing their solutions with AI
• New companies are set up around AI
• AI can provide simplicity to complex software development projects.
• With AI, testing activities can be focused on high risk areas.
• With AI, test automation becomes more autonomous
• Testers are freed to created new tests
Conclusion
Copyright Knowit Solutions Oy 2020 #TQS2020 36