SlideShare a Scribd company logo
1 of 30
TDD & S.O.L.I.D.Two ingredients for high-quality software Dennis Doomen dennis.doomen@avivasolutions.nl
About Me Principal Consultant at Aviva Solutions 35 years 6-month daughter 12 years of experience C++ origins On .NET since 2001
Agenda About quality Test Driven Development & S.O.L.I.D Demos & examples Guidelines to get started
What is quality? Or, how do you measure it?“I don't care howgoodyouthinkyour design is. If I can't walk in and write a test foranarbitrarymethod of yours in fiveminutes, itsnot as good as youthinkit is, and whetheryouknowitornot, you'repaying a pricefor it.”Michael Feathers, ObjectMentor
How? Use coding guidelines Apply common design principles Test Driven Development Refactoring Use Design Patterns Pair Programming Socialize design & architecture
Test Driven Development Is a design process Tests are your first users Tests can be your documentation If TDD hurts then you're doing it wrong
S.O.L.I.D. Single ResponsiblityPrinciple Open ClosedPrinciple LiskovSubstitutionPrinciple Interface SeggregationPrinciple DependencyInversionPrinciple
Demo Attendee registration TDDSingle Reponsibility Principle Dependency Inversion Principle
What you have seen TDD Arrange-Act-Assert Red-Green-Refactor Mocking Intention revealing tests Single Responsibility Principle Dependency Inversion Principles
Phases of unit testing Refusing Getting too excited Testing everything! Integration testing Discover mocking Mocking everything Becoming effective
Example Types of attendees Open Closed Principle Dependency Inversion Principle
Naive Solution
Better Solution
Best Solution
What you have seen Open Closed Principle Single Responsibility Principle Dependency Inversion Principle Chain of Responsibility Pattern Factory Method Pattern
Example Billing Liskov Substitution Principle
Naive Solution
Better Solution new EmployeeBuilder().Build() ??
Best Solution
What you have seen Liskov Substition Principle Single Responsibility Principle
Example Event listening Interface seggregation
Naive Solution
Better Solution
Best Solution
What you have seen Interface Seggregation
Getting started guidelines Test should be Small and focused Intention revealing Repeatable Have no side-effects Independent Test what you know now (and assemble the rest from those pieces)
Getting started guidelines Mocking Don't mock chatty interfaces Don't have more than 2-3 mocks per test Only mock your nearest neigbors Keep your tail short Isolate the ugly stuff Conform to SOLID (and other principles)
Resources xUnit Patternshttp://xunitpatterns.com/ Applying Domain Driven Design and Design Patternshttp://www.amazon.com/Applying-Domain-Driven-Design-Patterns-Examples/dp/0321268202 Jeremy D. Millerhttp://codebetter.com/blogs/jeremy.miller/default.aspxhttp://msdn.microsoft.com/en-us/magazine/cc720886.aspx InfoQ Recommended TDD Tutorialshttp://www.infoq.com/news/2009/05/recommended-tdd-tutorials Los Techies S.O.L.I.D. Principles E-Bookhttp://www.lostechies.com/content/pablo_ebook.aspx C# 3.0 Coding Guidelineshttp://blog.avivasolutions.nl/archive/2009/03/06/new-coding-guidelines-for-c-3-0.aspx
Q&A Emaildennis.doomen@avivasolutions.nl Blogwww.dennisdoomen.net Twitterwww.twitter.com/dennisdoomen
TDD and S.O.L.I.D.; Two Ingredients For High Quality Software

More Related Content

What's hot

Website optimization through quality experimentation (2)
Website optimization through quality experimentation (2)Website optimization through quality experimentation (2)
Website optimization through quality experimentation (2)wcto2017
 
Design Sprint - Dian Sigit Prastowo
Design Sprint - Dian Sigit PrastowoDesign Sprint - Dian Sigit Prastowo
Design Sprint - Dian Sigit PrastowoDian Sigit Prastowo
 
The Design Process
The Design Process The Design Process
The Design Process 14605
 
