Overview
Syllabus
Intro
Why concurrent code in particular?
Tools to improve confidence
A good model is a tool for thinking
What is "model checking"?
Two popular model checkers
Outline of this talk
Here's a spec for a sort algorithm
What is your confidence in the design of this sort algorith
Some approaches to gain confidence • Careful inspection and code review
A concurrent producer/consumer system
A spec for a producer/consumer system Given a bounded queue of items And 1 producer, i consumer running concurrently
What is your confidence in the design of this producerlconsume 28.6%
What is your confidence in the design of this producer consumer
How to gain confidence for concurrency?
Boolean Logic
States and transitions for a chess game
States and transitions for deliveries
Actions are not assignments. Actions are tests
Count to three, refactored
Updated "Count to three"
What is the difference between these two systems!
"Count to three" with stuttering
Useful properties to check
Properties for "count to three" In TLA
Adding properties to the script
If we run the model checker, how many of these proper
Who forgot about stuttering?
How to fix? Refactor #1: change the spec to merge init/next
The complete spec with fairness
Modeling a Producer/Consumer system
States for a Producer
States for a Consumer
Complete TLA* script (2/2)
And if we run this script?
TLA plus... Set theory
Fixing the error
Using TLA* as a tool to improve design
Modeling a zero-downtime deployment
Stop and check
Temporal properties
Running the script
Adding another condition New rule! All online servers must be running the same version
Taught by
NDC Conferences