SlideShare a Scribd company logo
1 of 23
The Zen of Test Driven 
Development 
Mihai Mahulea 
BizPro Technologies 
[25th of October 2014]
Don’t test classes 
Don’t test methods 
Test behaviours
Self testing code
In an ideal world... 
• Frequency: how rapidly do we want our 
feedback ? 
• Fidelity: how accurate do we want the 
red/green signal to be? 
•Urgency: how fast do we need to deploy 
• Overhead: how much are we prepared to 
pay?
Feedback 
• Have I broken anything? 
• Is my code base healthy? 
• Is the software doing something useful for 
the user? 
It should NOT help you identify the exact line 
number where the test broke
How I did it: 
For every project: 
• For every class library - a unit test project 
• For every class - a new test class 
• For every public method - at least one test 
method 
• Each class tested in isolation 
• All class dependencies were abstractions for mocking 
• Code coverage >= 80%
Pros and cons 
• Small implementation 
changes broke dozens of 
tests – hard to refactor 
• Difficult to understand 
tests intent 
• More test code 
than implementation code 
• Hard to convince 
managers, colleagues, 
clients 
• A lot of effort to test first 
• Useless tests 
• High confidence 
• Less bugs 
• SOLID, Ioc, coupling
Unit test
We unit test at 
the port, driving 
the application 
domain 
Don’t test the 
adapter 
Integration test 
confirm hookup 
of port to adapter 
The port is 
a behaviour 
boundary 
System Tests 
exercise the 
boundary
When to mock?
Mock other 
ports 
Don’t mock 
adapters - 
mock ports 
Don’t mock 
things we 
don’t own 
Don’t mock 
internals 
they come 
from 
refactoring 
Mock other 
public 
classes – 
they are 
part of our 
API
Red – Green – (Refactor)
Too little / Too much
Test to code ratio
Summary 
• The reason to test is a new behavior, not a method 
on a class 
• Don’t test internals 
• Don’t make everything public in order to test it 
• Write dirty code to get green, then refactor 
• No new tests for refactored internals and privates 
(methods, classes) 
• Both Develop and Accept against tests written on a 
port 
• Add Integration tests for coverage of ports to 
adapters 
• Add system tests for end-to-end confidence 
• Don’t mock internals, privates, or adapters
Please fill the online evaluation form after event 
The Zen of Test Driven Development 
Mihai Mahulea 
BizPro Technologies 
[25th of October 2014]

More Related Content

What's hot

Developer + tester = quality++
Developer + tester = quality++Developer + tester = quality++
Developer + tester = quality++Mikalai Alimenkou
 
Continuous testing for continuous delivery
Continuous testing for continuous deliveryContinuous testing for continuous delivery
Continuous testing for continuous deliveryDavid Hart
 
Small is Beautiful- Fully Automate your Test Case Design
Small is Beautiful- Fully Automate your Test Case DesignSmall is Beautiful- Fully Automate your Test Case Design
Small is Beautiful- Fully Automate your Test Case DesignGeorgina Tilby
 
Testing Your Software Testers
Testing Your Software TestersTesting Your Software Testers
Testing Your Software TestersOri Bendet
 
Testing NodeJS, REST APIs and MongoDB with UFT
Testing NodeJS, REST APIs and MongoDB with UFTTesting NodeJS, REST APIs and MongoDB with UFT
Testing NodeJS, REST APIs and MongoDB with UFTOri Bendet
 
Automated Unit Testing
Automated Unit Testing Automated Unit Testing
Automated Unit Testing Simon Boorsma
 
Agile Mumbai 2020 Conference | How to get the best ROI on Your Test Automati...
Agile Mumbai 2020 Conference |  How to get the best ROI on Your Test Automati...Agile Mumbai 2020 Conference |  How to get the best ROI on Your Test Automati...
Agile Mumbai 2020 Conference | How to get the best ROI on Your Test Automati...AgileNetwork
 
Automated Testing with Agile
Automated Testing with AgileAutomated Testing with Agile
Automated Testing with AgileKen McCorkell
 
6 Steps to Implementing a World Class Testing Ecosystem Final
6 Steps to Implementing a World Class Testing Ecosystem Final6 Steps to Implementing a World Class Testing Ecosystem Final
6 Steps to Implementing a World Class Testing Ecosystem FinalEggplant
 
Code Review tool for personal effectiveness and waste analysis
Code Review tool for personal effectiveness and waste analysisCode Review tool for personal effectiveness and waste analysis
Code Review tool for personal effectiveness and waste analysisMikalai Alimenkou
 
Regulated Software Testing - Griffin Jones - TISQA 2014
Regulated Software Testing  - Griffin Jones - TISQA 2014Regulated Software Testing  - Griffin Jones - TISQA 2014
Regulated Software Testing - Griffin Jones - TISQA 2014Griffin Jones
 
Android application development part2
Android application development part2Android application development part2
Android application development part2Mayank Bhatt
 
A Top-Down Approach to End-to-End Testing
A Top-Down Approach to End-to-End TestingA Top-Down Approach to End-to-End Testing
A Top-Down Approach to End-to-End TestingSmartBear
 
