SlideShare a Scribd company logo
20140918 System Verification Associates © 2014 1
How to Release Rock-solid RESTful
APIs and Ice the Testing BackBlob
Unicom Next Generation Testing Conference
Chicago, September 18, 2014
Robert V. Binder
SystemVerification Associates
Enabling High Assurance http://sysverif.com
20140918 System Verification Associates © 2014 2
Overview
• Background
• Advanced API Verification
• Dataflow Testing Model
• Model-based Testing Demo
• The Testing Twofer
• Q&A
20140918 System Verification Associates © 2014 3
Discovery Analysis Design Verification Support
BACKGROUND
20140918 System Verification Associates © 2014 4
You are here …
Browser
HTTP Client
HTTP
Server
App
HTTP Client
App
SOAP Client
HTTP Client
Files
HTTP
Server
Service
SOAP Server
Service
SOAP Server
Files
SOAP API
REST API
20140918 System Verification Associates © 2014 5
Programmable Web’s Growing Roster
20140918 System Verification Associates © 2014 6
Google Trends: REST and SOAP
100
News Headline Occurrence, Monthly
SOAP API
REST API
20140918 System Verification Associates © 2014 7
So many APIs, so little time …
Why is this happening?
20140918 System Verification Associates © 2014 8
Challenges
• Usability
• Narrow developer focus
• Poor documentation
• Revenue prevention
• Assurance Fragmentation
• Functionality
• Security
• Performance
• Low reliability
• Ineffective testing
• Manual UI interaction
• Developer-centric, hand-
coded unit testing
• Wheel spinning
• High QA expense
• Low quality
All-aspect approach needed
20140918 System Verification Associates © 2014 9
Discovery Analysis Design Verification Support
ADVANCED API VERIFICATION
20140918 System Verification Associates © 2014 10
Discovery Sprint
• Survey and catalog
• API documentation
• Open and closed issues
• Social media views
• Codebase
• Usage logs
• Results
• Strategy
• Test environment spec
• Report card
Discovery Analysis Design Verification Support
20140918 System Verification Associates © 2014 11
Analysis Sprint
• Workflow
• Construct usage profile
• Scrutinize documentation
• Abstract data model
• Results
• Doc issues
• Gap analysis
• Revised strategy
Discovery Analysis Design Verification Support
20140918 System Verification Associates © 2014 12
Design Sprint
• Workflow
• Configure virtual lab
• Behavior/data models
• Traffic capture/parsers
• Instantiate adapters
• Results
• Stable test environment
• All-aspect test model
• Revised strategy
Discovery Analysis Design Verification Support
20140918 System Verification Associates © 2014 13
Verification Sprint
• Workflow
• Model checking
• Generate/run test suites
• Collect traffic logs
• Analyze coverage
• Results
• All test artifacts
• Test coverage report
• Final report
• Briefing
Discovery Analysis Design Verification Support
20140918 System Verification Associates © 2014 14
Support
• As needed
• Incremental design review
• Usage monitoring
• CI and regression testing
• Results
• Continuity
• Protect investment
• Continuous improvement
Discovery Analysis Design Verification Support
20140918 System Verification Associates © 2014 15
Discovery Analysis Design Verification Support
DATAFLOW TESTING MODEL
20140918 System Verification Associates © 2014 16
System Under Test
Service
Browser
HTTP Client
HTTP
Server
App
SOAP Client
SOAP Server
HTTP Client
Files
Service
HTTP
Server
SOAP Server
Files
App
HTTP Client
REST API
20140918 System Verification Associates © 2014 17
Test Configuration
Service
App
HTTP
Server
HTTP Client
Service
HTTP
Server
Generated
Test Code
Test Model
REST API
20140918 System Verification Associates © 2014 18
REST = Methods + Resources + Parameters
Service
App HTTP
ServerHTTP Client
HTTP
Server Service
HTTP methods:
GET, PUT, POST, DELETE …
HTTP resources (URI):
http://foo.com/titles
HTTP returned payload, JSON format:
{"firstName": "Bob",
"lastName": "Binder",
"books": [
{ "title": "Testing Object-oriented"},
{ "title": "Application Debugging"}
]
}
Status Code:
200, 201, 400, 404
/?au=binder
20140918 System Verification Associates © 2014 19
REST Dataflow Model – Normal Paths
alpha
Defined
Used
Gone
PUT/201
GET/200
PUT|POST/200
DELETE/200
DELETE/200PUT|POST/200
GET/200
20140918 System Verification Associates © 2014 20
REST Dataflow Model – Method Errors
alpha
Defined
Used
Gone
DELETE|GET/404
DELETE|GET|PUT|POST/404
20140918 System Verification Associates © 2014 21
REST Dataflow Model – Parameter Errors
alpha
Defined
Used
Gone
PUT|POST|GET|DELETE
?garbage/400
PUT|POST|GET|DELETE
?garbage/400
20140918 System Verification Associates © 2014 22
REST Dataflow Model
alpha
Defined
Used
Gone
Test Pattern: Non-Modal Class
20140918 System Verification Associates © 2014 23
Input variation, all sequences
• Nominal values
• Boundary values
• Operator mutants
• Fuzzing, each/all
• Domain model
• Pairwise selection
• Sequence
randomization
Sounds like a lot of work!
20140918 System Verification Associates © 2014 24
Model-based Testing
• Model-based testing tool
• Microsoft Research, 2001
• Test 500 MSFT APIs, 2007-12
• Robust and stable
• Visual Studio “power tool”
• C# code, not cartoons
• Generates standalone
executable test suite
20140918 System Verification Associates © 2014 25
Demo
• Synthetic Client
• Model Program
• Coordination File
• Test Cases
SUT HostTest Host
Test Suite
HTTP
Server
Synthetic
Client
Pass/Fail
Synthetic
Client
Interface
Spex
Rules
Spex
Cord
Test Modeling Test Execution
Service
Under
Test
Explore/
Generate
20140918 System Verification Associates © 2014 26
Synthetic Client
• The test model’s view of the SUT
• Static class wrapper for HTTP client
• Public methods correspond to SUT’s
HTTP methods and resources
• Manage server-side setup/cleanup
• Message serialize/deserialize
• Becomes part of the executable test
code assembly
• Example is a stub!
20140918 System Verification Associates © 2014 27
Model Program
• [Rule]
• Determines when an action
is called
• Selects argument values for
the action call
• Computes expected results
• Updates its model state as
needed
• Simulates environment
and/or system under test
20140918 System Verification Associates © 2014 28
Cord File
• Defines all model
actions
• action = Synthetic Client
public method
• machine
• Any action sequence
• Similar to regex
• May use other machines
• Model any use case,
scenario, slice, etc.
• Many options
20140918 System Verification Associates © 2014 29
What is Exploration?
• Find all action sequences and data
bindings that model program Rules
and a machine allow
• Search loop
• Select a rule for a machine action
• If enabling condition true:
• Update model program state
• Return expected results
• Stop when all selected inputs used or
size limit exceeded
20140918 System Verification Associates © 2014 30
Machine Exploration
• Shows all possible
action sequences for a
machine
• No data bindings
• Note similarity to
normal path dataflow
20140918 System Verification Associates © 2014 31
Model Program Exploration
• Rules + machine
• Rules add data
bindings, expected
results
• Many ways to
choose data values
20140918 System Verification Associates © 2014 32
Test Cases from an Exploration
• Spex chooses exploration steps
that end in accepting state
• Covers all states and steps at
least once
20140918 System Verification Associates © 2014 33
Generate Test Code
• Standalone code – does
not require model
• Run from VS Test
Explorer or command
line
20140918 System Verification Associates © 2014 34
SUT HostTest Host
Test Suite
HTTP
Server
Synthetic
Client
Pass/Fail
Synthetic
Client
Interface
Spex Rules
Spex Cord
Test Modeling Test Execution
Service
Under
Test
Explore/
Generate
20140918 System Verification Associates © 2014 35
Test Strategy
• Each resource path
• Interleave all DUG
variants
• Accepting sequence
• Wrong sequence
• Pairwise combination
• Parameters (path and value)
• Mutants, nominal, edge
• Security
• Interleave Fuzz cases
• Abuse case model
• All other HTTP methods
• Performance
• Virtual users/test drivers
• Randomize combos
20140918 System Verification Associates © 2014 36
Discovery Analysis Design Verification Support
THE TESTING TWOFER
20140918 System Verification Associates © 2014 37
The Testing BackBlob
Total
Number
of Test
Cases
Sprint 1
Available
Test Time
Manual Test
Cases not
executed
Automated Test
Cases not
maintained
Total Developed
Test Cases
Sprint 2 Sprint 3 Sprint 4
20140918 System Verification Associates © 2014 38
The Attack of the Testing BackBlob
Coming soon … to a scrum near you
20140918 System Verification Associates © 2014 39
Test Asset Size
Model
Test Code
Adapters
Model-based Testing Behavior Driven Development
20140918 System Verification Associates © 2014 40
Test Asset Maintenance Load
Model
Test Code
Adapters
Model-based Testing Behavior Driven Development
20140918 System Verification Associates © 2014 41
The Testing Twofer
Rock Solid APIs
• Documentation Scrutiny
• Fact-based Evaluation
• Multi-dimensional testing
• Dataflow coverage
• Everything wrong at least
once
• Fuzzing
• Repeat at scale
Icing the BackBlob
• Develop/maintain model
• Regenerate test suites
20140918 System Verification Associates © 2014 42
Q & A
rvbinder@sysverif.com
#MoreModelsLessTests
http://sysverif.com
20140918 System Verification Associates © 2014 43
Discovery Analysis Design Verification Support
ETC.
Say what you do, do what you say
20140918 System Verification Associates © 2014 44
Robert V. Binder
Robert Binder is a high-assurance
entrepreneur.
He has developed hundreds of application
systems and advanced automated testing
solutions. As test process architect for
Microsoft’s Open Protocol Initiative, he lead the
application of model-based testing to all of
Microsoft’s server-side APIs. He is the author of
the definitive Testing Object-Oriented Systems:
Models, Patterns, and Tools and two other
books. He holds a US patent for model-based
testing of mobile systems.
• MS, EECS, University of Illinois at Chicago
• MBA, University of Chicago
• BA, University of Chicago
20140918 System Verification Associates © 2014 45
System Verification Associates
Enabling High Assurance
• Chicago- based consulting boutique
• Clients are typically software development
organizations for whom system failure is not an option.
• We assist clients in achieving high reliability and
effectiveness in their IT processes and systems.
• Founded in 2009 and led by Robert V. Binder
• http://sysverif.com
• Advanced API Verification Datasheet
• Supported Microsoft’s Open Protocols project with a
team of experts; Robert Binder served process architect,
leading the technical work of over 300 staff located in
Redmond, China, India, and Argentina.
• Assessed and improved software process at several
FDA-regulated product companies, balancing quality
management system compliance and Agile practices.
• Developed model-based testing solutions for high-
frequency trading and aerospace applications.
• Helped software service and product companies
articulate unique high-value messaging for innovative
services.
• Conducted and published the Model-based Testing User
Survey of 2012 and 2014 (forthcoming.)
20140918 System Verification Associates © 2014 46
Does My API Suck?
 Your documentation is incomplete, wrong,
