A Simple Intro To
quick
questions
to start!
had a client who
knew what he
needed?
question 1
been in a project
with no change in
requirements?
question 2
predicted every
problem 3 months
in advance?
question 3
Agile Context
of Testing
respond to change!
A
B
A
B
C
change
risk
reduce the risk!
reduce the risk!
use the
agile
iterative
cycle
reduce the risk!
test
continuously
fast feedback
know what works at
any given moment
Types of Tests
Functional Tests
Examples
Story Tests
Prototypes
Simulations
Unit Tests
Component Tests
Exploratoy Testing
Scenarios
Usabi...
Functional Tests
Examples
Story Tests
Prototypes
Simulations
Unit Tests
Component Tests
Exploratoy Testing
Scenarios
Usabi...
Coding
Unit Testing
Program Unit
Design
Physical Design
Logical Design
User
Requirements
Integration
Testing
System Testin...
hard
expensive
slow
easy
cheap
fast
more
less
UI
Integration
Unit
What Is A
Unit Test?
Unit Tests
• Tests a single unit of code (typically a method)
• Tests the unit of code in ISOLATION
• Tests that the code ...
Unit Tests
• It’s still code
• Code that tests code
• Exercise SUT, check behaviour
• Concepts: Test Class, Test Method
Test Structure
ARRANGE ACT ASSERT
Test Structure
ARRANGE
ACT
ASSERT
Unit Tests
• Should be fast (< 10 ms)
• Should be consistent (same result always)
• Should run in memory (no db, file acce...
Impacts
• Fast Feedback
• Cleaner design
• Code and componente decoupling
• Confidence
• Executable documentation, with us...
TDD vs.
Unit Testing
unit testing
is not
TDD
TDD
is
unit testing
(in a particular order)
TDD in
three
steps
TDD is
different approach
to coding
Demo
https://github.com/MiguelAlho/TddCalculator
References
Books
• Pragmatic Unit Testing In C# with Nunit
• Growing software guided by tests
• The art of unit Testing
• Testable Ja...
Tdd01 a simple intro to tdd
Tdd01 a simple intro to tdd
Tdd01 a simple intro to tdd
Tdd01 a simple intro to tdd
Tdd01 a simple intro to tdd
Tdd01 a simple intro to tdd
Tdd01 a simple intro to tdd
Upcoming SlideShare
Loading in...5
×

Tdd01 a simple intro to tdd

312

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
312
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
10
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Tdd01 a simple intro to tdd

  1. 1. A Simple Intro To
  2. 2. quick questions to start!
  3. 3. had a client who knew what he needed? question 1
  4. 4. been in a project with no change in requirements? question 2
  5. 5. predicted every problem 3 months in advance? question 3
  6. 6. Agile Context of Testing
  7. 7. respond to change!
  8. 8. A B
  9. 9. A B C
  10. 10. change risk
  11. 11. reduce the risk!
  12. 12. reduce the risk! use the agile iterative cycle
  13. 13. reduce the risk! test continuously fast feedback
  14. 14. know what works at any given moment
  15. 15. Types of Tests
  16. 16. Functional Tests Examples Story Tests Prototypes Simulations Unit Tests Component Tests Exploratoy Testing Scenarios Usability Testing UAT A/B Performance & Load Testing Security Testing “ility Testing” Automated & Manual Automated Manual Tools Q2 Q3 Q1 Q4 Business Facing Technology Facing SupportingtheTeam CritiqueProduct
  17. 17. Functional Tests Examples Story Tests Prototypes Simulations Unit Tests Component Tests Exploratoy Testing Scenarios Usability Testing UAT A/B Performance & Load Testing Security Testing “ility Testing” Automated & Manual Automated Manual Tools Q2 Q3 Q1 Q4 Business Facing Technology Facing SupportingtheTeam CritiqueProduct
  18. 18. Coding Unit Testing Program Unit Design Physical Design Logical Design User Requirements Integration Testing System Testing Acceptance Testing Verifies Verifies Verifies Verifies
  19. 19. hard expensive slow easy cheap fast more less UI Integration Unit
  20. 20. What Is A Unit Test?
  21. 21. 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
  22. 22. Unit Tests • It’s still code • Code that tests code • Exercise SUT, check behaviour • Concepts: Test Class, Test Method
  23. 23. Test Structure
  24. 24. ARRANGE ACT ASSERT
  25. 25. Test Structure ARRANGE ACT ASSERT
  26. 26. 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)
  27. 27. Impacts • Fast Feedback • Cleaner design • Code and componente decoupling • Confidence • Executable documentation, with usage samples • Reduce regression
  28. 28. TDD vs. Unit Testing
  29. 29. unit testing is not TDD
  30. 30. TDD is unit testing (in a particular order)
  31. 31. TDD in three steps
  32. 32. TDD is different approach to coding
  33. 33. Demo
  34. 34. https://github.com/MiguelAlho/TddCalculator
  35. 35. References
  36. 36. Books • Pragmatic Unit Testing In C# with Nunit • Growing software guided by tests • The art of unit Testing • Testable Javascript • Quality Code • Xunit Patterns
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×