A letter to my past self (a career perspective) :: Sinf FEUP 2020
A letter to my past self (a career perspective) :: Sinf FEUP 2020A letter to my past self (a career perspective) :: Sinf FEUP 2020
A letter to my past self (a career perspective) :: Sinf FEUP 2020Pedro Gustavo Torres
 
Understanding Engineering Challenges without a Tech Background
 Understanding Engineering Challenges without a Tech Background Understanding Engineering Challenges without a Tech Background
Understanding Engineering Challenges without a Tech BackgroundProduct School
 
Pair programming 2 > 1 + 1
Pair programming  2 > 1 + 1Pair programming  2 > 1 + 1
Pair programming 2 > 1 + 1Neha Batra
 
Transforming lives-with-teaching
Transforming lives-with-teachingTransforming lives-with-teaching
Transforming lives-with-teachingRafiq Gemmail
 
Developer Recruiting – Best Practices from WeAreDevelopers
Developer Recruiting – Best Practices from WeAreDevelopersDeveloper Recruiting – Best Practices from WeAreDevelopers
Developer Recruiting – Best Practices from WeAreDevelopersBenjamin Ruschin
 
Rapid Elearning - The Real Story
Rapid Elearning - The Real StoryRapid Elearning - The Real Story
Rapid Elearning - The Real StorySteve Rayson
 
Design Sprint Workshop @UMN SKYSTAR VENTURE
Design Sprint Workshop @UMN SKYSTAR VENTUREDesign Sprint Workshop @UMN SKYSTAR VENTURE
Design Sprint Workshop @UMN SKYSTAR VENTURECipta Pratama
 
DWS15 - Game Summit - Three Gates - Don Geyer
DWS15 - Game Summit - Three Gates - Don GeyerDWS15 - Game Summit - Three Gates - Don Geyer
DWS15 - Game Summit - Three Gates - Don GeyerIDATE DigiWorld
 
How do you know your Solution will make an Impact? - Björn Brynjar Jonsson
How do you know your Solution will make an Impact? - Björn Brynjar JonssonHow do you know your Solution will make an Impact? - Björn Brynjar Jonsson
How do you know your Solution will make an Impact? - Björn Brynjar JonssonJAXLondon2014
 
Product Managers: How To Get Your Developers To Love You
Product Managers: How To Get Your Developers To Love YouProduct Managers: How To Get Your Developers To Love You
Product Managers: How To Get Your Developers To Love YouProduct School
 
Create foolproof research plans with risk vs. effort mapping
Create foolproof research plans with risk vs. effort mappingCreate foolproof research plans with risk vs. effort mapping
Create foolproof research plans with risk vs. effort mappingKea Zhang
 
What Are the Road Mapping Essentials by former Capital One PM
What Are the Road Mapping Essentials by former Capital One PMWhat Are the Road Mapping Essentials by former Capital One PM
What Are the Road Mapping Essentials by former Capital One PMProduct School
 
Agile is still dead :: Portugal - Brasil 2020 (Café com Rey)
Agile is still dead :: Portugal - Brasil 2020 (Café com Rey)Agile is still dead :: Portugal - Brasil 2020 (Café com Rey)
Agile is still dead :: Portugal - Brasil 2020 (Café com Rey)Pedro Gustavo Torres
 
How Agile Are You Really?
How Agile Are You Really?How Agile Are You Really?
How Agile Are You Really?Karoliina Luoto
 
Staying research led with almost no resources (UXcamp 2019)
Staying research led with almost no resources (UXcamp 2019)Staying research led with almost no resources (UXcamp 2019)
Staying research led with almost no resources (UXcamp 2019)Kea Zhang
 
Pragmatic guide to AB testing - Agile and Automation days 2019
Pragmatic guide to AB testing - Agile and Automation days 2019Pragmatic guide to AB testing - Agile and Automation days 2019
Pragmatic guide to AB testing - Agile and Automation days 2019Jakub Kurcek
 

What's hot (19)