misleading, or just plain incomprehensible.
 Users complain that coding simple use cases
is just too much hassle.
 Users often rely on workarounds—they FTP
files instead of using your API’s getFile.
 Your API is unbalanced or incomplete—you
can turn something on, but not off.
 Your API’s service crashes or responds with
garbage when messages are out of order or
contain invalid data.
 Version mismatches have unpredictable
results.
 No one is really sure what will happen with
edge cases and they don’t want to know.
 Your API allows your service to be hacked
with common attack vectors.
 Your service supports several protocols (REST,
SOAP,…) or formats (JSON, XML,…), but
behavior and data isn’t consistent
 Your API doesn’t provide useful feedback—
good and bad input all get the same
response.
 Your service is so awesome that it draws
traffic spikes, but then your server chokes
and dies.
Buggy APIs are eating the world

More Related Content

PDF
Cucumber spec - a tool takes your bdd to the next level
PDF
Model-based Testing: Taking BDD/ATDD to the Next Level
PPTX
Testing Services
PDF
API Testing
PPTX
Postman Introduction
PDF
Karate - powerful and simple framework for REST API automation testing
PPTX
API Test Automation Using Karate (Anil Kumar Moka)
PDF
Reasons To Automate API Testing Process
Cucumber spec - a tool takes your bdd to the next level
Model-based Testing: Taking BDD/ATDD to the Next Level
Testing Services
API Testing
Postman Introduction
Karate - powerful and simple framework for REST API automation testing
API Test Automation Using Karate (Anil Kumar Moka)
Reasons To Automate API Testing Process

