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

Help my Code Quality is not Manageable

Help my Code Quality is not Manageable

Slides from my talk @CodingSerbia 2014

Papapetrou Patroklos

October 17, 2014
Tweet

More Decks by Papapetrou Patroklos

Other Decks in Programming

Transcript

  1. Patroklos Papapetrou @ppapapetrou76
    Help! My Code Quality is
    not manageable
    #CodingSerbia #SonarQube

    View Slide

  2. Agenda
    ● Code Quality in a nutshell
    ● The seven axes of quality
    ● Technical Debt
    ● SonarQube in Action

    View Slide

  3. 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());
    }

    View Slide

  4. What is code quality?

    View Slide

  5. What is code quality?
    “It’s an indicator about how quickly
    developers can add business value to a
    software system”

    View Slide

  6. Why measure?
    Source code is the heart of every system

    View Slide

  7. Why measure?
    Developers don't write “new” software. They
    maintain “legacy” systems.

    View Slide

  8. Why measure?
    We, the developers are lazy monkeys

    View Slide

  9. The broken window theory

    View Slide

  10. What we should measure;
    ● Abstract numbers? (Almost) useless
    ● Evolution through time? Definitely!
    ● Metrics? Yes but which ones?
    ● Welcome to the seven axes of quality

    View Slide

  11. The seven axes of quality

    View Slide

  12. View Slide

  13. The seven axes of quality
    Design
    Duplications
    Documentation
    Com
    plexity
    Unit Tests
    Coding rules
    Potential Bug
    Technical Debt

    View Slide

  14. 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)

    View Slide

  15. This is how the source
    code looks like when we
    don't pay off technical debt

    View Slide

  16. 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 and
    Technical Debt

    View Slide

  17. How it works?

    View Slide

  18. SonarQube star Features
    Dashboards

    View Slide

  19. SonarQube star Features
    Historical Data

    View Slide

  20. SonarQube star Features
    Differential Views

    View Slide

  21. SonarQube star Features
    Components drilldown views

    View Slide

  22. SonarQube star Features
    Quality Gates

    View Slide

  23. DEMO TIME

    View Slide

  24. The big picture
    Track and reduce Technical Debt on an
    ongoing basis. (Clean up kitchen every day)

    View Slide

  25. The big picture
    Engage all devs from day #1
    (Not only mums wash the dishes )

    View Slide

  26. I have a dream…
    ...that one day code
    quality management
    will be as much as
    important and
    essential is today
    source code
    management

    View Slide

  27. Thank you
    ppapapetrou76
    @ppapapetrou76
    http://www.linkedin.com/in/ppapapetrou
    1

    View Slide