Website optimization through quality experimentation (2)
Website optimization through quality experimentation (2)Website optimization through quality experimentation (2)
Website optimization through quality experimentation (2)
 
Design Sprint - Dian Sigit Prastowo
Design Sprint - Dian Sigit PrastowoDesign Sprint - Dian Sigit Prastowo
Design Sprint - Dian Sigit Prastowo
 
The Design Process
The Design Process The Design Process
The Design Process
 
A letter to my past self (a career perspective) :: Sinf FEUP 2020
A letter to my past self (a career perspective) :: Sinf FEUP 2020A letter to my past self (a career perspective) :: Sinf FEUP 2020
A letter to my past self (a career perspective) :: Sinf FEUP 2020
 
Understanding Engineering Challenges without a Tech Background
 Understanding Engineering Challenges without a Tech Background Understanding Engineering Challenges without a Tech Background
Understanding Engineering Challenges without a Tech Background
 
Pair programming 2 > 1 + 1
Pair programming  2 > 1 + 1Pair programming  2 > 1 + 1
Pair programming 2 > 1 + 1
 
Transforming lives-with-teaching
Transforming lives-with-teachingTransforming lives-with-teaching
Transforming lives-with-teaching
 
Developer Recruiting – Best Practices from WeAreDevelopers
Developer Recruiting – Best Practices from WeAreDevelopersDeveloper Recruiting – Best Practices from WeAreDevelopers
Developer Recruiting – Best Practices from WeAreDevelopers
 
Rapid Elearning - The Real Story
Rapid Elearning - The Real StoryRapid Elearning - The Real Story
Rapid Elearning - The Real Story
 
Design Sprint Workshop @UMN SKYSTAR VENTURE
Design Sprint Workshop @UMN SKYSTAR VENTUREDesign Sprint Workshop @UMN SKYSTAR VENTURE
Design Sprint Workshop @UMN SKYSTAR VENTURE
 
DWS15 - Game Summit - Three Gates - Don Geyer
DWS15 - Game Summit - Three Gates - Don GeyerDWS15 - Game Summit - Three Gates - Don Geyer
DWS15 - Game Summit - Three Gates - Don Geyer
 
How do you know your Solution will make an Impact? - Björn Brynjar Jonsson
How do you know your Solution will make an Impact? - Björn Brynjar JonssonHow do you know your Solution will make an Impact? - Björn Brynjar Jonsson
How do you know your Solution will make an Impact? - Björn Brynjar Jonsson
 
Product Managers: How To Get Your Developers To Love You
Product Managers: How To Get Your Developers To Love YouProduct Managers: How To Get Your Developers To Love You
Product Managers: How To Get Your Developers To Love You
 
Create foolproof research plans with risk vs. effort mapping
Create foolproof research plans with risk vs. effort mappingCreate foolproof research plans with risk vs. effort mapping
Create foolproof research plans with risk vs. effort mapping
 
What Are the Road Mapping Essentials by former Capital One PM
What Are the Road Mapping Essentials by former Capital One PMWhat Are the Road Mapping Essentials by former Capital One PM
What Are the Road Mapping Essentials by former Capital One PM
 
Agile is still dead :: Portugal - Brasil 2020 (Café com Rey)
Agile is still dead :: Portugal - Brasil 2020 (Café com Rey)Agile is still dead :: Portugal - Brasil 2020 (Café com Rey)
Agile is still dead :: Portugal - Brasil 2020 (Café com Rey)
 
How Agile Are You Really?
How Agile Are You Really?How Agile Are You Really?
How Agile Are You Really?
 
Staying research led with almost no resources (UXcamp 2019)
Staying research led with almost no resources (UXcamp 2019)Staying research led with almost no resources (UXcamp 2019)
Staying research led with almost no resources (UXcamp 2019)
 
Pragmatic guide to AB testing - Agile and Automation days 2019
Pragmatic guide to AB testing - Agile and Automation days 2019Pragmatic guide to AB testing - Agile and Automation days 2019
Pragmatic guide to AB testing - Agile and Automation days 2019
 

