Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Simulation Tests for API Based Systems
Search
Shafeeq Kunnakkadan
January 13, 2018
Programming
110
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Simulation Tests for API Based Systems
Presented at IN/Clojure 2018
Shafeeq Kunnakkadan
January 13, 2018
Other Decks in Programming
See All in Programming
Rでドレミ/Do-Re-Mi_with_R
florets1
0
130
すこし踏み込む CancellationToken
htkym
2
1.7k
C#の現在地 進化の歴史と、AI時代の.NET Everywhere
neuecc
5
5.2k
Findy - エンジニア向け会社紹介/Findy Company Deck
findyinc
6
400k
golang-bob.pdf
iwatsukayura
0
130
AIで開発が速くなった先で、開発チームは何を目指すか
shihochan
0
1.4k
KiroのSpecで「五目並べ」を作ってみる
satoshi256kbyte
1
380
Verilogで学ぶCPU自作入門
uyuki234
8
4.1k
contenteditable と日本語入力に向き合う
colorful12
0
200
HTML-in-Canvasで作る未来のWeb UI表現
clockmaker
5
5.1k
ハーネス設計入門 〜 基礎知識の整理から実務へのステップアップ 〜
kinopeee
28
32k
sbt 2.0: takeoff
eed3si9n
0
160
Featured
See All Featured
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
56
3.5k
Amusing Abliteration
ianozsvald
1
350
The Pragmatic Product Professional
lauravandoore
37
7.5k
AI: The stuff that nobody shows you
jnunemaker
PRO
10
1.2k
WENDY [Excerpt]
tessaabrams
14
40k
Designing for Timeless Needs
cassininazir
1
530
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
12k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.2k
Google's AI Overviews - The New Search
badams
0
1.6k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
4
4.4k
What the history of the web can teach us about the future of AI
inesmontani
PRO
2
740
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
570
Transcript
Simulation Tests for API Based Systems Shafeeq Kunnakkadan | nilenso
None
Agenda • Problem statement • About generative testing and Prior
Art • Libraries and tools • Building the test suite
simulation sɪmjuːˈleɪʃ(ə)n imitation of a situation or process. the production
of a computer model of something, especially for the purpose of study.
System Under Test • API Based Payment System • Designed
to be distributed • Fast paced development • Slow (Manual) QA
Simple Checkout Store Smart PoS Shopper
Actual Checkout
n x Checkouts
Problem • Simulate all possible flows in a checkout process
• Automate creation, execution, and reporting of tests • Run simulations in parallel, catch concurrency bugs
None
None
types of testing • Example Based Testing • Generative Testing
• Property Based Testing • Simulation Testing
Example Based Testing • Input, Execute, Output, Validate • Unit,
Functional, Integration
Example Based Testing
Example Based Testing • Limited coverage • Not scalable
Generative Testing • Generate Inputs for tests • Random •
Validate against properties
Property Based Testing • Properties of the system • Invariants
• Mathematical properties: Idempotence, Commutativity, Associativity etc
Simulation Testing • System model • Random • Simulate the
user
Prior Art
QuickCheck John Hughes - Testing the Hard Stuff and Staying
Sane
QuickCheck John Hughes - Testing the Hard Stuff and Staying
Sane
test.check Gary Fredericks - Building test check Generators https://github.com/clojure/test.check
Simulant Michael Nygard - Simulation Testing https://github.com/Datomic/simulant
Libraries and Tools
Tools • Clojure • Schema • test.check • Datascript, datalog
None
test.check
None
None
None
None
Building the Test Suite
Stages
Generation: Params • From schema • Test.check generators • Input
Constraints
Generation: Flow • Flow • Flow constraints • Idempotent operations
(immediate, distant)
None
None
None
None
None
Execution • Action multimethods • Stateful Params • Known exceptions
• Continue?
Assertion • Properties • CRUD • All ok? • State
transitions
None
None
State machines make for great properties.
Reporting & Diagnostics • Assertion reports • Check points
Caveats
None
Conclusion • Use Simulation Tests • Properties are hard: State
machine to the rescue • Grow your tests with minimal cost
Simulation Tests for API Based Systems Shafeeq Kunnakkadan | nilenso
@shafeeq_k Icons from the Noun Project: Shop by Chanut is Industries; POS by Ben Davis; Shopper by H Alberto Gongora