test driven design
TRANSCRIPT
![Page 1: Test Driven Design](https://reader031.vdocuments.site/reader031/viewer/2022020213/587a7b8d1a28abf0468b60bf/html5/thumbnails/1.jpg)
TEST DRIVENDESIGN
LEMi ORHAN ERGiNsoftware craftsman @ acm
![Page 2: Test Driven Design](https://reader031.vdocuments.site/reader031/viewer/2022020213/587a7b8d1a28abf0468b60bf/html5/thumbnails/2.jpg)
DESIGN LEMi ORHAN ERGiNagile software craftsman @ acm
/lemiorhan lemiorhanergin.com @lemiorhan
managing partner at acm developing since 2001
worked at Sony and eBay/GittiGidiyor consultant, architect, trainer, developer
founder of Software Craftsmanship Turkey ex product owner of Agile Turkey Summit
meetup.scturkey.org summit.agileturkey.org
![Page 3: Test Driven Design](https://reader031.vdocuments.site/reader031/viewer/2022020213/587a7b8d1a28abf0468b60bf/html5/thumbnails/3.jpg)
Jack W. Reeves
The C++ Journal Vol. 2, No. 2. 1992http://user.it.uu.se/~carle/softcraft/notes/Reeve_SourceCodeIsTheDesign.pdf
What is So!ware Design?
![Page 4: Test Driven Design](https://reader031.vdocuments.site/reader031/viewer/2022020213/587a7b8d1a28abf0468b60bf/html5/thumbnails/4.jpg)
Source code is the real so!ware designDesigning so!ware is an exercise in managing complexity
Jack W. ReevesWhat is Software Design? The C++ Journal Vol. 2, No. 2. 1992http://user.it.uu.se/~carle/softcraft/notes/Reeve_SourceCodeIsTheDesign.pdf
![Page 5: Test Driven Design](https://reader031.vdocuments.site/reader031/viewer/2022020213/587a7b8d1a28abf0468b60bf/html5/thumbnails/5.jpg)
The so!ware design is not complete until it has been coded and testedTesting is part of the process of refining the design
Jack W. ReevesWhat is Software Design? The C++ Journal Vol. 2, No. 2. 1992http://user.it.uu.se/~carle/softcraft/notes/Reeve_SourceCodeIsTheDesign.pdf
![Page 6: Test Driven Design](https://reader031.vdocuments.site/reader031/viewer/2022020213/587a7b8d1a28abf0468b60bf/html5/thumbnails/6.jpg)
ProgrammingSource Code
SOFTWARE DESIGN
Test andVerification
![Page 7: Test Driven Design](https://reader031.vdocuments.site/reader031/viewer/2022020213/587a7b8d1a28abf0468b60bf/html5/thumbnails/7.jpg)
The very first value of so!ware is…
Robert C. MartinAuthor of Clean Code and Clean CoderOwner of cleancoders.com training site
![Page 8: Test Driven Design](https://reader031.vdocuments.site/reader031/viewer/2022020213/587a7b8d1a28abf0468b60bf/html5/thumbnails/8.jpg)
The very first value of so!ware is to tolerate and facilitate on-going changes
Robert C. MartinAuthor of Clean Code and Clean CoderOwner of cleancoders.com training site
![Page 9: Test Driven Design](https://reader031.vdocuments.site/reader031/viewer/2022020213/587a7b8d1a28abf0468b60bf/html5/thumbnails/9.jpg)
Each city has to be renewed in order to meet the needs of its populace. So!ware-intensive systems are like that.
Grady Booch
Developed UMLWrote foreword to “Design Patterns” and “Technical Debt” books
Istanbul, TurkeyCredit: European Space Imaging
![Page 10: Test Driven Design](https://reader031.vdocuments.site/reader031/viewer/2022020213/587a7b8d1a28abf0468b60bf/html5/thumbnails/10.jpg)
ProgrammingSource Code
SOFTWARE DESIGN
Refactoring
Test andVerification
![Page 11: Test Driven Design](https://reader031.vdocuments.site/reader031/viewer/2022020213/587a7b8d1a28abf0468b60bf/html5/thumbnails/11.jpg)
Everything is part of the design process
Jack W. ReevesWhat is Software Design? The C++ Journal Vol. 2, No. 2. 1992http://user.it.uu.se/~carle/softcraft/notes/Reeve_SourceCodeIsTheDesign.pdf
![Page 12: Test Driven Design](https://reader031.vdocuments.site/reader031/viewer/2022020213/587a7b8d1a28abf0468b60bf/html5/thumbnails/12.jpg)
but… we develop
without driving
the design
![Page 13: Test Driven Design](https://reader031.vdocuments.site/reader031/viewer/2022020213/587a7b8d1a28abf0468b60bf/html5/thumbnails/13.jpg)
nebulaconcepts and terminology trigger ideas about the design
what we really do in general…
![Page 14: Test Driven Design](https://reader031.vdocuments.site/reader031/viewer/2022020213/587a7b8d1a28abf0468b60bf/html5/thumbnails/14.jpg)
proto-starinitial classes containing the logic
simple structure, basic domain model and behaviors
![Page 15: Test Driven Design](https://reader031.vdocuments.site/reader031/viewer/2022020213/587a7b8d1a28abf0468b60bf/html5/thumbnails/15.jpg)
brown dwarfbasic dependencies, works as we expect
utility classes start to occur
![Page 16: Test Driven Design](https://reader031.vdocuments.site/reader031/viewer/2022020213/587a7b8d1a28abf0468b60bf/html5/thumbnails/16.jpg)
main sequence starneedless complexity starts, a lot of inter-dependencies
manual testing starts to take longer time than usual
![Page 17: Test Driven Design](https://reader031.vdocuments.site/reader031/viewer/2022020213/587a7b8d1a28abf0468b60bf/html5/thumbnails/17.jpg)
hard to add new features too much debugging
too many workarounds too complex to know every flow
red giant
![Page 18: Test Driven Design](https://reader031.vdocuments.site/reader031/viewer/2022020213/587a7b8d1a28abf0468b60bf/html5/thumbnails/18.jpg)
blue-white super giant
single change affects many areas, no reuse - duplication hell,
fragile system - unstable prod scary refactoring,
silos occur
![Page 19: Test Driven Design](https://reader031.vdocuments.site/reader031/viewer/2022020213/587a7b8d1a28abf0468b60bf/html5/thumbnails/19.jpg)
red super gianthuge classes, tons of workarounds, no new features, maintenance mode rules, basic implementations take weeks, no one knows how overall system works, rollbacks a!er deployments, architect saves the company
![Page 20: Test Driven Design](https://reader031.vdocuments.site/reader031/viewer/2022020213/587a7b8d1a28abf0468b60bf/html5/thumbnails/20.jpg)
![Page 21: Test Driven Design](https://reader031.vdocuments.site/reader031/viewer/2022020213/587a7b8d1a28abf0468b60bf/html5/thumbnails/21.jpg)
![Page 22: Test Driven Design](https://reader031.vdocuments.site/reader031/viewer/2022020213/587a7b8d1a28abf0468b60bf/html5/thumbnails/22.jpg)
supernovaemployee turnovers,
frustrated management, blame & fight
![Page 23: Test Driven Design](https://reader031.vdocuments.site/reader031/viewer/2022020213/587a7b8d1a28abf0468b60bf/html5/thumbnails/23.jpg)
black holedeadly loop of total rewrite or exit from the market
![Page 24: Test Driven Design](https://reader031.vdocuments.site/reader031/viewer/2022020213/587a7b8d1a28abf0468b60bf/html5/thumbnails/24.jpg)
ProgrammingSource Code
SOFTWARE DESIGN
Refactoring
Test andVerification
![Page 25: Test Driven Design](https://reader031.vdocuments.site/reader031/viewer/2022020213/587a7b8d1a28abf0468b60bf/html5/thumbnails/25.jpg)
ProgrammingSource Code
SOFTWARE DESIGN
Refactoring
good?
Test andVerification
![Page 26: Test Driven Design](https://reader031.vdocuments.site/reader031/viewer/2022020213/587a7b8d1a28abf0468b60bf/html5/thumbnails/26.jpg)
COUPLINGWhen readfile() is changed, do you change writeFile() too? It shows how many places we need to change
![Page 27: Test Driven Design](https://reader031.vdocuments.site/reader031/viewer/2022020213/587a7b8d1a28abf0468b60bf/html5/thumbnails/27.jpg)
Two elements are loosely coupled if they are not shown in the same diff
Kent BeckThe creator of extreme programmingOne of the signatories of the Agile ManifestoPioneered software design patterns and TDD
![Page 28: Test Driven Design](https://reader031.vdocuments.site/reader031/viewer/2022020213/587a7b8d1a28abf0468b60bf/html5/thumbnails/28.jpg)
COHESIONDo you search a lot where to change? It shows how easy to find the places we need to change
![Page 29: Test Driven Design](https://reader031.vdocuments.site/reader031/viewer/2022020213/587a7b8d1a28abf0468b60bf/html5/thumbnails/29.jpg)
How many files at any one time is still open for edit shows the level of cohesion
Nat PryceCo-Author of Growing Object-Oriented Software Guided by TestsEarly adopter of XP
![Page 30: Test Driven Design](https://reader031.vdocuments.site/reader031/viewer/2022020213/587a7b8d1a28abf0468b60bf/html5/thumbnails/30.jpg)
ProgrammingSource Code
SOFTWARE DESIGN
RefactoringLow Coupling
Test andVerification
High Cohesion
![Page 31: Test Driven Design](https://reader031.vdocuments.site/reader031/viewer/2022020213/587a7b8d1a28abf0468b60bf/html5/thumbnails/31.jpg)
ProgrammingSource Code
SOFTWARE DESIGN
Refactoring
is hard and needs discipline!Test andVerification
Test Driven
High CohesionLow Coupling
![Page 32: Test Driven Design](https://reader031.vdocuments.site/reader031/viewer/2022020213/587a7b8d1a28abf0468b60bf/html5/thumbnails/32.jpg)
ProgrammingSource Code
Test andVerification
SOFTWARE DESIGN
Refactoring
Test Driven
High CohesionLow Coupling
![Page 33: Test Driven Design](https://reader031.vdocuments.site/reader031/viewer/2022020213/587a7b8d1a28abf0468b60bf/html5/thumbnails/33.jpg)
ProgrammingSource Code
Test andVerification
SOFTWARE DESIGN
Refactoring
Test Driven
High CohesionLow Coupling
![Page 34: Test Driven Design](https://reader031.vdocuments.site/reader031/viewer/2022020213/587a7b8d1a28abf0468b60bf/html5/thumbnails/34.jpg)
ProgrammingSource Code
Test andVerification
SOFTWARE DESIGN
Refactoring
Test Driven
High CohesionLow Coupling
![Page 35: Test Driven Design](https://reader031.vdocuments.site/reader031/viewer/2022020213/587a7b8d1a28abf0468b60bf/html5/thumbnails/35.jpg)
ProgrammingSource Code
Test andVerification
SOFTWARE DESIGN
Refactoring
Test Driven
High CohesionLow Coupling
![Page 36: Test Driven Design](https://reader031.vdocuments.site/reader031/viewer/2022020213/587a7b8d1a28abf0468b60bf/html5/thumbnails/36.jpg)
ProgrammingSource Code
Test andVerification
SOFTWARE DESIGN
Refactoring
Test Driven
High CohesionLow Coupling
![Page 37: Test Driven Design](https://reader031.vdocuments.site/reader031/viewer/2022020213/587a7b8d1a28abf0468b60bf/html5/thumbnails/37.jpg)
ProgrammingSource Code
Test andVerification
SOFTWARE DESIGN
Refactoring
Test Driven
High CohesionLow Coupling
![Page 38: Test Driven Design](https://reader031.vdocuments.site/reader031/viewer/2022020213/587a7b8d1a28abf0468b60bf/html5/thumbnails/38.jpg)
ProgrammingSource Code
Test andVerification
SOFTWARE DESIGN
Refactoring
Test Driven
High CohesionLow Coupling
![Page 39: Test Driven Design](https://reader031.vdocuments.site/reader031/viewer/2022020213/587a7b8d1a28abf0468b60bf/html5/thumbnails/39.jpg)
ProgrammingSource Code
Test andVerification
SOFTWARE DESIGN
Refactoring
Test Driven
High CohesionLow Coupling
![Page 40: Test Driven Design](https://reader031.vdocuments.site/reader031/viewer/2022020213/587a7b8d1a28abf0468b60bf/html5/thumbnails/40.jpg)
Unit testing frameworks Mocking frameworks Automated testing types Design principles Refactoring techniques Clean code principles
LEARN
Continuous Integration Source code versioning Notification mechanism Code coverage monitoring
Practice TDD via katas Develop via TDD Acceptance testing via TDD Verify by behaviours via BDD
ESTABLISH
PERFORM
![Page 41: Test Driven Design](https://reader031.vdocuments.site/reader031/viewer/2022020213/587a7b8d1a28abf0468b60bf/html5/thumbnails/41.jpg)
Unit testing frameworks Mocking frameworks Automated testing types Design principles Refactoring techniques Clean code principles
LEARN
Continuous Integration Source code versioning Notification mechanism Code coverage monitoring
Practice TDD via katas Develop via TDD Acceptance testing via TDD Verify by behaviours via BDD
ESTABLISH
PERFORM
![Page 42: Test Driven Design](https://reader031.vdocuments.site/reader031/viewer/2022020213/587a7b8d1a28abf0468b60bf/html5/thumbnails/42.jpg)
Unit testing frameworks Mocking frameworks Automated testing types Design principles Refactoring techniques Clean code principles
LEARN
Continuous Integration Source code versioning Notification mechanism Code coverage monitoring
Practice TDD via katas Develop via TDD Acceptance testing via TDD Verify by behaviours via BDD
ESTABLISH
PERFORM
![Page 43: Test Driven Design](https://reader031.vdocuments.site/reader031/viewer/2022020213/587a7b8d1a28abf0468b60bf/html5/thumbnails/43.jpg)
Unit testing frameworks Mocking frameworks Automated testing types Design principles Refactoring techniques Clean code principles
LEARN
Continuous Integration Source code versioning Notification mechanism Code coverage monitoring
Practice TDD via katas Develop via TDD Acceptance testing via TDD Verify by behaviours via BDD
ESTABLISH
PERFORM
![Page 44: Test Driven Design](https://reader031.vdocuments.site/reader031/viewer/2022020213/587a7b8d1a28abf0468b60bf/html5/thumbnails/44.jpg)
small set of entities few lines in methods
follows OOP design guidelines simple design, names are the intensions
marbles
![Page 45: Test Driven Design](https://reader031.vdocuments.site/reader031/viewer/2022020213/587a7b8d1a28abf0468b60bf/html5/thumbnails/45.jpg)
If you really want to see something interesting:)
ursa minor and polaris
LEMi ORHAN ERGiN
![Page 46: Test Driven Design](https://reader031.vdocuments.site/reader031/viewer/2022020213/587a7b8d1a28abf0468b60bf/html5/thumbnails/46.jpg)
LEMi ORHAN ERGiNagile software craftsman @ acm
/lemiorhan lemiorhanergin.com @lemiorhan