Date post: | 18-Jul-2015 |
Category: |
Technology |
Upload: | tung-nguyen-thanh |
View: | 33 times |
Download: | 0 times |
2
I’m Stanly
• Lives in Singapore!• Agile coach, SW developer!• Worked in small to large
companies!• Experienced in Insurance, Mobile
Safety, Education, Logistics and Banking!
• Java, .Net, JavaScript, Objective-C
9
It is not a unit test when: • It talks to the database!• It communicates across the network!• It touches the file system!• It can't run at the same time
as any of your other unit tests!• You have to do special things to your
environment (such as editing config files) to run it.
Michael Feathers
15
amount of bad
code
panic
amount of code
smells
time spend on
bug fixing
motivation
developers
quick hacks
opportunity for
# of bugs
indicates
O
refactoring
O
24
James Grenning
“Software change is part of being a developer, so you better get used to it. !Even more, you better get good at it!”
26
Modern engineering practices
26
Test-Driven Development
Refactoring
Continuous Integration
Emergent Design
27
Test-driven development • Increments of functionality!• Always in working state
Code and fix • Large functionalities!• Long time to get to a working statef
t
The Legacy Code Dilemma
30
When we change code, we should have tests in place. To put tests in place, we often have to change code.
But I don't understand the code well enough to change It =(
31
Scratch RefactoringNotes/Sketching
Delete Unused Code
Legacy code algorithm
32
1. Identify change point!2. Find test points!3. Break dependencies!4. Write tests!5. Make changes and refactor
Exercise:!Dependency Breaking!Characterisation Tests!
!
http://bit.ly/FightLegacyCode
33