Download - Tdd01 a simple intro to tdd
![Page 1: Tdd01 a simple intro to tdd](https://reader033.vdocument.in/reader033/viewer/2022042714/554f3a64b4c90572088b4efc/html5/thumbnails/1.jpg)
A Simple Intro To
TDD
![Page 2: Tdd01 a simple intro to tdd](https://reader033.vdocument.in/reader033/viewer/2022042714/554f3a64b4c90572088b4efc/html5/thumbnails/2.jpg)
quick question
s to start!
![Page 3: Tdd01 a simple intro to tdd](https://reader033.vdocument.in/reader033/viewer/2022042714/554f3a64b4c90572088b4efc/html5/thumbnails/3.jpg)
had a client who knew what he
needed?
question 1
![Page 4: Tdd01 a simple intro to tdd](https://reader033.vdocument.in/reader033/viewer/2022042714/554f3a64b4c90572088b4efc/html5/thumbnails/4.jpg)
been in a project with no change in
requirements?
question 2
![Page 5: Tdd01 a simple intro to tdd](https://reader033.vdocument.in/reader033/viewer/2022042714/554f3a64b4c90572088b4efc/html5/thumbnails/5.jpg)
predicted every problem 3 months
in advance?
question 3
![Page 6: Tdd01 a simple intro to tdd](https://reader033.vdocument.in/reader033/viewer/2022042714/554f3a64b4c90572088b4efc/html5/thumbnails/6.jpg)
![Page 7: Tdd01 a simple intro to tdd](https://reader033.vdocument.in/reader033/viewer/2022042714/554f3a64b4c90572088b4efc/html5/thumbnails/7.jpg)
Agile Context of Testing1
![Page 8: Tdd01 a simple intro to tdd](https://reader033.vdocument.in/reader033/viewer/2022042714/554f3a64b4c90572088b4efc/html5/thumbnails/8.jpg)
respond to change!
![Page 9: Tdd01 a simple intro to tdd](https://reader033.vdocument.in/reader033/viewer/2022042714/554f3a64b4c90572088b4efc/html5/thumbnails/9.jpg)
A
B
![Page 10: Tdd01 a simple intro to tdd](https://reader033.vdocument.in/reader033/viewer/2022042714/554f3a64b4c90572088b4efc/html5/thumbnails/10.jpg)
A
BC
![Page 11: Tdd01 a simple intro to tdd](https://reader033.vdocument.in/reader033/viewer/2022042714/554f3a64b4c90572088b4efc/html5/thumbnails/11.jpg)
change
risk
![Page 12: Tdd01 a simple intro to tdd](https://reader033.vdocument.in/reader033/viewer/2022042714/554f3a64b4c90572088b4efc/html5/thumbnails/12.jpg)
reduce the risk!
![Page 13: Tdd01 a simple intro to tdd](https://reader033.vdocument.in/reader033/viewer/2022042714/554f3a64b4c90572088b4efc/html5/thumbnails/13.jpg)
reduce the risk!
use the agile iterative cycle
![Page 14: Tdd01 a simple intro to tdd](https://reader033.vdocument.in/reader033/viewer/2022042714/554f3a64b4c90572088b4efc/html5/thumbnails/14.jpg)
reduce the risk!
test continuously
fast feedback
![Page 15: Tdd01 a simple intro to tdd](https://reader033.vdocument.in/reader033/viewer/2022042714/554f3a64b4c90572088b4efc/html5/thumbnails/15.jpg)
![Page 16: Tdd01 a simple intro to tdd](https://reader033.vdocument.in/reader033/viewer/2022042714/554f3a64b4c90572088b4efc/html5/thumbnails/16.jpg)
know what works at any given
moment
![Page 17: Tdd01 a simple intro to tdd](https://reader033.vdocument.in/reader033/viewer/2022042714/554f3a64b4c90572088b4efc/html5/thumbnails/17.jpg)
![Page 18: Tdd01 a simple intro to tdd](https://reader033.vdocument.in/reader033/viewer/2022042714/554f3a64b4c90572088b4efc/html5/thumbnails/18.jpg)
![Page 19: Tdd01 a simple intro to tdd](https://reader033.vdocument.in/reader033/viewer/2022042714/554f3a64b4c90572088b4efc/html5/thumbnails/19.jpg)
Types of Tests2
![Page 20: Tdd01 a simple intro to tdd](https://reader033.vdocument.in/reader033/viewer/2022042714/554f3a64b4c90572088b4efc/html5/thumbnails/20.jpg)
Functional TestsExamples
Story TestsPrototypesSimulations
Unit TestsComponent Tests
Exploratoy TestingScenarios
Usability TestingUATA/B
Performance & Load TestingSecurity Testing
“ility Testing”
Automated & Manual
Automated
Manual
Tools
Q2
Q3
Q1
Q4
Business Facing
Technology Facing
Supp
ortin
g th
e Te
am Critique Product
![Page 21: Tdd01 a simple intro to tdd](https://reader033.vdocument.in/reader033/viewer/2022042714/554f3a64b4c90572088b4efc/html5/thumbnails/21.jpg)
Functional TestsExamples
Story TestsPrototypesSimulations
Unit TestsComponent Tests
Exploratoy TestingScenarios
Usability TestingUATA/B
Performance & Load TestingSecurity Testing
“ility Testing”
Automated & Manual
Automated
Manual
Tools
Q2
Q3
Q1
Q4
Business Facing
Technology Facing
Supp
ortin
g th
e Te
am Critique Product
![Page 22: Tdd01 a simple intro to tdd](https://reader033.vdocument.in/reader033/viewer/2022042714/554f3a64b4c90572088b4efc/html5/thumbnails/22.jpg)
Coding
Unit TestingProgram Unit Design
Physical Design
Logical Design
User Requirements
Integration Testing
System Testing
AcceptanceTesting
Verifies
Verifies
Verifies
Verifies
![Page 23: Tdd01 a simple intro to tdd](https://reader033.vdocument.in/reader033/viewer/2022042714/554f3a64b4c90572088b4efc/html5/thumbnails/23.jpg)
hardexpensiveslow
easycheapfastmore
lessUI
Integration
Unit
![Page 24: Tdd01 a simple intro to tdd](https://reader033.vdocument.in/reader033/viewer/2022042714/554f3a64b4c90572088b4efc/html5/thumbnails/24.jpg)
What Is A Unit Test?3
![Page 25: Tdd01 a simple intro to tdd](https://reader033.vdocument.in/reader033/viewer/2022042714/554f3a64b4c90572088b4efc/html5/thumbnails/25.jpg)
Unit Tests
•Tests a single unit of code (typically a method)•Tests the unit of code in ISOLATION•Tests that the code behaves as expected
![Page 26: Tdd01 a simple intro to tdd](https://reader033.vdocument.in/reader033/viewer/2022042714/554f3a64b4c90572088b4efc/html5/thumbnails/26.jpg)
Unit Tests
• It’s still code•Code that tests code
•Exercise SUT, check behaviour
•Concepts: Test Class, Test Method
![Page 27: Tdd01 a simple intro to tdd](https://reader033.vdocument.in/reader033/viewer/2022042714/554f3a64b4c90572088b4efc/html5/thumbnails/27.jpg)
Test Structure
![Page 28: Tdd01 a simple intro to tdd](https://reader033.vdocument.in/reader033/viewer/2022042714/554f3a64b4c90572088b4efc/html5/thumbnails/28.jpg)
AAA
ARRANGE
ACT
ASSERT
![Page 29: Tdd01 a simple intro to tdd](https://reader033.vdocument.in/reader033/viewer/2022042714/554f3a64b4c90572088b4efc/html5/thumbnails/29.jpg)
Test Structure
ARRANGE
ACT
ASSERT
![Page 30: Tdd01 a simple intro to tdd](https://reader033.vdocument.in/reader033/viewer/2022042714/554f3a64b4c90572088b4efc/html5/thumbnails/30.jpg)
Unit Tests
•Should be fast (< 10 ms)•Should be consistent (same result always)•Should run in memory (no db, file access)•Should run in any order (no dependencies on other tests)
![Page 31: Tdd01 a simple intro to tdd](https://reader033.vdocument.in/reader033/viewer/2022042714/554f3a64b4c90572088b4efc/html5/thumbnails/31.jpg)
Impacts
•Fast Feedback•Cleaner design •Code and componente decoupling•Confidence•Executable documentation, with usage samples•Reduce regression
![Page 32: Tdd01 a simple intro to tdd](https://reader033.vdocument.in/reader033/viewer/2022042714/554f3a64b4c90572088b4efc/html5/thumbnails/32.jpg)
![Page 33: Tdd01 a simple intro to tdd](https://reader033.vdocument.in/reader033/viewer/2022042714/554f3a64b4c90572088b4efc/html5/thumbnails/33.jpg)
TDD vs. Unit Testing4
![Page 34: Tdd01 a simple intro to tdd](https://reader033.vdocument.in/reader033/viewer/2022042714/554f3a64b4c90572088b4efc/html5/thumbnails/34.jpg)
unit testing is not TDD
![Page 35: Tdd01 a simple intro to tdd](https://reader033.vdocument.in/reader033/viewer/2022042714/554f3a64b4c90572088b4efc/html5/thumbnails/35.jpg)
TDDis
unit testing (in a particular order)
![Page 36: Tdd01 a simple intro to tdd](https://reader033.vdocument.in/reader033/viewer/2022042714/554f3a64b4c90572088b4efc/html5/thumbnails/36.jpg)
![Page 37: Tdd01 a simple intro to tdd](https://reader033.vdocument.in/reader033/viewer/2022042714/554f3a64b4c90572088b4efc/html5/thumbnails/37.jpg)
TDD in three steps
![Page 38: Tdd01 a simple intro to tdd](https://reader033.vdocument.in/reader033/viewer/2022042714/554f3a64b4c90572088b4efc/html5/thumbnails/38.jpg)
TDD isdifferent approach
to coding
![Page 39: Tdd01 a simple intro to tdd](https://reader033.vdocument.in/reader033/viewer/2022042714/554f3a64b4c90572088b4efc/html5/thumbnails/39.jpg)
Demo5
![Page 40: Tdd01 a simple intro to tdd](https://reader033.vdocument.in/reader033/viewer/2022042714/554f3a64b4c90572088b4efc/html5/thumbnails/40.jpg)
https://github.com/MiguelAlho/TddCalculator
![Page 41: Tdd01 a simple intro to tdd](https://reader033.vdocument.in/reader033/viewer/2022042714/554f3a64b4c90572088b4efc/html5/thumbnails/41.jpg)
References6
![Page 42: Tdd01 a simple intro to tdd](https://reader033.vdocument.in/reader033/viewer/2022042714/554f3a64b4c90572088b4efc/html5/thumbnails/42.jpg)
Books
•Pragmatic Unit Testing In C# with Nunit•Growing software guided by tests•The art of unit Testing•Testable Javascript•Quality Code•Xunit Patterns
![Page 43: Tdd01 a simple intro to tdd](https://reader033.vdocument.in/reader033/viewer/2022042714/554f3a64b4c90572088b4efc/html5/thumbnails/43.jpg)