Description
In this course, you will :
- Understand the PropEr concepts.
- Recognize the role of generators in property-based testing.
- Understand where property-based testing outperforms EUnit tests and vice versa.
- You should be able to use stateful properties without difficulty.
- Discover how to create State Machine Properties.
- Learn about property-based testing.
- cover some common frameworks, how to think in properties, how to write your own custom data generators, and other topics
- See how you can apply Property-Based Testing in a real-world project.
Syllabus :
1. Foundations of Property-Based Testing
- Why Property-based Testing?
- Properties
- Property-Based Testing in a Project
- Running a Property
2. Writing Properties
- File Structure
- Property Structure
- Execution Model
- Default Generators
- Putting It All Together
3. Thinking in Properties
- Modeling
- Generalizing Test Examples
- Invariants
- Symmetric Properties
- Putting It All Together
4. Custom Generators
- Gathering Statistics: Collecting
- Gathering Statistics: Aggregating
- Basic Custom Generators
- Resizing Generators
- Transforming Generators
- Imposing Restrictions
- Changing Probabilities
- Fancy Custom Generators
- Recursive Generators
- Symbolic Calls
5. Responsible Testing
- The Program Structure
- CSV Parsing: The Property
- CSV Parsing: The CSV Parser
- Filtering Records
- Employee Module
- Templating
6. Properties-Driven Development
- Writing the First Property
- Testing Specials
- Generating Specials
- Implementing Specials
- Negative Testing: Broad Properties
- Negative Testing: Calibrating Negative Properties
- Negative Testing: Relaxing Constraints
7. Shrinking
- Re-centering with ?SHRINK
- Dividing with ?LETSHRINK
8. Targeted Properties
- Targeted Properties
- Writing Neighbour Functions
- Example Case: Quicksort
- Limitations of Targeted Properties
9. Stateful Properties
- How Stateful Properties Run
- Writing Stateful Properties
- Testing a Basic Concurrent Cache: Implementation
- Testing a Basic Concurrent Cache: Writing Tests
- Testing Parallel Executions
10. Case Study: Bookstore
- The Application: Getting Started
- The Application: The Database Module
- The Application: Running the Code
- Writing Generators
- Broad Stateful Testing
- Precise Stateful Modelling
- Refining the Tests
- Debugging Stateful Properties
- Parallel Tests
11. State Machine Properties
- Laying Out State Machine Properties
- How State Machine Properties Run
- Writing FSM Properties
- Testing a Circuit Breaker
- Modeling the Circuit Breaker: The Shim Module
- Modeling the Circuit Breaker: The Property
- Modeling the Circuit Breaker: The Test Module
- Adjusting the Model: Fixing the Issue
- Adjusting the Model: Better Statistics