Similar to TDD and S.O.L.I.D.; Two Ingredients For High Quality Software

The ten commandments of TDD
The ten commandments of TDDThe ten commandments of TDD
The ten commandments of TDDHernan Wilkinson
 
ЯНА КАНІБОЛОЦЬКА «You are Software Tester. What’s next?» Online QADay 2023
ЯНА КАНІБОЛОЦЬКА «You are Software Tester. What’s next?»  Online QADay 2023ЯНА КАНІБОЛОЦЬКА «You are Software Tester. What’s next?»  Online QADay 2023
ЯНА КАНІБОЛОЦЬКА «You are Software Tester. What’s next?» Online QADay 2023GoQA
 
Pairing w developers_stpconpics
Pairing w developers_stpconpicsPairing w developers_stpconpics
Pairing w developers_stpconpicsLanette Creamer
 
My Laws of Test Driven Development (2023)
My Laws of Test Driven Development (2023)My Laws of Test Driven Development (2023)
My Laws of Test Driven Development (2023)Dennis Doomen
 
Introduction to Test Driven Development
Introduction to Test Driven DevelopmentIntroduction to Test Driven Development
Introduction to Test Driven DevelopmentMichael Denomy
 
Situational leadership Workshop at Agile2010 Conference
Situational leadership Workshop at Agile2010 ConferenceSituational leadership Workshop at Agile2010 Conference
Situational leadership Workshop at Agile2010 ConferenceDave Neuman
 
How to Build your Career.pptx
How to Build your Career.pptxHow to Build your Career.pptx
How to Build your Career.pptxvaideheekore
 
Qa mock up interview for manual testing
Qa mock up interview for manual testingQa mock up interview for manual testing
Qa mock up interview for manual testingKadharBashaJ
 
Agile Team Performance Appraisal
Agile Team Performance AppraisalAgile Team Performance Appraisal
Agile Team Performance AppraisalAshutosh Rai
 
Case studies of Test Driven Development
Case studies of Test Driven DevelopmentCase studies of Test Driven Development
Case studies of Test Driven DevelopmentSimform
 
How I Hire Developers
How I Hire DevelopersHow I Hire Developers
How I Hire DevelopersTristan Gomez
 
Pavel Kamyshov —​ "Team Health Check: refined edition".
Pavel Kamyshov —​ "Team Health Check: refined edition".Pavel Kamyshov —​ "Team Health Check: refined edition".
Pavel Kamyshov —​ "Team Health Check: refined edition".it-network
 
Agile Testing Agile Ottawa April 2015
Agile Testing   Agile Ottawa April 2015Agile Testing   Agile Ottawa April 2015
Agile Testing Agile Ottawa April 2015Dag Rowe
 
A Test Manifesto 2014.03.26
A Test Manifesto 2014.03.26A Test Manifesto 2014.03.26
A Test Manifesto 2014.03.26Julio Ramirez
 
pre-assess-report-2257253
pre-assess-report-2257253pre-assess-report-2257253
pre-assess-report-2257253Ayushi Sinha
 
Павло Камишов “Health check model: refined edition” Lviv Project Management Day
Павло Камишов “Health check model: refined edition” Lviv Project Management DayПавло Камишов “Health check model: refined edition” Lviv Project Management Day
Павло Камишов “Health check model: refined edition” Lviv Project Management DayLviv Startup Club
 
Software Test Engineering - A guide to becoming successful tester
Software Test Engineering - A guide to becoming successful testerSoftware Test Engineering - A guide to becoming successful tester
Software Test Engineering - A guide to becoming successful testerAsim Kazmi
 

Similar to TDD and S.O.L.I.D.; Two Ingredients For High Quality Software (20)

The ten commandments of TDD
The ten commandments of TDDThe ten commandments of TDD
The ten commandments of TDD
 