DevOps presentation
DevOps presentationDevOps presentation
DevOps presentationAxsh Co. LTD
 
Quality Assurance Guidelines
Quality Assurance GuidelinesQuality Assurance Guidelines
Quality Assurance GuidelinesTim Stribos
 

What's hot (20)

Developer + tester = quality++
Developer + tester = quality++Developer + tester = quality++
Developer + tester = quality++
 
Continuous testing for continuous delivery
Continuous testing for continuous deliveryContinuous testing for continuous delivery
Continuous testing for continuous delivery
 
Small is Beautiful- Fully Automate your Test Case Design
Small is Beautiful- Fully Automate your Test Case DesignSmall is Beautiful- Fully Automate your Test Case Design
Small is Beautiful- Fully Automate your Test Case Design
 
Testing Your Software Testers
Testing Your Software TestersTesting Your Software Testers
Testing Your Software Testers
 
Testing NodeJS, REST APIs and MongoDB with UFT
Testing NodeJS, REST APIs and MongoDB with UFTTesting NodeJS, REST APIs and MongoDB with UFT
Testing NodeJS, REST APIs and MongoDB with UFT
 
Agile Testing - Challenges
Agile Testing - ChallengesAgile Testing - Challenges
Agile Testing - Challenges
 
Software testing
Software testingSoftware testing
Software testing
 
Automated Unit Testing
Automated Unit Testing Automated Unit Testing
Automated Unit Testing
 
Unit tests benefits
Unit tests benefitsUnit tests benefits
Unit tests benefits
 
Agile Mumbai 2020 Conference | How to get the best ROI on Your Test Automati...
Agile Mumbai 2020 Conference |  How to get the best ROI on Your Test Automati...Agile Mumbai 2020 Conference |  How to get the best ROI on Your Test Automati...
Agile Mumbai 2020 Conference | How to get the best ROI on Your Test Automati...
 
Automated Testing with Agile
Automated Testing with AgileAutomated Testing with Agile
Automated Testing with Agile
 
6 Steps to Implementing a World Class Testing Ecosystem Final
6 Steps to Implementing a World Class Testing Ecosystem Final6 Steps to Implementing a World Class Testing Ecosystem Final
6 Steps to Implementing a World Class Testing Ecosystem Final
 
Code Review tool for personal effectiveness and waste analysis
Code Review tool for personal effectiveness and waste analysisCode Review tool for personal effectiveness and waste analysis
Code Review tool for personal effectiveness and waste analysis
 
Agile methodologies
Agile methodologiesAgile methodologies
Agile methodologies
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
Regulated Software Testing - Griffin Jones - TISQA 2014
Regulated Software Testing  - Griffin Jones - TISQA 2014Regulated Software Testing  - Griffin Jones - TISQA 2014
Regulated Software Testing - Griffin Jones - TISQA 2014
 
Android application development part2
Android application development part2Android application development part2
Android application development part2
 
A Top-Down Approach to End-to-End Testing
A Top-Down Approach to End-to-End TestingA Top-Down Approach to End-to-End Testing
A Top-Down Approach to End-to-End Testing
 
DevOps presentation
DevOps presentationDevOps presentation
DevOps presentation
 
Quality Assurance Guidelines
Quality Assurance GuidelinesQuality Assurance Guidelines
Quality Assurance Guidelines
 

Viewers also liked

Iasi code camp 12 october 2013 an invitation to agile product management - ...
Iasi code camp 12 october 2013   an invitation to agile product management - ...Iasi code camp 12 october 2013   an invitation to agile product management - ...
Iasi code camp 12 october 2013 an invitation to agile product management - ...Codecamp Romania
 
Managing technical debt - Dan Nicola - Florin Cardasim
Managing technical debt - Dan Nicola - Florin CardasimManaging technical debt - Dan Nicola - Florin Cardasim
Managing technical debt - Dan Nicola - Florin CardasimCodecamp Romania
 
Code camp iasi silviu niculita - machine learning for mere mortals with azu...
Code camp iasi   silviu niculita - machine learning for mere mortals with azu...Code camp iasi   silviu niculita - machine learning for mere mortals with azu...
Code camp iasi silviu niculita - machine learning for mere mortals with azu...Codecamp Romania
 
Iulian dogariu the sad story of the server etc
Iulian dogariu   the sad story of the server etcIulian dogariu   the sad story of the server etc
Iulian dogariu the sad story of the server etcCodecamp Romania
 
Cristi Ursachi - Xamarin - CodeCamp 10 may 2014
Cristi Ursachi  - Xamarin - CodeCamp 10 may 2014Cristi Ursachi  - Xamarin - CodeCamp 10 may 2014
Cristi Ursachi - Xamarin - CodeCamp 10 may 2014Codecamp Romania
 
Vlad Zelinschi - Embrace Native JavaScript (the anti-plugins talk) - Codecamp...
Vlad Zelinschi - Embrace Native JavaScript (the anti-plugins talk) - Codecamp...Vlad Zelinschi - Embrace Native JavaScript (the anti-plugins talk) - Codecamp...
Vlad Zelinschi - Embrace Native JavaScript (the anti-plugins talk) - Codecamp...Codecamp Romania
 
