SlideShare a Scribd company logo
Improving design and
code quality
with Property-based testing
Software Consultant - EventStormer
Domain Driven Design
Behaviour Driven Development
Test Driven Development
Continuous Delivery
@kenny_baas
baasie.com
@joaoasrosa
joaorosa.io
The greatest obstacle to discovery is not ignorance -
it is the illusion of knowledge.
- Daniel J. Boorstin
Confirmation Bias
blue yellow yellow red green purple blue blue green purple yellow
red green yellow purple blue red yellow green red blue purple
yellow purple red blue purple blue green yellow red red purple
green yellow blue blue yellow green red purple yellow blue green
red purple yellow red blue green purple green red yellow purple
blue purple green red blue yellow yellow red green purple blue blue
green purple yellow red green yellow purple blue red yellow green
red blue purple yellow purple red blue green red purple yellow blue
green red purple yellow red blue green purple green red yellow
purple blue purple green red blue yellow yellow red green purple
blue blue green purple yellow red green yellow purple blue red
yellow green red blue purple yellow purple red blue green red
purple yellow blue green red purple yellow red blue green purple
green red yellow purple blue purple green red blue yellow yellow
To communicate effectively, the code must be based on the
same language used to write the requirements
- the same language that the developers speak
with each other and with domain experts
- Eric Evans
Dave Farley - Continuous Delivery
Feedback
Quickly
Timely
Reliable
Customer
Releasing software is too often an art;
it should be an engineering discipline
- Dave Farley
Single abstraction examples (aka Unit tests)
● Learning from mistakes
instead of only confirming
● Fast feedback on new demands
instead of slow changes
● Living documentation on
behaviour instead of on data
Human CI
● Always run tests locally before commiting
● Once the code is committed, wait for the result of commited build
○ Don’t go home, to lunch, to a meeting, to make coffee
● If a teammate has gone home, lunch…. revert their changes!
● Fix or revert within 10 minutes
● When there are failures, Pair or Mob and learn together
Dave Farley - Continuous Delivery
Software Development is
a learning process, working code is a
side effect
- Alberto Brandolini
Benefits
● Covers (eventually) the scope of all data points,
forget about data
● Shrinker looks for a small use case
● Reproducible tests
Next thing -> Fuzzing invalid inputs in System Tests
Summary
● (Also) Write tests with the
intention of breaking code
● Forget about data, focus on behaviour!
● Quickly, Timely, Reliable Feedback
● Human CI
● Ohh… Have we mentioned
Domain Driven Design?
C#
https://github.com/joaoasrosa/techorama-nl-property-based-testing
Java
https://gitlab.com/Baasie/Property-Based-Testing
#CatTax

More Related Content

Similar to Improving design and code quality with Property-based testing

14 Habits of Great SQL Developers
14 Habits of Great SQL Developers14 Habits of Great SQL Developers
14 Habits of Great SQL Developers
Ike Ellis
 
2013 09-11 java zone - extreme programming live
2013 09-11 java zone - extreme programming live2013 09-11 java zone - extreme programming live
2013 09-11 java zone - extreme programming live
Johannes Brodwall
 
Softskills Software Testers
Softskills Software TestersSoftskills Software Testers
Softskills Software Testers
Daniel Knott
 
top developer mistakes
top developer mistakes top developer mistakes
top developer mistakes
Hanokh Aloni
 
Play to Learn: Agile Games with Cards and Dice
Play to Learn: Agile Games with Cards and DicePlay to Learn: Agile Games with Cards and Dice
Play to Learn: Agile Games with Cards and Dice
Mike Clement
 
Debugging SEO - Language & Breaking Down
Debugging SEO - Language & Breaking DownDebugging SEO - Language & Breaking Down
Debugging SEO - Language & Breaking Down
Dominic Woodman
 
Omar Salah Resume
Omar Salah Resume Omar Salah Resume
Omar Salah Resume
Omar Salah
 
Agile Methodologies And Extreme Programming - Svetlin Nakov
Agile Methodologies And Extreme Programming - Svetlin NakovAgile Methodologies And Extreme Programming - Svetlin Nakov
Agile Methodologies And Extreme Programming - Svetlin Nakov
Svetlin Nakov
 
Code reviews
Code reviewsCode reviews
Code reviews
Robert Lee
 
Rillavoice Product Specs (1).pptx
Rillavoice Product Specs (1).pptxRillavoice Product Specs (1).pptx
Rillavoice Product Specs (1).pptx
ccnpswicth
 
Agile Methodologies And Extreme Programming
Agile Methodologies And Extreme ProgrammingAgile Methodologies And Extreme Programming
Agile Methodologies And Extreme Programming
Utkarsh Khare
 
