$30 off During Our Annual Pro Sale. View Details »

Holding Down your Technical Debt with SonarQube

Holding Down your Technical Debt with SonarQube

Presentation slides about my talk during JEEConf 2014

Papapetrou Patroklos

May 23, 2014
Tweet

More Decks by Papapetrou Patroklos

Other Decks in Programming

Transcript

  1. Agenda • Code Quality (what, why, when and how?) •

    The seven axes of quality • Technical Debt • SonarQube Introduction • Demo time
  2. private String _ugly_name; private String ANOTHER_$UGLY___NAME; private static String am_i_static;

    public void please_work(ArrayList objects){ for (Object object : objects){ if (object == null){ String toString = object.toString(); } else am_i_static = object.toString(); doSomething(object); } } private void doSomething(Object object) throws NullPointerException { throw new NullPointerException(object.toString()); }
  3. What is code quality? “It’s an indicator about how quickly

    developers can add business value to a software system”
  4. When it's the right time to measure • From project's

    day #0 • Continuosly • Prevention vs post-actions • Prioritize and plan
  5. What we should measure; • Abstract numbers? (Almost) useless •

    Evolution through time? Definitely! • Metrics? Yes but which ones? • Welcome to the seven deadly sins of developers
  6. The seven axes of quality Design Duplications Documentation Com plexity

    Unit Tests Coding rules Potential Bug Technical Debt
  7. Technical Debt “If the debt grows large enough, eventually the

    company will spend more on servicing its debt than it invests in increasing the value of its other assets” Steve McConnell (Author of code complete)
  8. This is how the source code looks like when we

    don't pay off technical debt
  9. What is SonarQube; • Free & open source “Code Quality

    Platform” • Provides moment-in-time quality snapshots • Gives trends of lagging and leading indicators • Tracks developers’ seven deadly sins
  10. How it works? Reads and analyzes source code files Computes

    hundreds of metrics Associates them with analysis snapshots and stores them Shows the results in dashboards and widgets accessible by any browser
  11. SonarQube for everything... • Initially designed for Maven Java projects

    • Today supports more than 20 languages Commercial : ABAP, C, C++, Cobol, Natural, PL/SQL, Visual Basic Open Source : C++, C#, Flex, Groovy, Android, Javascript, PHP, Python, XML, Web(xhtml, jsp , jsf), Erlang
  12. For testers / QA stuff. Which parts of the system

    lack unit testing? … and for everyone For developers. Is my code “good”? How can I improve For architects. Is the initial design “broken”? How about complexity? For managers. Give me the numbers!!! Are we going up or down?
  13. The big picture Track and reduce Technical Debt on an

    ongoing basis. (Clean up kitchen every day)
  14. I have a dream… ...that one day code quality management

    will be as much as important and essential is today source code management