Intro CodeCamp/IASI 16 oct 2010
Intro CodeCamp/IASI 16 oct 2010Intro CodeCamp/IASI 16 oct 2010
Intro CodeCamp/IASI 16 oct 2010Codecamp Romania
 
Material design screen transitions in android
Material design screen transitions in androidMaterial design screen transitions in android
Material design screen transitions in androidCodecamp Romania
 
Angajatori de Top Iasi - Nov 2013
Angajatori de Top Iasi - Nov 2013Angajatori de Top Iasi - Nov 2013
Angajatori de Top Iasi - Nov 2013Codecamp Romania
 
Codecamp Iasi 7 mai 2011 Exception tail.com
Codecamp Iasi 7 mai 2011 Exception tail.comCodecamp Iasi 7 mai 2011 Exception tail.com
Codecamp Iasi 7 mai 2011 Exception tail.comCodecamp Romania
 
Iasi code camp 12 october 2013 play oriented development - leon daniel
Iasi code camp 12 october 2013   play oriented development - leon danielIasi code camp 12 october 2013   play oriented development - leon daniel
Iasi code camp 12 october 2013 play oriented development - leon danielCodecamp Romania
 
Iasi code camp 12 october 2013 jax-rs-jee-ecosystem - catalin mihalache
Iasi code camp 12 october 2013   jax-rs-jee-ecosystem - catalin mihalacheIasi code camp 12 october 2013   jax-rs-jee-ecosystem - catalin mihalache
Iasi code camp 12 october 2013 jax-rs-jee-ecosystem - catalin mihalacheCodecamp Romania
 
Eugen Constantinescu - Genivi - Codecamp 10 may 2014
Eugen Constantinescu - Genivi - Codecamp 10 may 2014Eugen Constantinescu - Genivi - Codecamp 10 may 2014
Eugen Constantinescu - Genivi - Codecamp 10 may 2014Codecamp Romania
 
Ana milutinovic quality awareness when practicing agile testing
Ana milutinovic   quality awareness when practicing agile testingAna milutinovic   quality awareness when practicing agile testing
Ana milutinovic quality awareness when practicing agile testingCodecamp Romania
 
Iasi code camp 12 october 2013 typescript vs coffeescript - vlad iliescu
Iasi code camp 12 october 2013   typescript vs coffeescript - vlad iliescuIasi code camp 12 october 2013   typescript vs coffeescript - vlad iliescu
Iasi code camp 12 october 2013 typescript vs coffeescript - vlad iliescuCodecamp Romania
 

Viewers also liked (18)

Iasi code camp 12 october 2013 an invitation to agile product management - ...
Iasi code camp 12 october 2013   an invitation to agile product management - ...Iasi code camp 12 october 2013   an invitation to agile product management - ...
Iasi code camp 12 october 2013 an invitation to agile product management - ...
 
Managing technical debt - Dan Nicola - Florin Cardasim
Managing technical debt - Dan Nicola - Florin CardasimManaging technical debt - Dan Nicola - Florin Cardasim
Managing technical debt - Dan Nicola - Florin Cardasim
 
Code camp iasi silviu niculita - machine learning for mere mortals with azu...
Code camp iasi   silviu niculita - machine learning for mere mortals with azu...Code camp iasi   silviu niculita - machine learning for mere mortals with azu...
Code camp iasi silviu niculita - machine learning for mere mortals with azu...
 
Iulian dogariu the sad story of the server etc
Iulian dogariu   the sad story of the server etcIulian dogariu   the sad story of the server etc
Iulian dogariu the sad story of the server etc
 
Cristi Ursachi - Xamarin - CodeCamp 10 may 2014
Cristi Ursachi  - Xamarin - CodeCamp 10 may 2014Cristi Ursachi  - Xamarin - CodeCamp 10 may 2014
Cristi Ursachi - Xamarin - CodeCamp 10 may 2014
 
Vlad Zelinschi - Embrace Native JavaScript (the anti-plugins talk) - Codecamp...
Vlad Zelinschi - Embrace Native JavaScript (the anti-plugins talk) - Codecamp...Vlad Zelinschi - Embrace Native JavaScript (the anti-plugins talk) - Codecamp...
Vlad Zelinschi - Embrace Native JavaScript (the anti-plugins talk) - Codecamp...
 
Ccp
CcpCcp
Ccp
 
Intro CodeCamp/IASI 16 oct 2010
Intro CodeCamp/IASI 16 oct 2010Intro CodeCamp/IASI 16 oct 2010
Intro CodeCamp/IASI 16 oct 2010
 
Material design screen transitions in android
Material design screen transitions in androidMaterial design screen transitions in android
Material design screen transitions in android
 
Angajatori de Top Iasi - Nov 2013
Angajatori de Top Iasi - Nov 2013Angajatori de Top Iasi - Nov 2013
Angajatori de Top Iasi - Nov 2013
 
Codecamp Iasi 7 mai 2011 Exception tail.com
Codecamp Iasi 7 mai 2011 Exception tail.comCodecamp Iasi 7 mai 2011 Exception tail.com
Codecamp Iasi 7 mai 2011 Exception tail.com
 
