Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
How To Clean Your Dirty CodeAnd Why It MattersJonatan Jönsson2012-12-10jonatan.jonsson@softhouse.se
Who am I?
Reusable Designs
Reusable Modules
Dirty Versus Clean Code                 What does it display?    Red/Green        Red/Blue            Green/Red01
Dirty Versus Clean Code                 What does it display?    Red/Green        Red/Blue            Green/Red01
Naming Is Important
Is This You?
Which Square Fits Your Product?
Total Rewrite Cycle
Iterative Refactoring
Beware of False Sense of Confidence            http://www.eclemma.org
If It’s Not Tested, Assume It’s Broken             http://www.pitest.org
See Every Part of Your Code As an API •   Easy to use right, hard (preferably impossible) to misuse •   Easy to evolve •  ...
Readable Test?
Builder Pattern To the Rescue
Fail Fast - Preferably at Compile-timeBad: doSomeActionThatRequiresAuthenticatedUser(User authenticatedUser)Good: doSomeAc...
Don’t Make the Client Do Anything the         Module Could Do
Using the Right Data TypeUsing a list            Using a set
Using the Right Data Type    http://code.google.com/p/caliper/
Packaging By-Layer vs By-Feature     By Layer      By Feature
The Ultimate Benchmark of Modularization
What Tools Are You Using?
What Tools Are You Using?      Eclipse Refactoring Support
Peer Review - Pair Programming
Peer Review - Code Reviews                http://code.google.com/p/gerrit/
(c)lean tribejonatan.jonsson@softhouse.se
Recommended Reading
Referenceshttp://www.osnews.com/story/19266/WTFs_m - WTFs per minute cartoonhttp://jester.sourceforge.net/ - Test coverage...
Upcoming SlideShare
Loading in …5
×

How to clean your dirty code | Jonatan Jönsson | LTG-12

1,646 views

Published on

Presentation at Lean Tribe Gathering 12 in Växjö, 10 dec 2012.

Published in: Business
  • Be the first to comment

How to clean your dirty code | Jonatan Jönsson | LTG-12

  1. 1. How To Clean Your Dirty CodeAnd Why It MattersJonatan Jönsson2012-12-10jonatan.jonsson@softhouse.se
  2. 2. Who am I?
  3. 3. Reusable Designs
  4. 4. Reusable Modules
  5. 5. Dirty Versus Clean Code What does it display? Red/Green Red/Blue Green/Red01
  6. 6. Dirty Versus Clean Code What does it display? Red/Green Red/Blue Green/Red01
  7. 7. Naming Is Important
  8. 8. Is This You?
  9. 9. Which Square Fits Your Product?
  10. 10. Total Rewrite Cycle
  11. 11. Iterative Refactoring
  12. 12. Beware of False Sense of Confidence http://www.eclemma.org
  13. 13. If It’s Not Tested, Assume It’s Broken http://www.pitest.org
  14. 14. See Every Part of Your Code As an API • Easy to use right, hard (preferably impossible) to misuse • Easy to evolve • The cleanliness of your tests reflects the quality of your API • Be as small as possible, ”when in doubt leave it out”, Joshua Bloch
  15. 15. Readable Test?
  16. 16. Builder Pattern To the Rescue
  17. 17. Fail Fast - Preferably at Compile-timeBad: doSomeActionThatRequiresAuthenticatedUser(User authenticatedUser)Good: doSomeAction(AuthenticatedUser user)
  18. 18. Don’t Make the Client Do Anything the Module Could Do
  19. 19. Using the Right Data TypeUsing a list Using a set
  20. 20. Using the Right Data Type http://code.google.com/p/caliper/
  21. 21. Packaging By-Layer vs By-Feature By Layer By Feature
  22. 22. The Ultimate Benchmark of Modularization
  23. 23. What Tools Are You Using?
  24. 24. What Tools Are You Using? Eclipse Refactoring Support
  25. 25. Peer Review - Pair Programming
  26. 26. Peer Review - Code Reviews http://code.google.com/p/gerrit/
  27. 27. (c)lean tribejonatan.jonsson@softhouse.se
  28. 28. Recommended Reading
  29. 29. Referenceshttp://www.osnews.com/story/19266/WTFs_m - WTFs per minute cartoonhttp://jester.sourceforge.net/ - Test coverage toolhttp://en.wikipedia.org/wiki/Mutation_testingHow To Design A Good API and Why it Matters - Joshua Bloch

×