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 the concepts we need to feel comfortable using even the most advanced PropEr features with Elixir
- See how property-based testing can be used 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
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 let_shrink
8. 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
9. 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
10. 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