How to produce great multilingual content, even when you can't read it | Laur...
How to produce great multilingual content, even when you can't read it | Laur...How to produce great multilingual content, even when you can't read it | Laur...
How to produce great multilingual content, even when you can't read it | Laur...
Oban International
 
Arch factory - Agile Design: Best Practices
Arch factory - Agile Design: Best PracticesArch factory - Agile Design: Best Practices
Arch factory - Agile Design: Best Practices
Igor Moochnick
 
OSMC 2015 | Testing in Production by Devdas Bhagat
OSMC 2015 | Testing in Production by Devdas BhagatOSMC 2015 | Testing in Production by Devdas Bhagat
OSMC 2015 | Testing in Production by Devdas Bhagat
NETWAYS
 
OSMC 2015: Testing in Production by Devdas Bhagat
OSMC 2015: Testing in Production by Devdas BhagatOSMC 2015: Testing in Production by Devdas Bhagat
OSMC 2015: Testing in Production by Devdas Bhagat
NETWAYS
 
Smartsourcing Software Development
Smartsourcing Software DevelopmentSmartsourcing Software Development
Smartsourcing Software Development
Gene Leybzon
 
Developers Best Practices
Developers Best PracticesDevelopers Best Practices
Developers Best Practices
aqib javaid
 
[HCMC STC Jan 2015] Developing an Offshore Context-Driven Testing Team
[HCMC STC Jan 2015] Developing an Offshore Context-Driven Testing Team[HCMC STC Jan 2015] Developing an Offshore Context-Driven Testing Team
[HCMC STC Jan 2015] Developing an Offshore Context-Driven Testing Team
Ho Chi Minh City Software Testing Club
 
Distributed drupal team not an option, but the reality
Distributed drupal team  not an option, but the realityDistributed drupal team  not an option, but the reality
Distributed drupal team not an option, but the reality
AnyforSoft
 
How to Internationalize Products by fmr Condé Nast Int. PM
How to Internationalize Products by fmr Condé Nast Int. PMHow to Internationalize Products by fmr Condé Nast Int. PM
How to Internationalize Products by fmr Condé Nast Int. PM
Product School
 

Similar to Improving design and code quality with Property-based testing (20)

14 Habits of Great SQL Developers
14 Habits of Great SQL Developers14 Habits of Great SQL Developers
14 Habits of Great SQL Developers
 
2013 09-11 java zone - extreme programming live
2013 09-11 java zone - extreme programming live2013 09-11 java zone - extreme programming live
2013 09-11 java zone - extreme programming live
 
Softskills Software Testers
Softskills Software TestersSoftskills Software Testers
Softskills Software Testers
 
top developer mistakes
top developer mistakes top developer mistakes
top developer mistakes
 
Play to Learn: Agile Games with Cards and Dice
Play to Learn: Agile Games with Cards and DicePlay to Learn: Agile Games with Cards and Dice
Play to Learn: Agile Games with Cards and Dice
 
Debugging SEO - Language & Breaking Down
Debugging SEO - Language & Breaking DownDebugging SEO - Language & Breaking Down
Debugging SEO - Language & Breaking Down
 
Omar Salah Resume
Omar Salah Resume Omar Salah Resume
Omar Salah Resume
 
Agile Methodologies And Extreme Programming - Svetlin Nakov
Agile Methodologies And Extreme Programming - Svetlin NakovAgile Methodologies And Extreme Programming - Svetlin Nakov
Agile Methodologies And Extreme Programming - Svetlin Nakov
 
Code reviews
Code reviewsCode reviews
Code reviews
 
Rillavoice Product Specs (1).pptx
Rillavoice Product Specs (1).pptxRillavoice Product Specs (1).pptx
Rillavoice Product Specs (1).pptx
 
Agile Methodologies And Extreme Programming
Agile Methodologies And Extreme ProgrammingAgile Methodologies And Extreme Programming
Agile Methodologies And Extreme Programming
 
How to produce great multilingual content, even when you can't read it | Laur...
How to produce great multilingual content, even when you can't read it | Laur...How to produce great multilingual content, even when you can't read it | Laur...
How to produce great multilingual content, even when you can't read it | Laur...
 
Arch factory - Agile Design: Best Practices
Arch factory - Agile Design: Best PracticesArch factory - Agile Design: Best Practices
Arch factory - Agile Design: Best Practices
 
OSMC 2015 | Testing in Production by Devdas Bhagat
OSMC 2015 | Testing in Production by Devdas BhagatOSMC 2015 | Testing in Production by Devdas Bhagat
OSMC 2015 | Testing in Production by Devdas Bhagat
 