The bigrewrite
The bigrewriteThe bigrewrite
The bigrewrite
 
Iasi code camp 12 october 2013 play oriented development - leon daniel
Iasi code camp 12 october 2013   play oriented development - leon danielIasi code camp 12 october 2013   play oriented development - leon daniel
Iasi code camp 12 october 2013 play oriented development - leon daniel
 
Iasi code camp 12 october 2013 jax-rs-jee-ecosystem - catalin mihalache
Iasi code camp 12 october 2013   jax-rs-jee-ecosystem - catalin mihalacheIasi code camp 12 october 2013   jax-rs-jee-ecosystem - catalin mihalache
Iasi code camp 12 october 2013 jax-rs-jee-ecosystem - catalin mihalache
 
Eugen Constantinescu - Genivi - Codecamp 10 may 2014
Eugen Constantinescu - Genivi - Codecamp 10 may 2014Eugen Constantinescu - Genivi - Codecamp 10 may 2014
Eugen Constantinescu - Genivi - Codecamp 10 may 2014
 
Ana milutinovic quality awareness when practicing agile testing
Ana milutinovic   quality awareness when practicing agile testingAna milutinovic   quality awareness when practicing agile testing
Ana milutinovic quality awareness when practicing agile testing
 
The bigrewrite
The bigrewriteThe bigrewrite
The bigrewrite
 
Iasi code camp 12 october 2013 typescript vs coffeescript - vlad iliescu
Iasi code camp 12 october 2013   typescript vs coffeescript - vlad iliescuIasi code camp 12 october 2013   typescript vs coffeescript - vlad iliescu
Iasi code camp 12 october 2013 typescript vs coffeescript - vlad iliescu
 

Similar to Mihai mahulea the zen of test driven development

5 Steps to Jump Start Your Test Automation
5 Steps to Jump Start Your Test Automation5 Steps to Jump Start Your Test Automation
5 Steps to Jump Start Your Test AutomationSauce Labs
 
Type mock isolator
Type mock isolatorType mock isolator
Type mock isolatorMaslowB
 
SOFTWARE TESTING W1_watermark.pdf
SOFTWARE TESTING W1_watermark.pdfSOFTWARE TESTING W1_watermark.pdf
SOFTWARE TESTING W1_watermark.pdfShubhamSingh606946
 
Agile Testing – embedding testing into agile software development lifecycle
Agile Testing – embedding testing into agile software development lifecycle Agile Testing – embedding testing into agile software development lifecycle
Agile Testing – embedding testing into agile software development lifecycle Kari Kakkonen
 
Boston MeetUp 10.10
Boston MeetUp 10.10Boston MeetUp 10.10
Boston MeetUp 10.10Solano Labs
 
An Introduction to Unit Testing
An Introduction to Unit TestingAn Introduction to Unit Testing
An Introduction to Unit TestingSahar Nofal
 
Capability Building for Cyber Defense: Software Walk through and Screening
Capability Building for Cyber Defense: Software Walk through and Screening Capability Building for Cyber Defense: Software Walk through and Screening
Capability Building for Cyber Defense: Software Walk through and Screening Maven Logix
 
DevOps Workshop - Addressing Quality Challenges of Highly Complex and Integra...
DevOps Workshop - Addressing Quality Challenges of Highly Complex and Integra...DevOps Workshop - Addressing Quality Challenges of Highly Complex and Integra...
DevOps Workshop - Addressing Quality Challenges of Highly Complex and Integra...Andrew Williams
 
ISTQB - CTFL Summary v1.0
ISTQB - CTFL Summary v1.0ISTQB - CTFL Summary v1.0
ISTQB - CTFL Summary v1.0Samer Desouky
 
Automated testing san francisco oct 2013
Automated testing san francisco oct 2013Automated testing san francisco oct 2013
Automated testing san francisco oct 2013Solano Labs
 
How to Actually DO High-volume Automated Testing
How to Actually DO High-volume Automated TestingHow to Actually DO High-volume Automated Testing
How to Actually DO High-volume Automated TestingTechWell
 
Test planning and software's engineering
Test planning and software's engineeringTest planning and software's engineering
Test planning and software's engineeringMansiganeshJawale
 
Exploratory Testing Basics and Future Kari Kakkonen Moscow 2018
Exploratory Testing Basics and Future Kari Kakkonen Moscow 2018Exploratory Testing Basics and Future Kari Kakkonen Moscow 2018
Exploratory Testing Basics and Future Kari Kakkonen Moscow 2018Kari Kakkonen
 
4&5.pptx SOFTWARE TESTING UNIT-4 AND UNIT-5
4&5.pptx SOFTWARE TESTING UNIT-4 AND UNIT-54&5.pptx SOFTWARE TESTING UNIT-4 AND UNIT-5
4&5.pptx SOFTWARE TESTING UNIT-4 AND UNIT-5hemasubbu08
 
Introduction to Automated Testing
Introduction to Automated TestingIntroduction to Automated Testing
Introduction to Automated TestingLars Thorup
 
