Skip to content

Commit

Permalink
docs(course): add preliminary table of content
Browse files Browse the repository at this point in the history
  • Loading branch information
symbiont-stevan-andjelkovic committed Feb 2, 2022
1 parent 1a613cd commit 547934c
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 0 deletions.
51 changes: 51 additions & 0 deletions doc/advanced-testing-mini-course/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
## Advanced property-based testing mini-course

### Table of content

0. Assume familiarity with Haskell and QuickCheck
1. State machine testing
- Coverage
- Metrics
- References?
2. Consumer-driven contract tests using state machines
3. Concurrent state machine testing with linearisability
4. Fault-injection
5. Simulation testing

### Simulation testing

```haskell
data Network = Network
{ deploy :: Addr -> IO Server -- bind and listen
, connect :: Addr -> IO Client
, send :: [(Client, Msg)] -> IO ()
, select :: [Server] -> IO (Addr, Msg, Time) -- accept and recv
}

eventLoop :: Network -> [(Addr, StateMachine)] -> IO ()
eventLoop nw nodes = do
servers <- mapM (deploy nw) (map fst nodes)
let env = nodes `zip` initialStates
go env
where
go env = do
(receiver, msg, time) <- select servers
(outgoing, env') <- step env receiver msg time
send nw outgoing
go env'

fakeSend :: Heap -> Addr -> Msg -> (Heap, ())
fakeSend heap addr msg = do
t <- genArrivalTime
(enqueue (addr, msg, t) heap, ())

newFakeNetwork :: IO Network
newFakeNetwork = do
heap <- newIORef emptyHeap
let send = do
h <- readIORef heap
let (h', ()) = fakeSend h
writeIORef heap h'
...
return Network {..}
```
4 changes: 4 additions & 0 deletions doc/demo-journal/slides-journal.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ nocite: |
* Counters
* Histograms

# Design of the event loop

* TODO

# Demo

* The first version uses SQLite to persist the application log, all reads and
Expand Down

0 comments on commit 547934c

Please sign in to comment.