ЯНА КАНІБОЛОЦЬКА «You are Software Tester. What’s next?» Online QADay 2023
ЯНА КАНІБОЛОЦЬКА «You are Software Tester. What’s next?»  Online QADay 2023ЯНА КАНІБОЛОЦЬКА «You are Software Tester. What’s next?»  Online QADay 2023
ЯНА КАНІБОЛОЦЬКА «You are Software Tester. What’s next?» Online QADay 2023
 
Pairing w developers_stpconpics
Pairing w developers_stpconpicsPairing w developers_stpconpics
Pairing w developers_stpconpics
 
My Laws of Test Driven Development (2023)
My Laws of Test Driven Development (2023)My Laws of Test Driven Development (2023)
My Laws of Test Driven Development (2023)
 
Introduction to Test Driven Development
Introduction to Test Driven DevelopmentIntroduction to Test Driven Development
Introduction to Test Driven Development
 
Situational leadership Workshop at Agile2010 Conference
Situational leadership Workshop at Agile2010 ConferenceSituational leadership Workshop at Agile2010 Conference
Situational leadership Workshop at Agile2010 Conference
 
How to Build your Career.pptx
How to Build your Career.pptxHow to Build your Career.pptx
How to Build your Career.pptx
 
Qa mock up interview for manual testing
Qa mock up interview for manual testingQa mock up interview for manual testing
Qa mock up interview for manual testing
 
TDD in Agile
TDD in AgileTDD in Agile
TDD in Agile
 
Agile Team Performance Appraisal
Agile Team Performance AppraisalAgile Team Performance Appraisal
Agile Team Performance Appraisal
 
Software as a Service
Software as a ServiceSoftware as a Service
Software as a Service
 
Case studies of Test Driven Development
Case studies of Test Driven DevelopmentCase studies of Test Driven Development
Case studies of Test Driven Development
 
How I Hire Developers
How I Hire DevelopersHow I Hire Developers
How I Hire Developers
 
Pavel Kamyshov —​ "Team Health Check: refined edition".
Pavel Kamyshov —​ "Team Health Check: refined edition".Pavel Kamyshov —​ "Team Health Check: refined edition".
Pavel Kamyshov —​ "Team Health Check: refined edition".
 
Team health check new
Team health check newTeam health check new
Team health check new
 
Agile Testing Agile Ottawa April 2015
Agile Testing   Agile Ottawa April 2015Agile Testing   Agile Ottawa April 2015
Agile Testing Agile Ottawa April 2015
 
A Test Manifesto 2014.03.26
A Test Manifesto 2014.03.26A Test Manifesto 2014.03.26
A Test Manifesto 2014.03.26
 
pre-assess-report-2257253
pre-assess-report-2257253pre-assess-report-2257253
pre-assess-report-2257253
 
Павло Камишов “Health check model: refined edition” Lviv Project Management Day
Павло Камишов “Health check model: refined edition” Lviv Project Management DayПавло Камишов “Health check model: refined edition” Lviv Project Management Day
Павло Камишов “Health check model: refined edition” Lviv Project Management Day
 
Software Test Engineering - A guide to becoming successful tester
Software Test Engineering - A guide to becoming successful testerSoftware Test Engineering - A guide to becoming successful tester
Software Test Engineering - A guide to becoming successful tester
 

More from Dennis Doomen

Getting a grip on your code dependencies (2023-10)
Getting a grip on your code dependencies (2023-10)Getting a grip on your code dependencies (2023-10)
Getting a grip on your code dependencies (2023-10)Dennis Doomen
 
Tools and practices to help you deal with legacy code
Tools and practices to help you deal with legacy codeTools and practices to help you deal with legacy code
Tools and practices to help you deal with legacy codeDennis Doomen
 
What you can learn from an open-source project with 250 million downloads
What you can learn from an open-source project with 250 million downloadsWhat you can learn from an open-source project with 250 million downloads
What you can learn from an open-source project with 250 million downloadsDennis Doomen
 
Getting a grip on your code dependencies
Getting a grip on your code dependenciesGetting a grip on your code dependencies
Getting a grip on your code dependenciesDennis Doomen
 
