This Java Testing Trick Finds Bugs | Property-Based Testing with jQwik
🛑 Are your JUnit tests giving you a false sense of security? You test the happy paths and a few edge cases you can think of, but what about the thousands you CAN'T? In this video, we level up from basic unit tests and dive deep into a technique that will change the way you think about code quality. 🌟️ *SUBSCRIBE* ➡️️ https://www.youtube.com/@cchacin?sub_confirmation=1 We'll take a realistic e-commerce Shopping Cart model in Java and show how traditional tests can miss critical, state-dependent bugs. Then, we'll unleash an army of automated testers using Property-Based Testing with the powerful jQwik library. You'll learn how to teach jQwik to generate your own custom domain objects, enabling it to validate complex business logic across your entire application. This isn't just theory—we'll write the code, find a real bug in our "perfect" logic, and fix it, leaving us with a system we can be truly confident in. 👩💻 *WHAT YOU'LL LEARN:* - The critical difference between Example-Based Testing (JUnit) and Property-Based Testing. - How to model a real-world system with multiple classes for testing. - The magic of "Arbitraries": Teaching jQwik to generate YOUR custom Java objects (Products, ShoppingCarts, etc.). - Using `@Provide`, `Combinators`, and `@UseType` to create powerful, reusable generators. - Writing a high-level property test that validates complex business rules. - How jQwik automatically finds the simplest failing case to make debugging a breeze. 📂 *RESOURCES:* - Official jQwik Documentation: https://jqwik.net/ 📺️ *VIDEOS TO WATCH NEXT:* !!!Unit Testing!!!: https://www.youtube.com/watch?v=gp689Jwc1Go&list=PLDzfPM08YCe7lHVWnxQPQV-TfPguOf6jL ⏳️ *TIMELINE:* 00:00 - Intro 00:10 - Property Testing 01:00 - Disclaimer 01:25 - jQwik 02:00 - Dependency 02:20 - The Example 03:00 - BigDecimal??? 03:25 - JUnit Tests 04:22 - 100% Code Coverage 06:30 - @Property 06:43 - Isolated Tests 07:21 - Dollars vs. Bolivares 07:40 - Centavos vs. Centimos 08:10 - The Beauty 09:45 - The Beast 10:20 - The Fix 13:30 - jQwik Arbitraties 17:50 - jQwik Assume 20:00 - Issue with Arbitraries 21:30 - Pros and Cons 22:55 - Trade-offs 24:00 - SEEDS 25:00 - Closing 🫂️ *BE MY FRIEND:* - Twitter 🐦️: https://twitter.com/CarlosChacin 🙆🏼️ *WHO AM I:* I'm Carlos, a Software Engineer looking to learn and share! ❤️️ #Java #SoftwareTesting #Programming #Coding #Developer #jQwik #PropertyTesting #PBT #PropertyBasedTesting
Download
0 formatsNo download links available.