OSMC 2015: Testing in Production by Devdas Bhagat
OSMC 2015: Testing in Production by Devdas BhagatOSMC 2015: Testing in Production by Devdas Bhagat
OSMC 2015: Testing in Production by Devdas Bhagat
 
Smartsourcing Software Development
Smartsourcing Software DevelopmentSmartsourcing Software Development
Smartsourcing Software Development
 
Developers Best Practices
Developers Best PracticesDevelopers Best Practices
Developers Best Practices
 
[HCMC STC Jan 2015] Developing an Offshore Context-Driven Testing Team
[HCMC STC Jan 2015] Developing an Offshore Context-Driven Testing Team[HCMC STC Jan 2015] Developing an Offshore Context-Driven Testing Team
[HCMC STC Jan 2015] Developing an Offshore Context-Driven Testing Team
 
Distributed drupal team not an option, but the reality
Distributed drupal team  not an option, but the realityDistributed drupal team  not an option, but the reality
Distributed drupal team not an option, but the reality
 
How to Internationalize Products by fmr Condé Nast Int. PM
How to Internationalize Products by fmr Condé Nast Int. PMHow to Internationalize Products by fmr Condé Nast Int. PM
How to Internationalize Products by fmr Condé Nast Int. PM
 

Recently uploaded

A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
Aftab Hussain
 
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
kalichargn70th171
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
Remote DBA Services
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
Peter Muessig
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
Green Software Development
 
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise EditionWhy Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Envertis Software Solutions
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
mz5nrf0n
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
rodomar2
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
Deuglo Infosystem Pvt Ltd
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
Aftab Hussain
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
timtebeek1
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
Rakesh Kumar R
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata
 
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
Green Software Development
 
SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024
Hironori Washizaki
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
Rakesh Kumar R
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
Google
 
DDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systemsDDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systems
Gerardo Pardo-Castellote
 
SMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API ServiceSMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API Service
Yara Milbes
 

Recently uploaded (20)

A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
 
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
 
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise EditionWhy Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
 
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
 
SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
 
DDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systemsDDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systems
 
SMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API ServiceSMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API Service
 

Improving design and code quality with Property-based testing

  • 1. Improving design and code quality with Property-based testing
  • 2. Software Consultant - EventStormer Domain Driven Design Behaviour Driven Development Test Driven Development Continuous Delivery @kenny_baas baasie.com @joaoasrosa joaorosa.io
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12. The greatest obstacle to discovery is not ignorance - it is the illusion of knowledge. - Daniel J. Boorstin
  • 13.
  • 15.
  • 16.
  • 17. blue yellow yellow red green purple blue blue green purple yellow red green yellow purple blue red yellow green red blue purple yellow purple red blue purple blue green yellow red red purple green yellow blue blue yellow green red purple yellow blue green red purple yellow red blue green purple green red yellow purple blue purple green red blue yellow yellow red green purple blue blue green purple yellow red green yellow purple blue red yellow green red blue purple yellow purple red blue green red purple yellow blue green red purple yellow red blue green purple green red yellow purple blue purple green red blue yellow yellow red green purple blue blue green purple yellow red green yellow purple blue red yellow green red blue purple yellow purple red blue green red purple yellow blue green red purple yellow red blue green purple green red yellow purple blue purple green red blue yellow yellow
  • 18. To communicate effectively, the code must be based on the same language used to write the requirements - the same language that the developers speak with each other and with domain experts - Eric Evans
  • 19.
  • 20. Dave Farley - Continuous Delivery Feedback Quickly Timely Reliable Customer
  • 21. Releasing software is too often an art; it should be an engineering discipline - Dave Farley
  • 22.
  • 23. Single abstraction examples (aka Unit tests) ● Learning from mistakes instead of only confirming ● Fast feedback on new demands instead of slow changes ● Living documentation on behaviour instead of on data
  • 24.
  • 25.
  • 26.
  • 27.
  • 28. Human CI ● Always run tests locally before commiting ● Once the code is committed, wait for the result of commited build ○ Don’t go home, to lunch, to a meeting, to make coffee ● If a teammate has gone home, lunch…. revert their changes! ● Fix or revert within 10 minutes ● When there are failures, Pair or Mob and learn together Dave Farley - Continuous Delivery
  • 29. Software Development is a learning process, working code is a side effect - Alberto Brandolini
  • 30. Benefits ● Covers (eventually) the scope of all data points, forget about data ● Shrinker looks for a small use case ● Reproducible tests Next thing -> Fuzzing invalid inputs in System Tests
  • 31. Summary ● (Also) Write tests with the intention of breaking code ● Forget about data, focus on behaviour! ● Quickly, Timely, Reliable Feedback ● Human CI ● Ohh… Have we mentioned Domain Driven Design?