Testing in isolation
Who am I Giorgio Sironi Bachelor in Computer Engineering Advisor @ Allbus Zone Leader @ DZone
The format <ul>A little bit of theory; for ($i = 1; $i <= 3; $i++) { <ul>code in development; problem arises; refactoring ...
Requirement: TDD
Isolation <ul>Unit tests > functional, end-to-end ones <ul>simpler tests less paths to test faster localize defects </ul><...
Test Doubles in one phrase <ul><li>Dummy </li><ul><li>only passed around </li></ul><li>Stub </li><ul><li>returns canned re...
Let's begin... I told you there was little theory Follow at  https://github.com/giorgiosironi/testing-in-isolation
The solution for ClosedMail
If we extend it...
The solution for AddressBookGenerator
The solution for OrderRepository
References <ul>All the code seen today <ul>http://github.com/giorgiosironi/testing-in-isolation </ul>Integration tests are...
Thanks for your attention
Upcoming SlideShare
Loading in …5
×

Testing in isolation

2,506
-1

Published on

How to test in isolation from other objects, libraries (or other adapters) and the database

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

  • Be the first to like this

No Downloads
Views
Total Views
2,506
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
25
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Testing in isolation

  1. 1. Testing in isolation
  2. 2. Who am I Giorgio Sironi Bachelor in Computer Engineering Advisor @ Allbus Zone Leader @ DZone
  3. 3. The format <ul>A little bit of theory; for ($i = 1; $i <= 3; $i++) { <ul>code in development; problem arises; refactoring of the code; </ul>} </ul>
  4. 4. Requirement: TDD
  5. 5. Isolation <ul>Unit tests > functional, end-to-end ones <ul>simpler tests less paths to test faster localize defects </ul></ul>
  6. 6. Test Doubles in one phrase <ul><li>Dummy </li><ul><li>only passed around </li></ul><li>Stub </li><ul><li>returns canned results </li></ul><li>Mock </li><ul><li>expects some particular calls </li></ul><li>Fake </li><ul><li>implements the collaborator without hassles </li></ul></ul>
  7. 7. Let's begin... I told you there was little theory Follow at https://github.com/giorgiosironi/testing-in-isolation
  8. 8. The solution for ClosedMail
  9. 9. If we extend it...
  10. 10. The solution for AddressBookGenerator
  11. 11. The solution for OrderRepository
  12. 12. References <ul>All the code seen today <ul>http://github.com/giorgiosironi/testing-in-isolation </ul>Integration tests are a scam <ul>http://www.infoq.com/presentations/integration-tests-scam </ul>Growing object-oriented software, guided by tests <ul>http://www.growing-object-oriented-software.com/ </ul>Pattern of Enterprise Application Architecture by Fowler <ul>http://martinfowler.com/eaaCatalog/ </ul>Hexagonal architecture <ul>http://alistair.cockburn.us/Hexagonal+architecture </ul></ul>
  13. 13. Thanks for your attention
  1. A particular slide catching your eye?

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

×