rc::check("addition is commutative",
[](int a, int b) {
RC_ASSERT(a + b == b + a);
});
```
> ๐ Frameworks auto-generate random inputs โ let the fuzzer find edge cases!
---
### ๐งช Test Strategies Comparison
.mermaid[
graph TD
A["๐งช Test Strategies"] --> B["๐ Round-trip"]
A --> C["๐ Property-based"]
B --> B1["Encode/Decode"]
B --> B2["Transform/Inverse"]
B --> B3["Add/Subtract"]
C --> C1["Algebraic Laws"]
C --> C2["Geometric Invariants"]
C --> C3["Graph Constraints"]
style A fill:#ebcb8b,stroke:#4c566a,color:#2e3440
style B fill:#88c0d0,stroke:#4c566a,color:#2e3440
style C fill:#a3be8c,stroke:#4c566a,color:#2e3440
style B1 fill:#88c0d0,stroke:#4c566a,color:#2e3440
style B2 fill:#88c0d0,stroke:#4c566a,color:#2e3440
style B3 fill:#88c0d0,stroke:#4c566a,color:#2e3440
style C1 fill:#a3be8c,stroke:#4c566a,color:#2e3440
style C2 fill:#a3be8c,stroke:#4c566a,color:#2e3440
style C3 fill:#a3be8c,stroke:#4c566a,color:#2e3440
]
---
### ๐ฏ Putting It All Together
.mermaid[
graph LR
A["๐ค AI Code"] --> B["๐ Review"]
B --> C["๐งช Write Tests"]
C --> D["๐ Round-trip"]
C --> E["๐ Properties"]
D --> F{"โ
Pass?"}
E --> F
F -- "Yes โ
" --> G["โ
Accept"]
F -- "No โ" --> H["๐ง Fix"]
H --> A
style A fill:#88c0d0,stroke:#4c566a,color:#2e3440
style B fill:#81a1c1,stroke:#4c566a,color:#2e3440
style C fill:#ebcb8b,stroke:#4c566a,color:#2e3440
style D fill:#a3be8c,stroke:#4c566a,color:#2e3440
style E fill:#a3be8c,stroke:#4c566a,color:#2e3440
style F fill:#d08770,stroke:#4c566a,color:#2e3440
style G fill:#a3be8c,stroke:#4c566a,color:#2e3440
style H fill:#bf616a,stroke:#4c566a,color:#2e3440
]
.center[
> ๐ก๏ธ Not 100% guarantee โ but useful for AI.
]
---
count: false
class: nord-dark, middle, center
# Questions? ๐ฌ