What's hot (20)

PPT
Test Process Improvement
PPTX
Structural testing
PDF
Postman: An Introduction for Testers
PDF
Zipline—Airbnb’s Declarative Feature Engineering Framework
PPTX
API Testing for everyone.pptx
PPTX
API Management in Digital Transformation
PDF
API TESTING
PPTX
The Test Pyramid
PPT
Test case design
PPTX
Importance of Software testing in SDLC and Agile
PDF
PDF
How to Automate API Testing
PPTX
Postman. From simple API test to end to end scenario
PPT
Automation testing
PPT
ISTQB / ISEB Foundation Exam Practice - 4
PPTX
Belajar Postman test runner
PPTX
Negative Testing
PPT
Whitebox testing
PPTX
POSTMAN.pptx
PPTX
Api Testing
Test Process Improvement
Structural testing
Postman: An Introduction for Testers
Zipline—Airbnb’s Declarative Feature Engineering Framework
API Testing for everyone.pptx
API Management in Digital Transformation
API TESTING
The Test Pyramid
Test case design
Importance of Software testing in SDLC and Agile
How to Automate API Testing
Postman. From simple API test to end to end scenario
Automation testing
ISTQB / ISEB Foundation Exam Practice - 4
Belajar Postman test runner
Negative Testing
Whitebox testing
POSTMAN.pptx
Api Testing
Ad