Design patterns for Event Sourcing in .NET
Design patterns for Event Sourcing in .NETDesign patterns for Event Sourcing in .NET
Design patterns for Event Sourcing in .NETDennis Doomen
 
Automate Infrastructure with Pulumi and C#
Automate Infrastructure with Pulumi and C#Automate Infrastructure with Pulumi and C#
Automate Infrastructure with Pulumi and C#Dennis Doomen
 
What is the right unit in unit testing (UpdateConf 2022)
What is the right unit in unit testing (UpdateConf 2022)What is the right unit in unit testing (UpdateConf 2022)
What is the right unit in unit testing (UpdateConf 2022)Dennis Doomen
 
Slow Event Sourcing (re)projections - Just make them faster!
Slow Event Sourcing (re)projections - Just make them faster!Slow Event Sourcing (re)projections - Just make them faster!
Slow Event Sourcing (re)projections - Just make them faster!Dennis Doomen
 
50 things software teams should not do.pptx
50 things software teams should not do.pptx50 things software teams should not do.pptx
50 things software teams should not do.pptxDennis Doomen
 
What is the right "unit" in unit testing and why it is not a class?
What is the right "unit" in unit testing and why it is not a class?What is the right "unit" in unit testing and why it is not a class?
What is the right "unit" in unit testing and why it is not a class?Dennis Doomen
 
A lab around the principles and practices for writing maintainable code
A lab around the principles and practices for writing maintainable codeA lab around the principles and practices for writing maintainable code
A lab around the principles and practices for writing maintainable codeDennis Doomen
 
How to Practice TDD Without Shooting Yourself in the Foot
How to Practice TDD Without Shooting Yourself in the FootHow to Practice TDD Without Shooting Yourself in the Foot
How to Practice TDD Without Shooting Yourself in the FootDennis Doomen
 
Decomposing the Monolith using modern-day .NET and a touch of microservices
Decomposing the Monolith using modern-day .NET and a touch of microservicesDecomposing the Monolith using modern-day .NET and a touch of microservices
Decomposing the Monolith using modern-day .NET and a touch of microservicesDennis Doomen
 
Event Sourcing from the Trenches (DDD Europe 2020)
Event Sourcing from the Trenches (DDD Europe 2020)Event Sourcing from the Trenches (DDD Europe 2020)
Event Sourcing from the Trenches (DDD Europe 2020)Dennis Doomen
 
Practical introduction to DDD, CQRS and Event Sourcing
Practical introduction to DDD, CQRS and Event SourcingPractical introduction to DDD, CQRS and Event Sourcing
Practical introduction to DDD, CQRS and Event SourcingDennis Doomen
 
How to practice TDD without shooting yourself in the foot
How to practice TDD without shooting yourself in the footHow to practice TDD without shooting yourself in the foot
How to practice TDD without shooting yourself in the footDennis Doomen
 
Decomposing the Monolith (Riga Dev Days 2019)
Decomposing the Monolith (Riga Dev Days 2019)Decomposing the Monolith (Riga Dev Days 2019)
Decomposing the Monolith (Riga Dev Days 2019)Dennis Doomen
 
A lab around the principles and practices for writing maintainable code (2019)
A lab around the principles and practices for writing maintainable code (2019)A lab around the principles and practices for writing maintainable code (2019)
A lab around the principles and practices for writing maintainable code (2019)Dennis Doomen
 
Lessons learned from two decades of professional software development
Lessons learned from two decades of professional software developmentLessons learned from two decades of professional software development
Lessons learned from two decades of professional software developmentDennis Doomen
 
The Good, The Bad and The Ugly of Event Sourcing
The Good, The Bad and The Ugly of Event Sourcing The Good, The Bad and The Ugly of Event Sourcing
The Good, The Bad and The Ugly of Event Sourcing Dennis Doomen
 

More from Dennis Doomen (20)

Getting a grip on your code dependencies (2023-10)
Getting a grip on your code dependencies (2023-10)Getting a grip on your code dependencies (2023-10)
Getting a grip on your code dependencies (2023-10)
 