Introduction to-automated-testing
Introduction to-automated-testingIntroduction to-automated-testing
Introduction to-automated-testingBestBrains
 
Alexander Podelko - Context-Driven Performance Testing
Alexander Podelko - Context-Driven Performance TestingAlexander Podelko - Context-Driven Performance Testing
Alexander Podelko - Context-Driven Performance TestingNeotys_Partner
 

Similar to Mihai mahulea the zen of test driven development (20)

NYC MeetUp 10.9
NYC MeetUp 10.9NYC MeetUp 10.9
NYC MeetUp 10.9
 
5 Steps to Jump Start Your Test Automation
5 Steps to Jump Start Your Test Automation5 Steps to Jump Start Your Test Automation
5 Steps to Jump Start Your Test Automation
 
Type mock isolator
Type mock isolatorType mock isolator
Type mock isolator
 
SOFTWARE TESTING W1_watermark.pdf
SOFTWARE TESTING W1_watermark.pdfSOFTWARE TESTING W1_watermark.pdf
SOFTWARE TESTING W1_watermark.pdf
 
CNUG TDD June 2014
CNUG TDD June 2014CNUG TDD June 2014
CNUG TDD June 2014
 
Agile Testing – embedding testing into agile software development lifecycle
Agile Testing – embedding testing into agile software development lifecycle Agile Testing – embedding testing into agile software development lifecycle
Agile Testing – embedding testing into agile software development lifecycle
 
Boston MeetUp 10.10
Boston MeetUp 10.10Boston MeetUp 10.10
Boston MeetUp 10.10
 
An Introduction to Unit Testing
An Introduction to Unit TestingAn Introduction to Unit Testing
An Introduction to Unit Testing
 
Capability Building for Cyber Defense: Software Walk through and Screening
Capability Building for Cyber Defense: Software Walk through and Screening Capability Building for Cyber Defense: Software Walk through and Screening
Capability Building for Cyber Defense: Software Walk through and Screening
 
DevOps Workshop - Addressing Quality Challenges of Highly Complex and Integra...
DevOps Workshop - Addressing Quality Challenges of Highly Complex and Integra...DevOps Workshop - Addressing Quality Challenges of Highly Complex and Integra...
DevOps Workshop - Addressing Quality Challenges of Highly Complex and Integra...
 
ISTQB - CTFL Summary v1.0
ISTQB - CTFL Summary v1.0ISTQB - CTFL Summary v1.0
ISTQB - CTFL Summary v1.0
 
Automated testing san francisco oct 2013
Automated testing san francisco oct 2013Automated testing san francisco oct 2013
Automated testing san francisco oct 2013
 
How to Actually DO High-volume Automated Testing
How to Actually DO High-volume Automated TestingHow to Actually DO High-volume Automated Testing
How to Actually DO High-volume Automated Testing
 
Test planning and software's engineering
Test planning and software's engineeringTest planning and software's engineering
Test planning and software's engineering
 
UNIT IV.ppt
UNIT IV.pptUNIT IV.ppt
UNIT IV.ppt
 
Exploratory Testing Basics and Future Kari Kakkonen Moscow 2018
Exploratory Testing Basics and Future Kari Kakkonen Moscow 2018Exploratory Testing Basics and Future Kari Kakkonen Moscow 2018
Exploratory Testing Basics and Future Kari Kakkonen Moscow 2018
 
4&5.pptx SOFTWARE TESTING UNIT-4 AND UNIT-5
4&5.pptx SOFTWARE TESTING UNIT-4 AND UNIT-54&5.pptx SOFTWARE TESTING UNIT-4 AND UNIT-5
4&5.pptx SOFTWARE TESTING UNIT-4 AND UNIT-5
 
Introduction to Automated Testing
Introduction to Automated TestingIntroduction to Automated Testing
Introduction to Automated Testing
 
Introduction to-automated-testing
Introduction to-automated-testingIntroduction to-automated-testing
Introduction to-automated-testing
 
Alexander Podelko - Context-Driven Performance Testing
Alexander Podelko - Context-Driven Performance TestingAlexander Podelko - Context-Driven Performance Testing
Alexander Podelko - Context-Driven Performance Testing
 

More from Codecamp Romania

Cezar chitac the edge of experience
Cezar chitac   the edge of experienceCezar chitac   the edge of experience
Cezar chitac the edge of experienceCodecamp Romania
 
Business analysis techniques exercise your 6-pack
Business analysis techniques   exercise your 6-packBusiness analysis techniques   exercise your 6-pack
Business analysis techniques exercise your 6-packCodecamp Romania
 
Bpm company code camp - configuration or coding with pega
Bpm company   code camp - configuration or coding with pegaBpm company   code camp - configuration or coding with pega
Bpm company code camp - configuration or coding with pegaCodecamp Romania
 
Andrei prisacaru takingtheunitteststothedatabase
Andrei prisacaru takingtheunitteststothedatabaseAndrei prisacaru takingtheunitteststothedatabase
Andrei prisacaru takingtheunitteststothedatabaseCodecamp Romania
 
