GUERRA firstname.lastname@example.org ITA @emguerraMundoJ Architect + Researcher Frameworks SwingBean, Esfinge Experience Research JavaSE, JavaEE, JavaMEPatterns + Frameworks+ Agile + Tests + Design
some months latterborrow some money pay what you borrowed plus interest
some years latterborrow some money pay with your life!
some days latter
bad code was duplicatedmaintenancein this code is time-consuming people avoid reusing this code other classes became coupled with the bad design
some months latter
sometimesthere is noturn back
“Shipping first time code is like going intodebt. A little debt speeds development so longas it is paid back promptly with a rewrite...The danger occurs when the debt is notrepaid. Every minute spent on not-quite-rightcode counts as interest on that debt. Entireengineering organizations can be brought to astand-still under the debt load of anunconsolidated implementation, object-oriented or otherwise.” Ward Cunningham
Technical DebtAs soon as you payit, less work youneed to fix it!
Sometimes clients doesntFACTS know exactly what requirements they need in their software Design solutions based on one requirement can be different if others are consideredThese facts create a risk to deliverwrong software to the client!
Traditional software engineeruses he same approach of other types of engineering projects!
Identify all Create a Construct basedrequirements complete project on the project Deliver the Test to verify the software requirements
Cost of Change Curve Using traditional style, it is cheaper to change in theCOST beginning TIME
Traditional software engineer put a lot of effort on requirements and project to avoid changes!
But, didnt theysee the signs?
Expected!Unexpected... Due to bad communicationBecause market needs.
Agile softwaredevelopmenthas a distinct approach...
Instead of fightagainst changes ...
Agile software engineer focus onimplementation and tests to enable software to be changed easily!
Automated TestingMakes safe to changeDecouplingChanges are isolatedClean CodeChanges are more easy to make
Imagine if you could test-driven your life...
Why somepeople dont do that with their code?
Test DrivenDevelopmentis a development and design technique in which the tests are created before the production code.
TDD is a crazyidea that works! Kent BeckSoftware Engineering Radio Podcast
TDDCycle by Google
Add a Test design class interface + define expected behavior Make Test Passcreate actual behavior + most simple solution Refactor clean implemented code + adjust class design
All code is Guilty untl provenInnocent
How often people wash thedishes in a restaurant kitchen?
The next meal will take longerand be more expensive because we are cleaning the kitchen. What???
This feature that you areasking is expensive becausethe code is not clean and we will need to change it. Humm... OK...
Are your source code like this?
Is it better to Or to let dirtclean little by and mess little? accumulate?
Some dirt are hard to clean in the course of time! RememberTechnical Debt?
How to clean the source code?Refactoring
“Refactoring is a disciplinedtechnique for restructuring anexisting body of code, alteringits internal structure withoutchanging its external behavior.” Martin Fowler
Code Bad Smells Have you ever look to a piece of code which doesnt smell very nice?Code smell is anysymptom in thesource code that canindicate a problem!
In every step, the tests should be executed to verify if everything still working! Refactoring is performed in small steps to remove badsmells and reach the desired design
Using refactoring,the application design emerge according to its needs!
Is it not dangerous to change a wining team? No when you haveautomated unit tests!
Cost of Change Curve Agile practices keep l na the cost of change io constant in later dit tra phases of the projectCOST agile TIME
Shortiterations only works if your code is ready to change!
Dont try to predict future design requirements Work hard in your current needs and let design emerge