Tools and practices to help you deal with legacy code
Tools and practices to help you deal with legacy codeTools and practices to help you deal with legacy code
Tools and practices to help you deal with legacy code
 
What you can learn from an open-source project with 250 million downloads
What you can learn from an open-source project with 250 million downloadsWhat you can learn from an open-source project with 250 million downloads
What you can learn from an open-source project with 250 million downloads
 
Getting a grip on your code dependencies
Getting a grip on your code dependenciesGetting a grip on your code dependencies
Getting a grip on your code dependencies
 
Design patterns for Event Sourcing in .NET
Design patterns for Event Sourcing in .NETDesign patterns for Event Sourcing in .NET
Design patterns for Event Sourcing in .NET
 
Automate Infrastructure with Pulumi and C#
Automate Infrastructure with Pulumi and C#Automate Infrastructure with Pulumi and C#
Automate Infrastructure with Pulumi and C#
 
What is the right unit in unit testing (UpdateConf 2022)
What is the right unit in unit testing (UpdateConf 2022)What is the right unit in unit testing (UpdateConf 2022)
What is the right unit in unit testing (UpdateConf 2022)
 
Slow Event Sourcing (re)projections - Just make them faster!
Slow Event Sourcing (re)projections - Just make them faster!Slow Event Sourcing (re)projections - Just make them faster!
Slow Event Sourcing (re)projections - Just make them faster!
 
50 things software teams should not do.pptx
50 things software teams should not do.pptx50 things software teams should not do.pptx
50 things software teams should not do.pptx
 
What is the right "unit" in unit testing and why it is not a class?
What is the right "unit" in unit testing and why it is not a class?What is the right "unit" in unit testing and why it is not a class?
What is the right "unit" in unit testing and why it is not a class?
 
A lab around the principles and practices for writing maintainable code
A lab around the principles and practices for writing maintainable codeA lab around the principles and practices for writing maintainable code
A lab around the principles and practices for writing maintainable code
 
How to Practice TDD Without Shooting Yourself in the Foot
How to Practice TDD Without Shooting Yourself in the FootHow to Practice TDD Without Shooting Yourself in the Foot
How to Practice TDD Without Shooting Yourself in the Foot
 
Decomposing the Monolith using modern-day .NET and a touch of microservices
Decomposing the Monolith using modern-day .NET and a touch of microservicesDecomposing the Monolith using modern-day .NET and a touch of microservices
Decomposing the Monolith using modern-day .NET and a touch of microservices
 
Event Sourcing from the Trenches (DDD Europe 2020)
Event Sourcing from the Trenches (DDD Europe 2020)Event Sourcing from the Trenches (DDD Europe 2020)
Event Sourcing from the Trenches (DDD Europe 2020)
 
Practical introduction to DDD, CQRS and Event Sourcing
Practical introduction to DDD, CQRS and Event SourcingPractical introduction to DDD, CQRS and Event Sourcing
Practical introduction to DDD, CQRS and Event Sourcing
 
How to practice TDD without shooting yourself in the foot
How to practice TDD without shooting yourself in the footHow to practice TDD without shooting yourself in the foot
How to practice TDD without shooting yourself in the foot
 
Decomposing the Monolith (Riga Dev Days 2019)
Decomposing the Monolith (Riga Dev Days 2019)Decomposing the Monolith (Riga Dev Days 2019)
Decomposing the Monolith (Riga Dev Days 2019)
 
A lab around the principles and practices for writing maintainable code (2019)
A lab around the principles and practices for writing maintainable code (2019)A lab around the principles and practices for writing maintainable code (2019)
A lab around the principles and practices for writing maintainable code (2019)
 
Lessons learned from two decades of professional software development
Lessons learned from two decades of professional software developmentLessons learned from two decades of professional software development
Lessons learned from two decades of professional software development
 
