Breaking Your Code in New and Exciting Ways
summary
Property-based testing with FsCheck on .NET generates surprising failing inputs (found a counterexample after 12 tries and shrunk it 3 times) that break a naive regex-based templater; control characters, nulls and keys with asterisks produce invalid RegexExceptions. The demo builds C# and F# generators: a tagless string generator and a constrained IDictionary generator that enforces valid identifier rules, then produces paired input/output cases so rendering is tested against expected outputs — generators catch real bugs and then are hardened to make the tests pass.
AI-written summary · about
chapters (9)
- 0:00Start
- 1:02Property Based Testing
- 5:56Templating Library
- 9:38Submit Error Handling
- 10:21Discriminated Union
- 13:51Invariant Property
- 37:53String Shrinker
- 40:56Override the Default Generators of Existing Types
- 48:39Type Aliases
related talks
27mAn introduction to property based testing
26mThe missing piece of testing
47mProperty-Based Testing
51mProperty-Based Testing
45mProperty based tests for the masses
59m.NET Testing Techniques You Didn’t Know You Needed
32mGenerative Testing: Properties, State and Beyond
20mUnlock The Power Of Property-Based Testing
