15
Josh Cummings Developer – Java Stack ICS Paying Off Your Technical Debt If you can read this, you don’t need glasses.

Paying Off Your Technical Debt

Embed Size (px)

Citation preview

Page 1: Paying Off Your Technical Debt

Josh CummingsDeveloper – Java StackICS

Paying Off YourTechnical Debt

If you can read this, you don’t need glasses.

Page 2: Paying Off Your Technical Debt

Halloween Costume – October 2009

Mein Kode

Page 3: Paying Off Your Technical Debt

Halloween Costumes – 2007-2010

The Phantom Reference

Photo courtesy of tinyfroglet at http://www.flickr.com/photos/tinyfroglet/2714250798/sizes/m/in/photostream/

Page 4: Paying Off Your Technical Debt

• Why pay down Technical Debt?

• Good debt vs. Bad Debt

• Managing Debt with Sonar

• Batch

• Server

• Priorities

• SDLC

• Technical Debt and the Stack

Goal

Page 5: Paying Off Your Technical Debt

• “Shipping first time code is like going into debt. A little debt speeds development so

long as it is paid back promptly with a rewrite... The danger occurs when the debt is not repaid. Every minute spent on not-quite-right code counts as interest on that debt. Entire engineering organizations can be brought to a stand-still under the debt load of an unconsolidated implementation, object-oriented or otherwise.”

- Ward Cunningham, 1992

Why pay it down?

Page 6: Paying Off Your Technical Debt

Good debt vs. Bad Debt

Unintentional Intentional

Good

• Long-term, for strategic reasons• Focused short-

term, for iterative reasons

Bad• How would it be to take out a loan

without realizing it?

• Unfocused short-term (credit card

debt)

You are fail

http://blogs.construx.com/blogs/stevemcc/archive/2007/11/01/technical-debt-2.aspx, Technical Debt

Rationale

• First to market

• Dependencies• The president says now

• Laziness• End of the day• Ignorance

Page 7: Paying Off Your Technical Debt

• Begun in 2008 by Freddy Mallet

• Active development and user community• 4000 downloads/month

• More than 30000 total downloads

• Dozens of plug-ins

• Started with the goal to assist development teams in paying off technical debt. Evolved into a development platform for many static analysis tools.

Enter Sonar

PortfolioView

ProjectInsight

SourceCode

Action Plans

Page 8: Paying Off Your Technical Debt

Sonar and the 5 Cs

Copy-paste

Complexity

CommentsQuality

Coverage

Page 9: Paying Off Your Technical Debt

• Start up local sonar, or point to a remote one.• Hint: There are deployments at code.lds.org and also at

sonar.ldschurch.org that you can point to.

• Issue the command ‘mvn sonar:sonar’ either from the command-line or from Eclipse. Don’t forget to use Maven 2.

• Wait patiently.

• Once complete, go to http://localhost:9000 to view your results.

Batch – Analyzing your project If you do this, the Stack’s plug-ins will run automatically against your project.

Page 10: Paying Off Your Technical Debt

• Invoking third-party tools• In order to make version compatibility easier, Sonar issues

the appropriate maven goal for each third-party tool instead of invoking it directly in their respective plug-ins.

• The basic plug-in’s purpose is narrowed down to translating third-party tool’s output into Sonar input.

• Some plug-ins do invoke their respective tool inline.

• Other tools raise Sonar’s awareness to other languages

• Aggregating information• Some plug-ins, like PMD and FindBugs, are natural

candidates for aggregation and filtering. Sonar provides Quality Profiles to allow the coder to fine-tune what actually gets reported on the dashboard.

Batch – Analyzing your project

Page 11: Paying Off Your Technical Debt

• Coverage: Clover, Cobertura, Emma

• Quality: Checkstyle, FindBugs, PMD

• Comments

• Copy-paste

• Complexity: LCOM4, RFC, Cyclometric, Dependencies

Server – Analyzing your project

Page 12: Paying Off Your Technical Debt

• Time Machine: Trends

• Clouds: Big word = Big problem

• Hotspots: Quick Wins

• Alerts: Thresholds

Server – Analyzing your project

Page 13: Paying Off Your Technical Debt

• Sonar Eclipse Plugin

When does bad debt get noticed?

Static Analysis typically happens here

It would be nice if it were over here.

Page 14: Paying Off Your Technical Debt

• Plug-ins• XML rules – Maven, Spring, Tomcat

• CSS rules

• Integration test coverage

• HTML

• JavaScript

• Maven dependency analysis

Sonar and the Stack

Not yet

Here today

Page 15: Paying Off Your Technical Debt

• Add your project today ICS’s Sonar dashboard• Community Deployment: http://code.lds.org/sonar

• Internal Deployment: http://sonar.ldschurch.org

• Download Sonar 2.2 at http://sonar.codehaus.org

• Read about my Sonar exploits at http://tech.joshuacummings.com

Thank you!

Do it!