The Good, The Bad and The Ugly of Event Sourcing
The Good, The Bad and The Ugly of Event Sourcing The Good, The Bad and The Ugly of Event Sourcing
The Good, The Bad and The Ugly of Event Sourcing
 

Recently uploaded

Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfjimielynbastida
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 

Recently uploaded (20)

Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdf
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 

TDD and S.O.L.I.D.; Two Ingredients For High Quality Software

  • 1. TDD & S.O.L.I.D.Two ingredients for high-quality software Dennis Doomen dennis.doomen@avivasolutions.nl
  • 2. About Me Principal Consultant at Aviva Solutions 35 years 6-month daughter 12 years of experience C++ origins On .NET since 2001
  • 3. Agenda About quality Test Driven Development & S.O.L.I.D Demos & examples Guidelines to get started
  • 4. What is quality? Or, how do you measure it?“I don't care howgoodyouthinkyour design is. If I can't walk in and write a test foranarbitrarymethod of yours in fiveminutes, itsnot as good as youthinkit is, and whetheryouknowitornot, you'repaying a pricefor it.”Michael Feathers, ObjectMentor
  • 5. How? Use coding guidelines Apply common design principles Test Driven Development Refactoring Use Design Patterns Pair Programming Socialize design & architecture
  • 6. Test Driven Development Is a design process Tests are your first users Tests can be your documentation If TDD hurts then you're doing it wrong
  • 7. S.O.L.I.D. Single ResponsiblityPrinciple Open ClosedPrinciple LiskovSubstitutionPrinciple Interface SeggregationPrinciple DependencyInversionPrinciple
  • 8. Demo Attendee registration TDDSingle Reponsibility Principle Dependency Inversion Principle
  • 9. What you have seen TDD Arrange-Act-Assert Red-Green-Refactor Mocking Intention revealing tests Single Responsibility Principle Dependency Inversion Principles
  • 10. Phases of unit testing Refusing Getting too excited Testing everything! Integration testing Discover mocking Mocking everything Becoming effective
  • 11. Example Types of attendees Open Closed Principle Dependency Inversion Principle
  • 15. What you have seen Open Closed Principle Single Responsibility Principle Dependency Inversion Principle Chain of Responsibility Pattern Factory Method Pattern
  • 16. Example Billing Liskov Substitution Principle
  • 18. Better Solution new EmployeeBuilder().Build() ??
  • 20. What you have seen Liskov Substition Principle Single Responsibility Principle
  • 21. Example Event listening Interface seggregation
  • 25. What you have seen Interface Seggregation
  • 26. Getting started guidelines Test should be Small and focused Intention revealing Repeatable Have no side-effects Independent Test what you know now (and assemble the rest from those pieces)
  • 27. Getting started guidelines Mocking Don't mock chatty interfaces Don't have more than 2-3 mocks per test Only mock your nearest neigbors Keep your tail short Isolate the ugly stuff Conform to SOLID (and other principles)
  • 28. Resources xUnit Patternshttp://xunitpatterns.com/ Applying Domain Driven Design and Design Patternshttp://www.amazon.com/Applying-Domain-Driven-Design-Patterns-Examples/dp/0321268202 Jeremy D. Millerhttp://codebetter.com/blogs/jeremy.miller/default.aspxhttp://msdn.microsoft.com/en-us/magazine/cc720886.aspx InfoQ Recommended TDD Tutorialshttp://www.infoq.com/news/2009/05/recommended-tdd-tutorials Los Techies S.O.L.I.D. Principles E-Bookhttp://www.lostechies.com/content/pablo_ebook.aspx C# 3.0 Coding Guidelineshttp://blog.avivasolutions.nl/archive/2009/03/06/new-coding-guidelines-for-c-3-0.aspx

Editor's Notes

  1. PROVIDE YOU SESSION CODE AND NAME AS IT WAS DEFINED BY AGENDA OWNERS.WELCOME ATTENDEES. INTRODUCE YOURSELF AND YOUR SESSION.
  2. PROVIDE 5 MIN BEFORE SESSION ENDS FOR Q&A.