Viewers also liked (20)

PDF
Model-Based Testing: Why, What, How
PDF
Automated Test Case Generation and Execution from Models
PDF
Popular Delusions, Crowds, and the Coming Deluge: end of the Oracle?
PDF
Lessons learned validating 60,000 pages of api documentation
PDF
MTS: Controllable Test Objects
PDF
Mobile App Assurance: Yesterday, Today, and Tomorrow.
PPTX
Threat Modeling: Applied on a Publish-Subscribe Architectural Style
PPTX
API Testing – Keeping a Check on Agile Software Development
PDF
JOB ORDER FORM
PPT
Agile Testing - Challenges
PPTX
Model-based Testing of a Software Bus - Applied on Core Flight Executive
PDF
Model-based Testing: Today And Tomorrow
PDF
I Love APIs 2015: Getting **IT Done Workshop
PPTX
Load-time Hacking using LD_PRELOAD
PDF
Reverse Engineering of Software Architecture
PDF
Carbon Finance
PDF
Laravel Restful API and AngularJS
PDF
DevOps - Its just Agile done right
PDF
Model-based Testing using Microsoft’s Spec Explorer Tool: A Case Study
PPTX
Linux binary analysis and exploitation
Model-Based Testing: Why, What, How
Automated Test Case Generation and Execution from Models
Popular Delusions, Crowds, and the Coming Deluge: end of the Oracle?
Lessons learned validating 60,000 pages of api documentation
MTS: Controllable Test Objects
Mobile App Assurance: Yesterday, Today, and Tomorrow.
Threat Modeling: Applied on a Publish-Subscribe Architectural Style
API Testing – Keeping a Check on Agile Software Development
JOB ORDER FORM
Agile Testing - Challenges
Model-based Testing of a Software Bus - Applied on Core Flight Executive
Model-based Testing: Today And Tomorrow
I Love APIs 2015: Getting **IT Done Workshop
Load-time Hacking using LD_PRELOAD
Reverse Engineering of Software Architecture
Carbon Finance
Laravel Restful API and AngularJS
DevOps - Its just Agile done right
Model-based Testing using Microsoft’s Spec Explorer Tool: A Case Study
Linux binary analysis and exploitation
Ad

Similar to How to Release Rock-solid RESTful APIs and Ice the Testing BackBlob (20)

