SlideShare ist ein Scribd-Unternehmen logo
Ahmed Misbah - September 2022
TDD Anti-patterns
2022 edition
TDD Anti-patterns
Agenda
• About the speaker

• What is TDD?

• The anti-patterns

• References
TDD Anti-patterns
Agenda
➡ About the speaker

• What is TDD?

• The anti-patterns

• References
About the speaker
Role and previous talks
• Chief Software Engineer and Architect

• Speaker at:

‣ Delta Technopreneurs

‣ DevOpsDays Cairo

‣ AMECSE

‣ Orange DevTest Days

‣ GDG

‣ JDC
About the speaker
Topics of interest
• DevOps

• Agile and Lean

• Cloud-Native Apps and beyond

• Software Architecture

• Java

• FOSS

• Arti
fi
cial Intelligence and ML
About the speaker
Experience
• 9 years at Orange Innovation Egypt

• Delivered two award winning innovative
solutions

• Worked at two startups

• Helped many others!

• Winner of Dell Hacktrick 2022 UI/UX track

• MSc. degree in ML and many other
professional certi
fi
cations
Nile University
J;.lll ~l:J.. Qtertifirate
(3/'~
This is to certify that
Ahmed Mahmoud Amir Misbah
••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
Has successfully completed the program of study
and fulfilled the requirements for
BigData & Data Science Diploma
for the period from October 2015 to July 2016
...f:.!.l...~'!!~~!.tf....El..#.!(!.~.1..
INF Program Director
~~.__QI II
C.a.::::a..;r:q;;; AU J M
IW fl ,
: ~t '-M4'
October 2016 ·
····························••-
•··············
Date
TDD Anti-patterns
Agenda
• About the speaker

➡ What is TDD?

• The anti-patterns

• References
Martin Fowler
“Test-Driven Development (TDD) is a technique for building software that
guides software development by writing tests. It was developed by Kent
Beck in the late 1990's as part of Extreme Programming. In essence you
follow three simple steps repeatedly:


• Write a test for the next bit of functionality you want to add.


• Write the functional code until the test passes.


• Refactor both new and old code to make it well structured.”
TDD Anti-patterns
Agenda
• About the speaker

• What is TDD?

➡ The anti-patterns

• References
TDD Anti-patterns
7 anti-patterns
1. No test list

2. No refactoring

3. No pair/mob programming

4. No particular school

5. No integration

6. No mutation testing

7. Practice + technology before theory
(1) No test list
Kent Beck
“Test-Driven Development By Example”, Chapter 25 - Test Driven Development
Patterns
“What should you test? Before you begin, write a list of all the
tests you know you will have to write. The first part of our
approach to dealing with programming stress is never to take
a step forward unless we know where our foot is going to
land. When we sit down to a programming session, what is it
we intend to accomplish?”
No test list
The true Red-Green-Refactor
• Invented by James Shore in 2005 (link)

• Steps:

1. Think: Figure out what test will best move
your code towards completion. (Take as
much time as you need. This is the hardest
step for beginners.)

2. Red

3. Green

4. Refactor

5. Repeat
“The Coding Dojo Handbook”, Section 3
No test list
How to write a test list?
• Pair/mob with testers

• Use test design techniques
Sample test list by Kent Beck
(2) No refactoring
Martin Fowler
“The most common way that I hear to screw up TDD is
neglecting the third step. Refactoring the code to keep it clean
is a key part of the process, otherwise you just end up with a
messy aggregation of code fragments. (At least these will
have tests, so it's a less painful result than most failures of
design.)”
Refactoring
What do we do in the refactor phase?
• It’s when you remove duplication - Kent Beck

• It’s when you sanitize the code smells - Martin
Fowler

• It’s when you apply patterns - Joshua Kerievsky
“TDD, Where Did it All Go Wrong” video
Refactoring
It’s all about design
• “There is no design phase in TDD. Using TDD, design is inverted and distributed”

• “TDD completely inverts the accepted ordering of ‘design-code-test'”

• “TDD just puts the design after the test and the code. Refactoring is pure design.”

“Test-Driven Development” eLearning Album - Industrial Logic
Code
Design Test Refactor
Code
Test
Design/
Refactor
(3) No pair / mob programming
No pair / mob programming
Issues with working solo in TDD
Learning curve (technologies, recommended
practices, etc.)

Knowledge sharing (technologies, recommended
practices, business, test list, etc.)

Collective ownership (of production code and tests)
(4) No particular school
No particular school
Di
ff
erent Architectures
“Domain-speci
fi
c Semantic Web-based Information Systems - Any Progress?” paper
No particular school
The schools of TDD
• Classicist (aka. Chicago or Detroit school of TDD):

‣ Inside-out

‣ Tests behavior

‣ No mocks

• Mockist (aka. London school of TDD)

‣ Outside-in

‣ Tests structure?

‣ Uses mocks
No particular school
Understand the schools
• A beginners explanation of the Chicago & London approaches

• London vs. Chicago

• Chicago TDD vs London TDD – Which one is should you use?

• London vs. Chicago by Robert (Bob) Martin and Sandro Mancuso
(5) No integration
No integration
Microtesting
• Invented by Mike (GeePaw) Hill in 2011 (link)

• The Four-Beat Cycle:

1. RED

2. GREEN

3. REFACTOR

4. INTEGRATE: We commit our changes,
including the new micro-test(s), to the
source vault.
(6) No mutation testing
Alex Bunardzic
“Two things surprised me a lot recently:


1. Number of experienced TDDers who told me they fail to see
value in Mutation testing


2. Number of experienced TDDers who told me they fail to see
value in TCR”
No mutation testing
Why Mutation Tests?
• Traditional test coverage (i.e., line,
statement, branch, etc.) measures only
which code is executed by your tests. It
does not check that your tests are able
to detect faults in the executed code. It is
therefore only able to identify code that is
not tested

• As it can detect whether each statement is
meaningfully tested, mutation testing is
the gold standard against which all other
types of coverage are measured
Source link
(7) Practice + technology before
theory
Ahmed Galal - Mobile UX session - 2012
“Experience = Knowledge (i.e., Theory) + Practice”
Practice + technology before theory
Experience, Theory and Practice
• Experience is often used interchangeably with practice.

• However, true experience is gained by both learning knowledge and theory
and applying it (i.e., practice)
W. Edwards Deming - “The New Economics for Industry, Government, Education” book
“Experience by itself teaches nothing... Without theory,
experience has no meaning. Without theory, one has no
questions to ask. Hence, without theory, there is no
learning.”
Practice + technology before theory
Knowledge then practice + technology
• Beginners start with courses that teach technologies without diving deep into
the theory and recommended practices

• Beginners should read:

- The three laws of TDD - “Clean Code” by Robert (Bob) C. Martin

- F.I.R.S.T properties - “Clean Code” by Robert (Bob) C. Martin

- Test Desiderata - Kent Beck

- TDD Manifesto
Thank you!
References
References
Book a free call to arrange a workshop
• Introduction to TDD

• Advanced topics in TDD

• TDD and refactoring workshop
Scan to book a free call

Weitere ähnliche Inhalte

Was ist angesagt?

How To Write A Test Case In Software Testing | Edureka
How To Write A Test Case In Software Testing | EdurekaHow To Write A Test Case In Software Testing | Edureka
How To Write A Test Case In Software Testing | Edureka
Edureka!
 
DevOps for beginners
DevOps for beginnersDevOps for beginners
DevOps for beginners
Pradeep Patel, PMP®
 
Embracing DevOps through database migrations with Flyway
Embracing DevOps through database migrations with FlywayEmbracing DevOps through database migrations with Flyway
Embracing DevOps through database migrations with Flyway
Red Gate Software
 
Software testing
Software testingSoftware testing
Software testing
Madhumita Chatterjee
 
Spring Boot Observability
Spring Boot ObservabilitySpring Boot Observability
Spring Boot Observability
VMware Tanzu
 
Software Evolution
Software EvolutionSoftware Evolution
Software Evolution
Md. Shafiuzzaman Hira
 
GraalVM Native and Spring Boot 3.0
GraalVM Native and Spring Boot 3.0GraalVM Native and Spring Boot 3.0
GraalVM Native and Spring Boot 3.0
MoritzHalbritter
 
Software Testing
Software TestingSoftware Testing
Software Testing
Mousmi Pawar
 
Testing types functional and nonfunctional - Kati Holasz
Testing types   functional and nonfunctional - Kati HolaszTesting types   functional and nonfunctional - Kati Holasz
Testing types functional and nonfunctional - Kati Holasz
Holasz Kati
 
CI CD Pipeline Using Jenkins | Continuous Integration and Deployment | DevOps...
CI CD Pipeline Using Jenkins | Continuous Integration and Deployment | DevOps...CI CD Pipeline Using Jenkins | Continuous Integration and Deployment | DevOps...
CI CD Pipeline Using Jenkins | Continuous Integration and Deployment | DevOps...
Edureka!
 
Clean architecture
Clean architectureClean architecture
Clean architecture
Lieven Doclo
 
Dynamic Object-Oriented Requirements System (DOORS)
Dynamic Object-Oriented Requirements System (DOORS)Dynamic Object-Oriented Requirements System (DOORS)
Dynamic Object-Oriented Requirements System (DOORS)
David Groff
 
Solid principles
Solid principlesSolid principles
Solid principles
Kumaresh Chandra Baruri
 
Exploratory Testing
Exploratory TestingExploratory Testing
Exploratory Testing
sriks7
 
Software design
Software designSoftware design
Software design
Benazir Fathima
 
Gray box testing
Gray box testingGray box testing
Gray box testing
Dasun Eranthika
 
Domain Driven Design (DDD)
Domain Driven Design (DDD)Domain Driven Design (DDD)
Domain Driven Design (DDD)
Tom Kocjan
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
Harsh Jegadeesan
 
Automating Your Way to Greatness by Combining OutSystems CI/CD with the Power...
Automating Your Way to Greatness by Combining OutSystems CI/CD with the Power...Automating Your Way to Greatness by Combining OutSystems CI/CD with the Power...
Automating Your Way to Greatness by Combining OutSystems CI/CD with the Power...
OutSystems
 
Test Cases Vs Test Scenarios
Test Cases Vs Test ScenariosTest Cases Vs Test Scenarios
Test Cases Vs Test Scenarios
Sneha Singh
 

Was ist angesagt? (20)

How To Write A Test Case In Software Testing | Edureka
How To Write A Test Case In Software Testing | EdurekaHow To Write A Test Case In Software Testing | Edureka
How To Write A Test Case In Software Testing | Edureka
 
DevOps for beginners
DevOps for beginnersDevOps for beginners
DevOps for beginners
 
Embracing DevOps through database migrations with Flyway
Embracing DevOps through database migrations with FlywayEmbracing DevOps through database migrations with Flyway
Embracing DevOps through database migrations with Flyway
 
Software testing
Software testingSoftware testing
Software testing
 
Spring Boot Observability
Spring Boot ObservabilitySpring Boot Observability
Spring Boot Observability
 
Software Evolution
Software EvolutionSoftware Evolution
Software Evolution
 
GraalVM Native and Spring Boot 3.0
GraalVM Native and Spring Boot 3.0GraalVM Native and Spring Boot 3.0
GraalVM Native and Spring Boot 3.0
 
Software Testing
Software TestingSoftware Testing
Software Testing
 
Testing types functional and nonfunctional - Kati Holasz
Testing types   functional and nonfunctional - Kati HolaszTesting types   functional and nonfunctional - Kati Holasz
Testing types functional and nonfunctional - Kati Holasz
 
CI CD Pipeline Using Jenkins | Continuous Integration and Deployment | DevOps...
CI CD Pipeline Using Jenkins | Continuous Integration and Deployment | DevOps...CI CD Pipeline Using Jenkins | Continuous Integration and Deployment | DevOps...
CI CD Pipeline Using Jenkins | Continuous Integration and Deployment | DevOps...
 
Clean architecture
Clean architectureClean architecture
Clean architecture
 
Dynamic Object-Oriented Requirements System (DOORS)
Dynamic Object-Oriented Requirements System (DOORS)Dynamic Object-Oriented Requirements System (DOORS)
Dynamic Object-Oriented Requirements System (DOORS)
 
Solid principles
Solid principlesSolid principles
Solid principles
 
Exploratory Testing
Exploratory TestingExploratory Testing
Exploratory Testing
 
Software design
Software designSoftware design
Software design
 
Gray box testing
Gray box testingGray box testing
Gray box testing
 
Domain Driven Design (DDD)
Domain Driven Design (DDD)Domain Driven Design (DDD)
Domain Driven Design (DDD)
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
 
Automating Your Way to Greatness by Combining OutSystems CI/CD with the Power...
Automating Your Way to Greatness by Combining OutSystems CI/CD with the Power...Automating Your Way to Greatness by Combining OutSystems CI/CD with the Power...
Automating Your Way to Greatness by Combining OutSystems CI/CD with the Power...
 
Test Cases Vs Test Scenarios
Test Cases Vs Test ScenariosTest Cases Vs Test Scenarios
Test Cases Vs Test Scenarios
 

Ähnlich wie TDD Anti-patterns (2022 edition)

TDD - Christchurch APN May 2012
TDD - Christchurch APN May 2012TDD - Christchurch APN May 2012
TDD - Christchurch APN May 2012
Alan Christensen
 
TDD in Agile
TDD in AgileTDD in Agile
TDD in Agile
Atish Narlawar
 
Joe Cisar - Everything I Know About TDD - Agile Midwest 2019
Joe Cisar - Everything I Know About TDD - Agile Midwest 2019Joe Cisar - Everything I Know About TDD - Agile Midwest 2019
Joe Cisar - Everything I Know About TDD - Agile Midwest 2019
Jason Tice
 
Introduction to TDD
Introduction to TDDIntroduction to TDD
Introduction to TDD
Ahmed Misbah
 
TDD - Seriously, try it! (updated '22)
TDD - Seriously, try it! (updated '22)TDD - Seriously, try it! (updated '22)
TDD - Seriously, try it! (updated '22)
Nacho Cougil
 
Introduction to Test Driven Development
Introduction to Test Driven DevelopmentIntroduction to Test Driven Development
Introduction to Test Driven Development
Siva Arunachalam
 
TDD - Seriously, try it! - Trójmiasto Java User Group (17th May '23)
TDD - Seriously, try it! - Trójmiasto Java User Group (17th May '23)TDD - Seriously, try it! - Trójmiasto Java User Group (17th May '23)
TDD - Seriously, try it! - Trójmiasto Java User Group (17th May '23)
ssusercaf6c1
 
TDD - Seriously, try it! - Trjjmiasto JUG (17th May '23)
TDD - Seriously, try it! - Trjjmiasto JUG (17th May '23)TDD - Seriously, try it! - Trjjmiasto JUG (17th May '23)
TDD - Seriously, try it! - Trjjmiasto JUG (17th May '23)
Nacho Cougil
 
Intro to TDD
Intro to TDDIntro to TDD
Intro to TDD
Jason Nocks
 
TDD - Seriously, try it! - Bucarest Tech Week
TDD - Seriously, try it! - Bucarest Tech WeekTDD - Seriously, try it! - Bucarest Tech Week
TDD - Seriously, try it! - Bucarest Tech Week
Nacho Cougil
 
It's XP, Stupid
It's XP, StupidIt's XP, Stupid
It's XP, Stupid
Mike Harris
 
TDD - Seriously, try it! - Opensouthcode
TDD - Seriously, try it! - OpensouthcodeTDD - Seriously, try it! - Opensouthcode
TDD - Seriously, try it! - Opensouthcode
Nacho Cougil
 
Mastering BDD - Eran Kinsbruner Workshop Quest 2018
Mastering BDD - Eran Kinsbruner Workshop Quest 2018Mastering BDD - Eran Kinsbruner Workshop Quest 2018
Mastering BDD - Eran Kinsbruner Workshop Quest 2018
Perfecto Mobile
 
Test-Driven Development in the Corporate Workplace
Test-Driven Development in the Corporate WorkplaceTest-Driven Development in the Corporate Workplace
Test-Driven Development in the Corporate Workplace
Ahmed Owian
 
Clean code - Getting your R&D on board
Clean code - Getting your R&D on boardClean code - Getting your R&D on board
Clean code - Getting your R&D on board
Ruth Sperer
 
Test driven development v1.0
Test driven development v1.0Test driven development v1.0
Test driven development v1.0
Ganesh Kondal
 
Understanding Why Testing is Importaint
Understanding Why Testing is ImportaintUnderstanding Why Testing is Importaint
Understanding Why Testing is Importaint
Sana Nasar
 
TDD - Seriously, try it - Codemotion (May '24)
TDD - Seriously, try it - Codemotion (May '24)TDD - Seriously, try it - Codemotion (May '24)
TDD - Seriously, try it - Codemotion (May '24)
Nacho Cougil
 
TDD and Related Techniques for Non Developers (2012)
TDD and Related Techniques for Non Developers (2012)TDD and Related Techniques for Non Developers (2012)
TDD and Related Techniques for Non Developers (2012)
Peter Kofler
 
Transferring Software Testing Tools to Practice
Transferring Software Testing Tools to PracticeTransferring Software Testing Tools to Practice
Transferring Software Testing Tools to Practice
Tao Xie
 

Ähnlich wie TDD Anti-patterns (2022 edition) (20)

TDD - Christchurch APN May 2012
TDD - Christchurch APN May 2012TDD - Christchurch APN May 2012
TDD - Christchurch APN May 2012
 
TDD in Agile
TDD in AgileTDD in Agile
TDD in Agile
 
Joe Cisar - Everything I Know About TDD - Agile Midwest 2019
Joe Cisar - Everything I Know About TDD - Agile Midwest 2019Joe Cisar - Everything I Know About TDD - Agile Midwest 2019
Joe Cisar - Everything I Know About TDD - Agile Midwest 2019
 
Introduction to TDD
Introduction to TDDIntroduction to TDD
Introduction to TDD
 
TDD - Seriously, try it! (updated '22)
TDD - Seriously, try it! (updated '22)TDD - Seriously, try it! (updated '22)
TDD - Seriously, try it! (updated '22)
 
Introduction to Test Driven Development
Introduction to Test Driven DevelopmentIntroduction to Test Driven Development
Introduction to Test Driven Development
 
TDD - Seriously, try it! - Trójmiasto Java User Group (17th May '23)
TDD - Seriously, try it! - Trójmiasto Java User Group (17th May '23)TDD - Seriously, try it! - Trójmiasto Java User Group (17th May '23)
TDD - Seriously, try it! - Trójmiasto Java User Group (17th May '23)
 
TDD - Seriously, try it! - Trjjmiasto JUG (17th May '23)
TDD - Seriously, try it! - Trjjmiasto JUG (17th May '23)TDD - Seriously, try it! - Trjjmiasto JUG (17th May '23)
TDD - Seriously, try it! - Trjjmiasto JUG (17th May '23)
 
Intro to TDD
Intro to TDDIntro to TDD
Intro to TDD
 
TDD - Seriously, try it! - Bucarest Tech Week
TDD - Seriously, try it! - Bucarest Tech WeekTDD - Seriously, try it! - Bucarest Tech Week
TDD - Seriously, try it! - Bucarest Tech Week
 
It's XP, Stupid
It's XP, StupidIt's XP, Stupid
It's XP, Stupid
 
TDD - Seriously, try it! - Opensouthcode
TDD - Seriously, try it! - OpensouthcodeTDD - Seriously, try it! - Opensouthcode
TDD - Seriously, try it! - Opensouthcode
 
Mastering BDD - Eran Kinsbruner Workshop Quest 2018
Mastering BDD - Eran Kinsbruner Workshop Quest 2018Mastering BDD - Eran Kinsbruner Workshop Quest 2018
Mastering BDD - Eran Kinsbruner Workshop Quest 2018
 
Test-Driven Development in the Corporate Workplace
Test-Driven Development in the Corporate WorkplaceTest-Driven Development in the Corporate Workplace
Test-Driven Development in the Corporate Workplace
 
Clean code - Getting your R&D on board
Clean code - Getting your R&D on boardClean code - Getting your R&D on board
Clean code - Getting your R&D on board
 
Test driven development v1.0
Test driven development v1.0Test driven development v1.0
Test driven development v1.0
 
Understanding Why Testing is Importaint
Understanding Why Testing is ImportaintUnderstanding Why Testing is Importaint
Understanding Why Testing is Importaint
 
TDD - Seriously, try it - Codemotion (May '24)
TDD - Seriously, try it - Codemotion (May '24)TDD - Seriously, try it - Codemotion (May '24)
TDD - Seriously, try it - Codemotion (May '24)
 
TDD and Related Techniques for Non Developers (2012)
TDD and Related Techniques for Non Developers (2012)TDD and Related Techniques for Non Developers (2012)
TDD and Related Techniques for Non Developers (2012)
 
Transferring Software Testing Tools to Practice
Transferring Software Testing Tools to PracticeTransferring Software Testing Tools to Practice
Transferring Software Testing Tools to Practice
 

Mehr von Ahmed Misbah

6+1 Technical Tips for Tech Startups (2023 Edition)
6+1 Technical Tips for Tech Startups (2023 Edition)6+1 Technical Tips for Tech Startups (2023 Edition)
6+1 Technical Tips for Tech Startups (2023 Edition)
Ahmed Misbah
 
Migrating to Microservices Patterns and Technologies (edition 2023)
 Migrating to Microservices Patterns and Technologies (edition 2023) Migrating to Microservices Patterns and Technologies (edition 2023)
Migrating to Microservices Patterns and Technologies (edition 2023)
Ahmed Misbah
 
Practical Microservice Architecture (edition 2022).pdf
Practical Microservice Architecture (edition 2022).pdfPractical Microservice Architecture (edition 2022).pdf
Practical Microservice Architecture (edition 2022).pdf
Ahmed Misbah
 
Istio as an enabler for migrating to microservices (edition 2022)
Istio as an enabler for migrating to microservices (edition 2022)Istio as an enabler for migrating to microservices (edition 2022)
Istio as an enabler for migrating to microservices (edition 2022)
Ahmed Misbah
 
DevOps for absolute beginners (2022 edition)
DevOps for absolute beginners (2022 edition)DevOps for absolute beginners (2022 edition)
DevOps for absolute beginners (2022 edition)
Ahmed Misbah
 
Implementing FaaS on Kubernetes using Kubeless
Implementing FaaS on Kubernetes using KubelessImplementing FaaS on Kubernetes using Kubeless
Implementing FaaS on Kubernetes using Kubeless
Ahmed Misbah
 
Istio as an Enabler for Migrating Monolithic Applications to Microservices v1.3
Istio as an Enabler for Migrating Monolithic Applications to Microservices v1.3Istio as an Enabler for Migrating Monolithic Applications to Microservices v1.3
Istio as an Enabler for Migrating Monolithic Applications to Microservices v1.3
Ahmed Misbah
 
Getting Started with DevOps
Getting Started with DevOpsGetting Started with DevOps
Getting Started with DevOps
Ahmed Misbah
 
DevOps for absolute beginners
DevOps for absolute beginnersDevOps for absolute beginners
DevOps for absolute beginners
Ahmed Misbah
 
Microservice test strategies for applications based on Spring, K8s and Istio
Microservice test strategies for applications based on Spring, K8s and IstioMicroservice test strategies for applications based on Spring, K8s and Istio
Microservice test strategies for applications based on Spring, K8s and Istio
Ahmed Misbah
 
Cucumber jvm best practices v3
Cucumber jvm best practices v3Cucumber jvm best practices v3
Cucumber jvm best practices v3
Ahmed Misbah
 
Welcome to the Professional World
Welcome to the Professional WorldWelcome to the Professional World
Welcome to the Professional World
Ahmed Misbah
 
More topics on Java
More topics on JavaMore topics on Java
More topics on Java
Ahmed Misbah
 
Career Paths for Software Professionals
Career Paths for Software ProfessionalsCareer Paths for Software Professionals
Career Paths for Software Professionals
Ahmed Misbah
 
Effective User Story Writing
Effective User Story WritingEffective User Story Writing
Effective User Story Writing
Ahmed Misbah
 
AndGen+
AndGen+AndGen+
AndGen+
Ahmed Misbah
 
DDT Testing Library for Android
DDT Testing Library for AndroidDDT Testing Library for Android
DDT Testing Library for Android
Ahmed Misbah
 
Big Data for QAs
Big Data for QAsBig Data for QAs
Big Data for QAs
Ahmed Misbah
 
Software Architecture
Software ArchitectureSoftware Architecture
Software Architecture
Ahmed Misbah
 
Software Design
Software DesignSoftware Design
Software Design
Ahmed Misbah
 

Mehr von Ahmed Misbah (20)

6+1 Technical Tips for Tech Startups (2023 Edition)
6+1 Technical Tips for Tech Startups (2023 Edition)6+1 Technical Tips for Tech Startups (2023 Edition)
6+1 Technical Tips for Tech Startups (2023 Edition)
 
Migrating to Microservices Patterns and Technologies (edition 2023)
 Migrating to Microservices Patterns and Technologies (edition 2023) Migrating to Microservices Patterns and Technologies (edition 2023)
Migrating to Microservices Patterns and Technologies (edition 2023)
 
Practical Microservice Architecture (edition 2022).pdf
Practical Microservice Architecture (edition 2022).pdfPractical Microservice Architecture (edition 2022).pdf
Practical Microservice Architecture (edition 2022).pdf
 
Istio as an enabler for migrating to microservices (edition 2022)
Istio as an enabler for migrating to microservices (edition 2022)Istio as an enabler for migrating to microservices (edition 2022)
Istio as an enabler for migrating to microservices (edition 2022)
 
DevOps for absolute beginners (2022 edition)
DevOps for absolute beginners (2022 edition)DevOps for absolute beginners (2022 edition)
DevOps for absolute beginners (2022 edition)
 
Implementing FaaS on Kubernetes using Kubeless
Implementing FaaS on Kubernetes using KubelessImplementing FaaS on Kubernetes using Kubeless
Implementing FaaS on Kubernetes using Kubeless
 
Istio as an Enabler for Migrating Monolithic Applications to Microservices v1.3
Istio as an Enabler for Migrating Monolithic Applications to Microservices v1.3Istio as an Enabler for Migrating Monolithic Applications to Microservices v1.3
Istio as an Enabler for Migrating Monolithic Applications to Microservices v1.3
 
Getting Started with DevOps
Getting Started with DevOpsGetting Started with DevOps
Getting Started with DevOps
 
DevOps for absolute beginners
DevOps for absolute beginnersDevOps for absolute beginners
DevOps for absolute beginners
 
Microservice test strategies for applications based on Spring, K8s and Istio
Microservice test strategies for applications based on Spring, K8s and IstioMicroservice test strategies for applications based on Spring, K8s and Istio
Microservice test strategies for applications based on Spring, K8s and Istio
 
Cucumber jvm best practices v3
Cucumber jvm best practices v3Cucumber jvm best practices v3
Cucumber jvm best practices v3
 
Welcome to the Professional World
Welcome to the Professional WorldWelcome to the Professional World
Welcome to the Professional World
 
More topics on Java
More topics on JavaMore topics on Java
More topics on Java
 
Career Paths for Software Professionals
Career Paths for Software ProfessionalsCareer Paths for Software Professionals
Career Paths for Software Professionals
 
Effective User Story Writing
Effective User Story WritingEffective User Story Writing
Effective User Story Writing
 
AndGen+
AndGen+AndGen+
AndGen+
 
DDT Testing Library for Android
DDT Testing Library for AndroidDDT Testing Library for Android
DDT Testing Library for Android
 
Big Data for QAs
Big Data for QAsBig Data for QAs
Big Data for QAs
 
Software Architecture
Software ArchitectureSoftware Architecture
Software Architecture
 
Software Design
Software DesignSoftware Design
Software Design
 

Kürzlich hochgeladen

Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
TheSMSPoint
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
Philip Schwarz
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
ICS
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Julian Hyde
 
zOS Mainframe JES2-JES3 JCL-JECL Differences
zOS Mainframe JES2-JES3 JCL-JECL DifferenceszOS Mainframe JES2-JES3 JCL-JECL Differences
zOS Mainframe JES2-JES3 JCL-JECL Differences
YousufSait3
 
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
 
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
XfilesPro
 
Malibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed RoundMalibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed Round
sjcobrien
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
SOCRadar
 
How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?
ToXSL Technologies
 
Oracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptxOracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptx
Remote DBA Services
 
All you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVMAll you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVM
Alina Yurenko
 
Top 9 Trends in Cybersecurity for 2024.pptx
Top 9 Trends in Cybersecurity for 2024.pptxTop 9 Trends in Cybersecurity for 2024.pptx
Top 9 Trends in Cybersecurity for 2024.pptx
devvsandy
 
Using Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query PerformanceUsing Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query Performance
Grant Fritchey
 
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian CompaniesE-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
Quickdice ERP
 
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
dakas1
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
mz5nrf0n
 
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
Bert Jan Schrijver
 
UI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design SystemUI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design System
Peter Muessig
 
316895207-SAP-Oil-and-Gas-Downstream-Training.pptx
316895207-SAP-Oil-and-Gas-Downstream-Training.pptx316895207-SAP-Oil-and-Gas-Downstream-Training.pptx
316895207-SAP-Oil-and-Gas-Downstream-Training.pptx
ssuserad3af4
 

Kürzlich hochgeladen (20)

Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
 
zOS Mainframe JES2-JES3 JCL-JECL Differences
zOS Mainframe JES2-JES3 JCL-JECL DifferenceszOS Mainframe JES2-JES3 JCL-JECL Differences
zOS Mainframe JES2-JES3 JCL-JECL Differences
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
 
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
 
Malibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed RoundMalibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed Round
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
 
How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?
 
Oracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptxOracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptx
 
All you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVMAll you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVM
 
Top 9 Trends in Cybersecurity for 2024.pptx
Top 9 Trends in Cybersecurity for 2024.pptxTop 9 Trends in Cybersecurity for 2024.pptx
Top 9 Trends in Cybersecurity for 2024.pptx
 
Using Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query PerformanceUsing Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query Performance
 
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian CompaniesE-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
 
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
 
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
 
UI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design SystemUI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design System
 
316895207-SAP-Oil-and-Gas-Downstream-Training.pptx
316895207-SAP-Oil-and-Gas-Downstream-Training.pptx316895207-SAP-Oil-and-Gas-Downstream-Training.pptx
316895207-SAP-Oil-and-Gas-Downstream-Training.pptx
 

TDD Anti-patterns (2022 edition)

  • 1. Ahmed Misbah - September 2022 TDD Anti-patterns 2022 edition
  • 2. TDD Anti-patterns Agenda • About the speaker • What is TDD? • The anti-patterns • References
  • 3. TDD Anti-patterns Agenda ➡ About the speaker • What is TDD? • The anti-patterns • References
  • 4. About the speaker Role and previous talks • Chief Software Engineer and Architect • Speaker at: ‣ Delta Technopreneurs ‣ DevOpsDays Cairo ‣ AMECSE ‣ Orange DevTest Days ‣ GDG ‣ JDC
  • 5. About the speaker Topics of interest • DevOps • Agile and Lean • Cloud-Native Apps and beyond • Software Architecture • Java • FOSS • Arti fi cial Intelligence and ML
  • 6. About the speaker Experience • 9 years at Orange Innovation Egypt • Delivered two award winning innovative solutions • Worked at two startups • Helped many others! • Winner of Dell Hacktrick 2022 UI/UX track • MSc. degree in ML and many other professional certi fi cations Nile University J;.lll ~l:J.. Qtertifirate (3/'~ This is to certify that Ahmed Mahmoud Amir Misbah •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• Has successfully completed the program of study and fulfilled the requirements for BigData & Data Science Diploma for the period from October 2015 to July 2016 ...f:.!.l...~'!!~~!.tf....El..#.!(!.~.1.. INF Program Director ~~.__QI II C.a.::::a..;r:q;;; AU J M IW fl , : ~t '-M4' October 2016 · ····························••- •·············· Date
  • 7. TDD Anti-patterns Agenda • About the speaker ➡ What is TDD? • The anti-patterns • References
  • 8. Martin Fowler “Test-Driven Development (TDD) is a technique for building software that guides software development by writing tests. It was developed by Kent Beck in the late 1990's as part of Extreme Programming. In essence you follow three simple steps repeatedly: • Write a test for the next bit of functionality you want to add. • Write the functional code until the test passes. • Refactor both new and old code to make it well structured.”
  • 9. TDD Anti-patterns Agenda • About the speaker • What is TDD? ➡ The anti-patterns • References
  • 10. TDD Anti-patterns 7 anti-patterns 1. No test list 2. No refactoring 3. No pair/mob programming 4. No particular school 5. No integration 6. No mutation testing 7. Practice + technology before theory
  • 11. (1) No test list
  • 12. Kent Beck “Test-Driven Development By Example”, Chapter 25 - Test Driven Development Patterns “What should you test? Before you begin, write a list of all the tests you know you will have to write. The first part of our approach to dealing with programming stress is never to take a step forward unless we know where our foot is going to land. When we sit down to a programming session, what is it we intend to accomplish?”
  • 13.
  • 14. No test list The true Red-Green-Refactor • Invented by James Shore in 2005 (link) • Steps: 1. Think: Figure out what test will best move your code towards completion. (Take as much time as you need. This is the hardest step for beginners.) 2. Red 3. Green 4. Refactor 5. Repeat
  • 15. “The Coding Dojo Handbook”, Section 3
  • 16. No test list How to write a test list? • Pair/mob with testers • Use test design techniques Sample test list by Kent Beck
  • 18. Martin Fowler “The most common way that I hear to screw up TDD is neglecting the third step. Refactoring the code to keep it clean is a key part of the process, otherwise you just end up with a messy aggregation of code fragments. (At least these will have tests, so it's a less painful result than most failures of design.)”
  • 19. Refactoring What do we do in the refactor phase? • It’s when you remove duplication - Kent Beck • It’s when you sanitize the code smells - Martin Fowler • It’s when you apply patterns - Joshua Kerievsky “TDD, Where Did it All Go Wrong” video
  • 20. Refactoring It’s all about design • “There is no design phase in TDD. Using TDD, design is inverted and distributed” • “TDD completely inverts the accepted ordering of ‘design-code-test'” • “TDD just puts the design after the test and the code. Refactoring is pure design.” “Test-Driven Development” eLearning Album - Industrial Logic Code Design Test Refactor Code Test Design/ Refactor
  • 21. (3) No pair / mob programming
  • 22. No pair / mob programming Issues with working solo in TDD Learning curve (technologies, recommended practices, etc.) Knowledge sharing (technologies, recommended practices, business, test list, etc.) Collective ownership (of production code and tests)
  • 24. No particular school Di ff erent Architectures “Domain-speci fi c Semantic Web-based Information Systems - Any Progress?” paper
  • 25. No particular school The schools of TDD • Classicist (aka. Chicago or Detroit school of TDD): ‣ Inside-out ‣ Tests behavior ‣ No mocks • Mockist (aka. London school of TDD) ‣ Outside-in ‣ Tests structure? ‣ Uses mocks
  • 26. No particular school Understand the schools • A beginners explanation of the Chicago & London approaches • London vs. Chicago • Chicago TDD vs London TDD – Which one is should you use? • London vs. Chicago by Robert (Bob) Martin and Sandro Mancuso
  • 28.
  • 29. No integration Microtesting • Invented by Mike (GeePaw) Hill in 2011 (link) • The Four-Beat Cycle: 1. RED 2. GREEN 3. REFACTOR 4. INTEGRATE: We commit our changes, including the new micro-test(s), to the source vault.
  • 30. (6) No mutation testing
  • 31. Alex Bunardzic “Two things surprised me a lot recently: 1. Number of experienced TDDers who told me they fail to see value in Mutation testing 2. Number of experienced TDDers who told me they fail to see value in TCR”
  • 32. No mutation testing Why Mutation Tests? • Traditional test coverage (i.e., line, statement, branch, etc.) measures only which code is executed by your tests. It does not check that your tests are able to detect faults in the executed code. It is therefore only able to identify code that is not tested • As it can detect whether each statement is meaningfully tested, mutation testing is the gold standard against which all other types of coverage are measured Source link
  • 33.
  • 34. (7) Practice + technology before theory
  • 35. Ahmed Galal - Mobile UX session - 2012 “Experience = Knowledge (i.e., Theory) + Practice”
  • 36. Practice + technology before theory Experience, Theory and Practice • Experience is often used interchangeably with practice. • However, true experience is gained by both learning knowledge and theory and applying it (i.e., practice)
  • 37. W. Edwards Deming - “The New Economics for Industry, Government, Education” book “Experience by itself teaches nothing... Without theory, experience has no meaning. Without theory, one has no questions to ask. Hence, without theory, there is no learning.”
  • 38. Practice + technology before theory Knowledge then practice + technology • Beginners start with courses that teach technologies without diving deep into the theory and recommended practices • Beginners should read: - The three laws of TDD - “Clean Code” by Robert (Bob) C. Martin - F.I.R.S.T properties - “Clean Code” by Robert (Bob) C. Martin - Test Desiderata - Kent Beck - TDD Manifesto
  • 42.
  • 43. Book a free call to arrange a workshop • Introduction to TDD • Advanced topics in TDD • TDD and refactoring workshop Scan to book a free call