2015 dan ardelean develop for windows 10
2015 dan ardelean   develop for windows 10 2015 dan ardelean   develop for windows 10
2015 dan ardelean develop for windows 10 Codecamp Romania
 
The case for continuous delivery
The case for continuous deliveryThe case for continuous delivery
The case for continuous deliveryCodecamp Romania
 
Stefan stolniceanu spritekit, 2 d or not 2d
Stefan stolniceanu   spritekit, 2 d or not 2dStefan stolniceanu   spritekit, 2 d or not 2d
Stefan stolniceanu spritekit, 2 d or not 2dCodecamp Romania
 
Sizing epics tales from an agile kingdom
Sizing epics   tales from an agile kingdomSizing epics   tales from an agile kingdom
Sizing epics tales from an agile kingdomCodecamp Romania
 
Raluca butnaru corina cilibiu the unknown universe of a product and the cer...
Raluca butnaru corina cilibiu   the unknown universe of a product and the cer...Raluca butnaru corina cilibiu   the unknown universe of a product and the cer...
Raluca butnaru corina cilibiu the unknown universe of a product and the cer...Codecamp Romania
 
Parallel & async processing using tpl dataflow
Parallel & async processing using tpl dataflowParallel & async processing using tpl dataflow
Parallel & async processing using tpl dataflowCodecamp Romania
 
Material design screen transitions in android
Material design screen transitions in androidMaterial design screen transitions in android
Material design screen transitions in androidCodecamp Romania
 
Kickstart your own freelancing career
Kickstart your own freelancing careerKickstart your own freelancing career
Kickstart your own freelancing careerCodecamp Romania
 
Ionut grecu the soft stuff is the hard stuff. the agile soft skills toolkit
Ionut grecu   the soft stuff is the hard stuff. the agile soft skills toolkitIonut grecu   the soft stuff is the hard stuff. the agile soft skills toolkit
Ionut grecu the soft stuff is the hard stuff. the agile soft skills toolkitCodecamp Romania
 
Diana antohi me against myself or how to fail and move forward
Diana antohi   me against myself  or how to fail  and move forwardDiana antohi   me against myself  or how to fail  and move forward
Diana antohi me against myself or how to fail and move forwardCodecamp Romania
 
Codecamp2015 pimp yourpipeline-saade-jens-1.1
Codecamp2015 pimp yourpipeline-saade-jens-1.1Codecamp2015 pimp yourpipeline-saade-jens-1.1
Codecamp2015 pimp yourpipeline-saade-jens-1.1Codecamp Romania
 
Code camp iasi silviu niculita - machine learning for mere mortals with azu...
Code camp iasi   silviu niculita - machine learning for mere mortals with azu...Code camp iasi   silviu niculita - machine learning for mere mortals with azu...
Code camp iasi silviu niculita - machine learning for mere mortals with azu...Codecamp Romania
 

More from Codecamp Romania (20)

Cezar chitac the edge of experience
Cezar chitac   the edge of experienceCezar chitac   the edge of experience
Cezar chitac the edge of experience
 
Cloud powered search
Cloud powered searchCloud powered search
Cloud powered search
 
Business analysis techniques exercise your 6-pack
Business analysis techniques   exercise your 6-packBusiness analysis techniques   exercise your 6-pack
Business analysis techniques exercise your 6-pack
 
Bpm company code camp - configuration or coding with pega
Bpm company   code camp - configuration or coding with pegaBpm company   code camp - configuration or coding with pega
Bpm company code camp - configuration or coding with pega
 
Andrei prisacaru takingtheunitteststothedatabase
Andrei prisacaru takingtheunitteststothedatabaseAndrei prisacaru takingtheunitteststothedatabase
Andrei prisacaru takingtheunitteststothedatabase
 
Agility and life
Agility and lifeAgility and life
Agility and life
 
2015 dan ardelean develop for windows 10
2015 dan ardelean   develop for windows 10 2015 dan ardelean   develop for windows 10
2015 dan ardelean develop for windows 10
 
The case for continuous delivery
The case for continuous deliveryThe case for continuous delivery
The case for continuous delivery
 
Stefan stolniceanu spritekit, 2 d or not 2d
Stefan stolniceanu   spritekit, 2 d or not 2dStefan stolniceanu   spritekit, 2 d or not 2d
Stefan stolniceanu spritekit, 2 d or not 2d
 
Sizing epics tales from an agile kingdom
Sizing epics   tales from an agile kingdomSizing epics   tales from an agile kingdom
Sizing epics tales from an agile kingdom
 
Scale net apps in aws
Scale net apps in awsScale net apps in aws
Scale net apps in aws
 
Raluca butnaru corina cilibiu the unknown universe of a product and the cer...
Raluca butnaru corina cilibiu   the unknown universe of a product and the cer...Raluca butnaru corina cilibiu   the unknown universe of a product and the cer...
Raluca butnaru corina cilibiu the unknown universe of a product and the cer...
 
Parallel & async processing using tpl dataflow
Parallel & async processing using tpl dataflowParallel & async processing using tpl dataflow
Parallel & async processing using tpl dataflow
 
