Request for tutorial: How to test complicated stateful systems
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Documentation
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- haskell
- Domain
- documentation, testing
Research direction
Start with the linked Reddit discussion, John Hughes' paper, and accompanying talk. Develop a tutorial that explains model state, sequences of domain API calls, and how to pass state through QuickCheck, using the requested CRUD API and reservation examples. Done means runnable examples answer the issue's three questions without requiring readers to infer the missing approach.
Written by the indexing model from the issue text.
Description
Discussion at Reddit: https://www.reddit.com/r/haskell/comments/5jatdg/how_to_use_quickcheck_for_stateful_testing/
I've been looking for examples of how to use Quick Check for "regular" stateful testing, where one would essentially do the following - generate a known input case, call a series of domain APIs, and finally assert the expected system state.
For example, how would one use Quick Check for testing a CRUD JSON API? Or, say a reservation system's domain API, which allows overbooking only if the admin is making the overbooking request?
Even after reading John Hughes' paper on using Quickcheck to test a circular buffer and testing at Volvo & Karla and viewing the accompanying talk I have the following confusion:
- John Hughes' paper has a comment that QuickCheck needs two separate descriptions of the expected behaviour; bugs will be identified in areas where these descriptions don't agree with each other. And the circular queue example also talk about a state model inside the test itself. Does this mean we have to build two systems - the actual one and the one in the test (the simplified model)?
- Do you know if complete QuickCheck tests for the circular buffer example have have shared somewhere? I'd like to go through them to understand how it's possible to build a simplified "state model" without actually rewriting a circular buffer in the test itself.
- How does one pass around the test state (model state) in Haskell's Quickcheck? It's not obvious from the Hackage docs.
- Dominant language
- Haskell
- Stars
- 790
- Forks
- 130
- Avg merge
- 16h 41m
- Merged PRs (30d)
- 2
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from nick8325/quickcheck
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
nick8325/quickcheck#481 · 8 comments · 1 reaction ·
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
nick8325/quickcheck#475 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
nick8325/quickcheck#469 · 2 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
nick8325/quickcheck#463 · 2 comments ·
-
Clean up NonEmpty Open
Difficulty 2/5 1-3 hours Newbie friendliness 48/100
nick8325/quickcheck#457 · 1 comment ·
All issues in nick8325/quickcheck
Similar issues
-
time-manager-0.4.0 Openfailure: bounds
Difficulty 1/5 Under an hour Newbie friendliness 72/100
commercialhaskell/stackage#8122 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
simplex-chat/simplex-chat#7547 ·
-
chore
Difficulty 1/5 Under an hour Newbie friendliness 90/100
alunduil/alunduil-chezmoi#775 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
objectionary/phino#1350 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100