TDD - do increasing and save...
-
Upload
sergei-khaletskiy -
Category
Technology
-
view
114 -
download
0
description
Transcript of TDD - do increasing and save...
TDD – do increasing and save...
Who I am?
Programmer at Wargaming.net~ 5 years php experience
Disclaimer
TDD - ?...
TDD this is...
...or this?! Do you know it?
Expectations...
Reality...
Why not?...
TDD? And who will
pay for it?
TDD does not work
everywhere
Good thing! But
we release
very soon
Stress-free!
0 1 2 3 4 5 6 70
2
4
6
8
10
12
Plain
TDD
Why is that?...
- Start immediately- Test First- SOLID/Patterns- Less coupled systems- Stress control. Results are obvious ...
Test First...
SOLID
Single Responsibility
Open/Closed
Liskov Substitution
Interface Segregation
Dependency Inversion
Single Responsibility: Test
Data - What does know? - Relations between objects?Behavior - What problems resolve? - Services?
Open/Closed: Test
- No need to change working code
Liskov Substitution: Test
- Tests can use to check the heirs instead ancestors- In case of violation of unit tests are complicated
Interface Segregation: Test
- Tests help to split the interfaces- Mocks dictates API
Dependency Inversion:TDD
- Service Locator or Dependency Injection?- Mocks in TDD create abstractions- Setting tests easier with Dependency Injection
TDD +/-- Confidence in the code to run- No code to Thrash- New solutions approves more quickly- New lever of your skills
- Slow refactoring- Tests are difficult - Doesn't work everywhere- Tests refactoring- TDD for bad smells code
FAQ...
- How many tests must be written?- TDD for existing projects- Must read
Books...
- Kent Beck "Test Driven Development By Example"
- Martin Fowler "Refactoring: Improving the Design of Existing Code"
- Joshua Kerievsky "Refactoring To Patterns"
- Michael Feathers "Working Effectively with Legacy Code"
Questions?