Material design screen transitions in android
Material design screen transitions in androidMaterial design screen transitions in android
Material design screen transitions in android
 
Kickstart your own freelancing career
Kickstart your own freelancing careerKickstart your own freelancing career
Kickstart your own freelancing career
 
Ionut grecu the soft stuff is the hard stuff. the agile soft skills toolkit
Ionut grecu   the soft stuff is the hard stuff. the agile soft skills toolkitIonut grecu   the soft stuff is the hard stuff. the agile soft skills toolkit
Ionut grecu the soft stuff is the hard stuff. the agile soft skills toolkit
 
Ecma6 in the wild
Ecma6 in the wildEcma6 in the wild
Ecma6 in the wild
 
Diana antohi me against myself or how to fail and move forward
Diana antohi   me against myself  or how to fail  and move forwardDiana antohi   me against myself  or how to fail  and move forward
Diana antohi me against myself or how to fail and move forward
 
Codecamp2015 pimp yourpipeline-saade-jens-1.1
Codecamp2015 pimp yourpipeline-saade-jens-1.1Codecamp2015 pimp yourpipeline-saade-jens-1.1
Codecamp2015 pimp yourpipeline-saade-jens-1.1
 
Code camp iasi silviu niculita - machine learning for mere mortals with azu...
Code camp iasi   silviu niculita - machine learning for mere mortals with azu...Code camp iasi   silviu niculita - machine learning for mere mortals with azu...
Code camp iasi silviu niculita - machine learning for mere mortals with azu...
 

Recently uploaded

SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
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
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 

Recently uploaded (20)

SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
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
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
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
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 

Mihai mahulea the zen of test driven development

  • 1.
  • 2. The Zen of Test Driven Development Mihai Mahulea BizPro Technologies [25th of October 2014]
  • 3. Don’t test classes Don’t test methods Test behaviours
  • 5. In an ideal world... • Frequency: how rapidly do we want our feedback ? • Fidelity: how accurate do we want the red/green signal to be? •Urgency: how fast do we need to deploy • Overhead: how much are we prepared to pay?
  • 6. Feedback • Have I broken anything? • Is my code base healthy? • Is the software doing something useful for the user? It should NOT help you identify the exact line number where the test broke
  • 7. How I did it: For every project: • For every class library - a unit test project • For every class - a new test class • For every public method - at least one test method • Each class tested in isolation • All class dependencies were abstractions for mocking • Code coverage >= 80%
  • 8. Pros and cons • Small implementation changes broke dozens of tests – hard to refactor • Difficult to understand tests intent • More test code than implementation code • Hard to convince managers, colleagues, clients • A lot of effort to test first • Useless tests • High confidence • Less bugs • SOLID, Ioc, coupling
  • 10.
  • 11. We unit test at the port, driving the application domain Don’t test the adapter Integration test confirm hookup of port to adapter The port is a behaviour boundary System Tests exercise the boundary
  • 13. Mock other ports Don’t mock adapters - mock ports Don’t mock things we don’t own Don’t mock internals they come from refactoring Mock other public classes – they are part of our API
  • 14.
  • 15. Red – Green – (Refactor)
  • 16.
  • 17. Too little / Too much
  • 18. Test to code ratio
  • 19.
  • 20. Summary • The reason to test is a new behavior, not a method on a class • Don’t test internals • Don’t make everything public in order to test it • Write dirty code to get green, then refactor • No new tests for refactored internals and privates (methods, classes) • Both Develop and Accept against tests written on a port • Add Integration tests for coverage of ports to adapters • Add system tests for end-to-end confidence • Don’t mock internals, privates, or adapters
  • 21.
  • 22.
  • 23. Please fill the online evaluation form after event The Zen of Test Driven Development Mihai Mahulea BizPro Technologies [25th of October 2014]