PDF
Embedded world 2017
PPTX
Test Automation NYC 2014
PDF
Agile Software Testing the Agilogy Way
PDF
The Future of Automation Testing Emerging Trends and Technologies
PDF
Keynote VST2020 (Workshop on Validation, Analysis and Evolution of Software ...
PDF
2020 Testing Trends: Top Predictions for QA Teams to Watch, Join, and Lead
PDF
DevTest Portfolio Overview
PPTX
Vishal_Final_Evaluation_PPT
PDF
The Next Wave of Software Testing_ Trends Shaping 2025.pdf
PDF
Hardening
PDF
Future of Software Testing and What are the Trends to follow in 2023.pdf
PPT
Software Testing 1198102207476437 4
PPT
Software Testing
PDF
Software Testing Trends in 2023
PDF
Automated testing-whitepaper
PDF
Service Virtualization: What Testers Need to Know
PPT
Context Driven Automation Gtac 2008
PDF
The Evolution of Software Testing_ Trends and Innovations.pdf
PDF
Peter Zimmerer - Evolve Design For Testability To The Next Level - EuroSTAR 2012
Embedded world 2017
Test Automation NYC 2014
Agile Software Testing the Agilogy Way
The Future of Automation Testing Emerging Trends and Technologies
Keynote VST2020 (Workshop on Validation, Analysis and Evolution of Software ...
2020 Testing Trends: Top Predictions for QA Teams to Watch, Join, and Lead
DevTest Portfolio Overview
Vishal_Final_Evaluation_PPT
The Next Wave of Software Testing_ Trends Shaping 2025.pdf
Hardening
Future of Software Testing and What are the Trends to follow in 2023.pdf
Software Testing 1198102207476437 4
Software Testing
Software Testing Trends in 2023
Automated testing-whitepaper
Service Virtualization: What Testers Need to Know
Context Driven Automation Gtac 2008
The Evolution of Software Testing_ Trends and Innovations.pdf
Peter Zimmerer - Evolve Design For Testability To The Next Level - EuroSTAR 2012

More from Bob Binder (18)

PDF
Achieving Very High Reliability for Ubiquitous Information Technology
PDF
The Tester’s Dashboard: Release Decision Support
PDF
Performance Testing Mobile and Multi-Tier Applications
PDF
Testing Object-Oriented Systems: Lessons Learned
PDF
mVerify Investor Overview
PDF
MDD and the Tautology Problem: Discussion Notes.
PDF
Mobile Reliability Challenges
PDF
Experience with a Profile-based Automated Testing Environment
PDF
Testability: Factors and Strategy
PDF
Test Objects -- They Just Work
PDF
A Million Users in a Box: The WTS Story
PDF
ISSRE 2008 Trip Report
PDF
Software Test Patterns: Successes and Challenges
PDF
Assurance for Cloud Computing
PDF
The Advanced Mobile Application Testing Environment: Project Report
PDF
Software Testing: Models, Patterns, Tools
PPTX
The Tester’s Dashboard: Release Decision Support
PPTX
Testability: Factors and Strategy
Achieving Very High Reliability for Ubiquitous Information Technology
The Tester’s Dashboard: Release Decision Support
Performance Testing Mobile and Multi-Tier Applications
Testing Object-Oriented Systems: Lessons Learned
mVerify Investor Overview
MDD and the Tautology Problem: Discussion Notes.
Mobile Reliability Challenges
Experience with a Profile-based Automated Testing Environment
Testability: Factors and Strategy
Test Objects -- They Just Work
A Million Users in a Box: The WTS Story
ISSRE 2008 Trip Report
Software Test Patterns: Successes and Challenges
Assurance for Cloud Computing
The Advanced Mobile Application Testing Environment: Project Report
Software Testing: Models, Patterns, Tools
The Tester’s Dashboard: Release Decision Support
Testability: Factors and Strategy

Recently uploaded (20)

PPTX
CHAPTER 2 - PM Management and IT Context
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PDF
Understanding Forklifts - TECH EHS Solution
PPTX
Operating system designcfffgfgggggggvggggggggg
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PDF
System and Network Administration Chapter 2
PDF
Digital Strategies for Manufacturing Companies
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PPTX
history of c programming in notes for students .pptx
PPTX
Reimagine Home Health with the Power of Agentic AI​
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PPTX
assetexplorer- product-overview - presentation
PPT
Introduction Database Management System for Course Database
PDF
medical staffing services at VALiNTRY
PPTX
Introduction to Artificial Intelligence
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
CHAPTER 2 - PM Management and IT Context
2025 Textile ERP Trends: SAP, Odoo & Oracle
Understanding Forklifts - TECH EHS Solution
Operating system designcfffgfgggggggvggggggggg
Design an Analysis of Algorithms II-SECS-1021-03
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
Navsoft: AI-Powered Business Solutions & Custom Software Development
System and Network Administration Chapter 2
Digital Strategies for Manufacturing Companies
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
history of c programming in notes for students .pptx
Reimagine Home Health with the Power of Agentic AI​
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
VVF-Customer-Presentation2025-Ver1.9.pptx
assetexplorer- product-overview - presentation
Introduction Database Management System for Course Database
medical staffing services at VALiNTRY
Introduction to Artificial Intelligence
How to Choose the Right IT Partner for Your Business in Malaysia
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx

How to Release Rock-solid RESTful APIs and Ice the Testing BackBlob

  • 1. 20140918 System Verification Associates © 2014 1 How to Release Rock-solid RESTful APIs and Ice the Testing BackBlob Unicom Next Generation Testing Conference Chicago, September 18, 2014 Robert V. Binder SystemVerification Associates Enabling High Assurance http://sysverif.com
  • 2. 20140918 System Verification Associates © 2014 2 Overview • Background • Advanced API Verification • Dataflow Testing Model • Model-based Testing Demo • The Testing Twofer • Q&A
  • 3. 20140918 System Verification Associates © 2014 3 Discovery Analysis Design Verification Support BACKGROUND
  • 4. 20140918 System Verification Associates © 2014 4 You are here … Browser HTTP Client HTTP Server App HTTP Client App SOAP Client HTTP Client Files HTTP Server Service SOAP Server Service SOAP Server Files SOAP API REST API
  • 5. 20140918 System Verification Associates © 2014 5 Programmable Web’s Growing Roster
  • 6. 20140918 System Verification Associates © 2014 6 Google Trends: REST and SOAP 100 News Headline Occurrence, Monthly SOAP API REST API
  • 7. 20140918 System Verification Associates © 2014 7 So many APIs, so little time … Why is this happening?
  • 8. 20140918 System Verification Associates © 2014 8 Challenges • Usability • Narrow developer focus • Poor documentation • Revenue prevention • Assurance Fragmentation • Functionality • Security • Performance • Low reliability • Ineffective testing • Manual UI interaction • Developer-centric, hand- coded unit testing • Wheel spinning • High QA expense • Low quality All-aspect approach needed
  • 9. 20140918 System Verification Associates © 2014 9 Discovery Analysis Design Verification Support ADVANCED API VERIFICATION
  • 10. 20140918 System Verification Associates © 2014 10 Discovery Sprint • Survey and catalog • API documentation • Open and closed issues • Social media views • Codebase • Usage logs • Results • Strategy • Test environment spec • Report card Discovery Analysis Design Verification Support
  • 11. 20140918 System Verification Associates © 2014 11 Analysis Sprint • Workflow • Construct usage profile • Scrutinize documentation • Abstract data model • Results • Doc issues • Gap analysis • Revised strategy Discovery Analysis Design Verification Support
  • 12. 20140918 System Verification Associates © 2014 12 Design Sprint • Workflow • Configure virtual lab • Behavior/data models • Traffic capture/parsers • Instantiate adapters • Results • Stable test environment • All-aspect test model • Revised strategy Discovery Analysis Design Verification Support
  • 13. 20140918 System Verification Associates © 2014 13 Verification Sprint • Workflow • Model checking • Generate/run test suites • Collect traffic logs • Analyze coverage • Results • All test artifacts • Test coverage report • Final report • Briefing Discovery Analysis Design Verification Support
  • 14. 20140918 System Verification Associates © 2014 14 Support • As needed • Incremental design review • Usage monitoring • CI and regression testing • Results • Continuity • Protect investment • Continuous improvement Discovery Analysis Design Verification Support
  • 15. 20140918 System Verification Associates © 2014 15 Discovery Analysis Design Verification Support DATAFLOW TESTING MODEL
  • 16. 20140918 System Verification Associates © 2014 16 System Under Test Service Browser HTTP Client HTTP Server App SOAP Client SOAP Server HTTP Client Files Service HTTP Server SOAP Server Files App HTTP Client REST API
  • 17. 20140918 System Verification Associates © 2014 17 Test Configuration Service App HTTP Server HTTP Client Service HTTP Server Generated Test Code Test Model REST API
  • 18. 20140918 System Verification Associates © 2014 18 REST = Methods + Resources + Parameters Service App HTTP ServerHTTP Client HTTP Server Service HTTP methods: GET, PUT, POST, DELETE … HTTP resources (URI): http://foo.com/titles HTTP returned payload, JSON format: {"firstName": "Bob", "lastName": "Binder", "books": [ { "title": "Testing Object-oriented"}, { "title": "Application Debugging"} ] } Status Code: 200, 201, 400, 404 /?au=binder
  • 19. 20140918 System Verification Associates © 2014 19 REST Dataflow Model – Normal Paths alpha Defined Used Gone PUT/201 GET/200 PUT|POST/200 DELETE/200 DELETE/200PUT|POST/200 GET/200
  • 20. 20140918 System Verification Associates © 2014 20 REST Dataflow Model – Method Errors alpha Defined Used Gone DELETE|GET/404 DELETE|GET|PUT|POST/404
  • 21. 20140918 System Verification Associates © 2014 21 REST Dataflow Model – Parameter Errors alpha Defined Used Gone PUT|POST|GET|DELETE ?garbage/400 PUT|POST|GET|DELETE ?garbage/400
  • 22. 20140918 System Verification Associates © 2014 22 REST Dataflow Model alpha Defined Used Gone Test Pattern: Non-Modal Class
  • 23. 20140918 System Verification Associates © 2014 23 Input variation, all sequences • Nominal values • Boundary values • Operator mutants • Fuzzing, each/all • Domain model • Pairwise selection • Sequence randomization Sounds like a lot of work!
  • 24. 20140918 System Verification Associates © 2014 24 Model-based Testing • Model-based testing tool • Microsoft Research, 2001 • Test 500 MSFT APIs, 2007-12 • Robust and stable • Visual Studio “power tool” • C# code, not cartoons • Generates standalone executable test suite
  • 25. 20140918 System Verification Associates © 2014 25 Demo • Synthetic Client • Model Program • Coordination File • Test Cases SUT HostTest Host Test Suite HTTP Server Synthetic Client Pass/Fail Synthetic Client Interface Spex Rules Spex Cord Test Modeling Test Execution Service Under Test Explore/ Generate
  • 26. 20140918 System Verification Associates © 2014 26 Synthetic Client • The test model’s view of the SUT • Static class wrapper for HTTP client • Public methods correspond to SUT’s HTTP methods and resources • Manage server-side setup/cleanup • Message serialize/deserialize • Becomes part of the executable test code assembly • Example is a stub!
  • 27. 20140918 System Verification Associates © 2014 27 Model Program • [Rule] • Determines when an action is called • Selects argument values for the action call • Computes expected results • Updates its model state as needed • Simulates environment and/or system under test
  • 28. 20140918 System Verification Associates © 2014 28 Cord File • Defines all model actions • action = Synthetic Client public method • machine • Any action sequence • Similar to regex • May use other machines • Model any use case, scenario, slice, etc. • Many options
  • 29. 20140918 System Verification Associates © 2014 29 What is Exploration? • Find all action sequences and data bindings that model program Rules and a machine allow • Search loop • Select a rule for a machine action • If enabling condition true: • Update model program state • Return expected results • Stop when all selected inputs used or size limit exceeded
  • 30. 20140918 System Verification Associates © 2014 30 Machine Exploration • Shows all possible action sequences for a machine • No data bindings • Note similarity to normal path dataflow
  • 31. 20140918 System Verification Associates © 2014 31 Model Program Exploration • Rules + machine • Rules add data bindings, expected results • Many ways to choose data values
  • 32. 20140918 System Verification Associates © 2014 32 Test Cases from an Exploration • Spex chooses exploration steps that end in accepting state • Covers all states and steps at least once
  • 33. 20140918 System Verification Associates © 2014 33 Generate Test Code • Standalone code – does not require model • Run from VS Test Explorer or command line
  • 34. 20140918 System Verification Associates © 2014 34 SUT HostTest Host Test Suite HTTP Server Synthetic Client Pass/Fail Synthetic Client Interface Spex Rules Spex Cord Test Modeling Test Execution Service Under Test Explore/ Generate
  • 35. 20140918 System Verification Associates © 2014 35 Test Strategy • Each resource path • Interleave all DUG variants • Accepting sequence • Wrong sequence • Pairwise combination • Parameters (path and value) • Mutants, nominal, edge • Security • Interleave Fuzz cases • Abuse case model • All other HTTP methods • Performance • Virtual users/test drivers • Randomize combos
  • 36. 20140918 System Verification Associates © 2014 36 Discovery Analysis Design Verification Support THE TESTING TWOFER
  • 37. 20140918 System Verification Associates © 2014 37 The Testing BackBlob Total Number of Test Cases Sprint 1 Available Test Time Manual Test Cases not executed Automated Test Cases not maintained Total Developed Test Cases Sprint 2 Sprint 3 Sprint 4
  • 38. 20140918 System Verification Associates © 2014 38 The Attack of the Testing BackBlob Coming soon … to a scrum near you
  • 39. 20140918 System Verification Associates © 2014 39 Test Asset Size Model Test Code Adapters Model-based Testing Behavior Driven Development
  • 40. 20140918 System Verification Associates © 2014 40 Test Asset Maintenance Load Model Test Code Adapters Model-based Testing Behavior Driven Development
  • 41. 20140918 System Verification Associates © 2014 41 The Testing Twofer Rock Solid APIs • Documentation Scrutiny • Fact-based Evaluation • Multi-dimensional testing • Dataflow coverage • Everything wrong at least once • Fuzzing • Repeat at scale Icing the BackBlob • Develop/maintain model • Regenerate test suites
  • 42. 20140918 System Verification Associates © 2014 42 Q & A [email protected] #MoreModelsLessTests http://sysverif.com
  • 43. 20140918 System Verification Associates © 2014 43 Discovery Analysis Design Verification Support ETC. Say what you do, do what you say
  • 44. 20140918 System Verification Associates © 2014 44 Robert V. Binder Robert Binder is a high-assurance entrepreneur. He has developed hundreds of application systems and advanced automated testing solutions. As test process architect for Microsoft’s Open Protocol Initiative, he lead the application of model-based testing to all of Microsoft’s server-side APIs. He is the author of the definitive Testing Object-Oriented Systems: Models, Patterns, and Tools and two other books. He holds a US patent for model-based testing of mobile systems. • MS, EECS, University of Illinois at Chicago • MBA, University of Chicago • BA, University of Chicago
  • 45. 20140918 System Verification Associates © 2014 45 System Verification Associates Enabling High Assurance • Chicago- based consulting boutique • Clients are typically software development organizations for whom system failure is not an option. • We assist clients in achieving high reliability and effectiveness in their IT processes and systems. • Founded in 2009 and led by Robert V. Binder • http://sysverif.com • Advanced API Verification Datasheet • Supported Microsoft’s Open Protocols project with a team of experts; Robert Binder served process architect, leading the technical work of over 300 staff located in Redmond, China, India, and Argentina. • Assessed and improved software process at several FDA-regulated product companies, balancing quality management system compliance and Agile practices. • Developed model-based testing solutions for high- frequency trading and aerospace applications. • Helped software service and product companies articulate unique high-value messaging for innovative services. • Conducted and published the Model-based Testing User Survey of 2012 and 2014 (forthcoming.)
  • 46. 20140918 System Verification Associates © 2014 46 Does My API Suck?  Your documentation is incomplete, wrong, misleading, or just plain incomprehensible.  Users complain that coding simple use cases is just too much hassle.  Users often rely on workarounds—they FTP files instead of using your API’s getFile.  Your API is unbalanced or incomplete—you can turn something on, but not off.  Your API’s service crashes or responds with garbage when messages are out of order or contain invalid data.  Version mismatches have unpredictable results.  No one is really sure what will happen with edge cases and they don’t want to know.  Your API allows your service to be hacked with common attack vectors.  Your service supports several protocols (REST, SOAP,…) or formats (JSON, XML,…), but behavior and data isn’t consistent  Your API doesn’t provide useful feedback— good and bad input all get the same response.  Your service is so awesome that it draws traffic spikes, but then your server chokes and dies. Buggy APIs are eating the world