Editor's Notes

  1. Voi incepe cu sumarul prezentarii. Mesajut principal pe care vreau sa-l transmit este acesta: Nu testati clase sau metode testati functionalitate. Adica: In trecut, cand practicam tdd imi ziceam:”Urmeaza sa implementez metoda asta noua in clasa asta,deci ar trebui sa scriu un test nou pentru aceasta metoda.” Gresit. Trigerul scrierii unui unit test nou nu ar trebui sa fie crearea unei clase noi sau crearea unei metode publice noi. Acest triger ar trebui sa fie implementarea unei functionalitati noi, a unui compartament nou.Requirement-urile ar trebui sa ghideze testele. Metoda de testare ar trebui sa fie „Outside in”. Adica detaliile de implementare nu ar trebui sa fie testate. Nu ma refer sub nici o forma la la testare aplicatiei prin intermediul UI-ului, ma refer la layer-ul public, la API-ul public al aplicatie. Nu scrieti teste care acopera detalii de implemetare. Incapsularea este solutia multor probleme din programare. O astfel de problema ar fi faptul ca testele sunt cuplate de detalii, detin mult prea multe informatii despre modul in care am implementat anumite use case-uri. Pentru fiecare bucata de software pe care o scriem ar trebui sa identificam API-il public. Aici nu ma refer la API-ul REST sau SOAP , ma refer la un numar de clase care lucreaza impreuna pentru a oferi un serviciu. Nu toate clasele unui asembly ar trebui sa fie publice si mai ales nu ar trebui sa fie facute publice doar pt a fi testate. Pentru a identifica API-ul public trebuie sa ne gandim la ce functionalitati ofera soft-ul nostru. Modul in care aceste fuctionalitati sunt implementate ar trbui sa fie incapsulate si testele nu ar trebui sa stie de ele. Daca rezolvam aceasta problema, ulterior cand vom refactoriza implementarea, testele nu vor fi afectate.Deasemenea veti scrie un numar redus de teste.
  2. Desi titlul prezentarii se refera la Test Drivren Development, consider ca notiunea de „Self-Testing Code ” reprezinta esenta prezentarii. „Self-Testing Code ” este practica de a scrie teste automate cuprinzatoare in conjuctie cu soft-ul functional. In alte cuvinte, nu ai terminat de implementat un user story, nu ai rezolvat un bug, pana cand nu ai scris teste automate. TDD-ul este o modalitate a atinge „Self-Testing Code ”. Nu este singura. Cel mai mare beneficiu al codului de auto-testare nu este numarul mic de buguri din productie. Acesta este Increderea. Incredera pe care o capeti atunci cand fac schimbari in sistem. Aceasta incredere este un factor cheie al procesului de Continous Integration si Continous Delivery.
  3. Intr-o lume ideala am avea un feedback instant, infailibil despre deciziile noastre de programare. Dupa fiecare tasta apasata, daca codul este gata, am face deploy pe loc. Acest lucru este imposibil pe moment asa ca intrebarea este cat de departe vrem sa fim de acest deziderat. Deciziile care implica codul de auto-testare, TDD sunt strans legate de anumite contrangeri si compromisuri. Frecventa: cat de rapid dorim feedback-ul Fidelitate: cat de siguri vrem sa fim ca intreg sistemul functioneaza corect Efort: cat timp suntem dispusi sa investim Urgenta: cat de repede dorim codul/bugfixul in productie Durata de viata a proiectului: cat timp va exista soft-ul in productie Obiectivul meu este de a intelege acest set de compromisuri prin articularea lor la oamenii care sunt pregatiti sa le coombata intr-un mod constructiv. Nu exista o reteta fixa pentru a scrie teste. Trebuie sa punem in balanta multi factori inainte de a lua o decizie, iar corectitudinea deciziilor creste odata cu experienta.
  4. O suita buna de unit teste ar trebui sa ne ofere feedback calitativ asupra urmatoarelor aspecte: De cate ori implementam o functionalitate noua sau rezolvam un bug am dori sa fim anuntati daca am introdus alte bug-uri noi. De asta notiunea de cod care se auto-testeaza e asa de importanta. Testele automate raman in solutie si ofera increderea ca nu am stricat functionalitatea testata. Daca codul meu este sanatos. Voi putea adauga functionalitati noi, face refactoring, bugfixing cu usurinta dupa perioada asta de timp? 3. Daca soft-ul ofera functionalitatea dorita utilizatorului. Daca acopera nevoile clientilor si daca acestea sunt satisfacute. Daca testam doar clase si metode in izolare nu puteam acoperi nevoile adevarate ale userilor. Daca la inceputul carierei eram de parere ca un cod bun este un cod testabil pe parcurs mi-am schimbat parerea. Am scris si vazut cod testabil si testat care numai bun nu era. Code review-urile, pair programing-urile sunt mult mai valoroase in a asigura calitatea codului. Nu ne putem baza doar pe acest fapt, daca poate fi testat sau nu?
  5. Principalul motiv al problemelor mele a fost ca am inteles gresit termenul de „unit”. In cartea originala Kent Beck admite ca posibil sa faca o greseala refolosind termenul de „unit test” Am crezut ca unit-ul este o clasa care trebuie testata in izolare. ‘
  6. Should be rarely used A good place to use them is to mock the technology implementations of ports Another place is to mock some other public API calls In some cases I mocked internal code that couldn’t be tested. Don’t mock internals. Address the misunderstanding of Outside In testing. It relies heavily on mock usage.  
  7. The dopamine release that comes from the flow, is from the step of going from red to green, it's not the refactor step. The test are the top level of authority in explaining the system and dictating what is right and combined with the notion of the red - green is the important part of red-green-refactor Leeds a lot of times to under-refactoring, under code clarity, In the Green step you should do the simplest thing to make it pass. You should do bad engineering, copy paste code, have 400 lines of code in a method in order to make you test pass. You can’t figure out what the algorytm to solve a problem and figure out what’s the engineering for that algorytm is in order to make it maintanable. Separate the two problems. The refactoring step in when we produce clean code when we apply patterns remove dupplication sanitaze the code smells We do no write new unit test here. Because I haven’t written all my code in the green step, without any new test, just written an answer, I didn’t realized that at this point when I actually produce classes and patterns to actually implement some details I didn’t need any new tests for those classes. There are allready covered by tthe original test. Refactoring steps are safe Code coverage might be usefull here You have the behaviour preserved in the original tests and for the rest of the code base lifetime you can keep refactoring.