Skip to main content
JEE Conf



           Continuous Inspection
           Fight back the 7 deadly sins
           of the developer!




           Olivier Gaudin
           olivier.gaudin@sonarsource.com
           @gaudol
Back in old times
The genius
The super hero




Au fin fond de l'Univers, à des années
et des années-lumière de la Terre,
Veille celui que le gouvernement
intersidéral appelle quand il n'est plus
Capable de trouver une solution à
ses problèmes, quand il ne reste plus
Aucun espoir :

le Capitaine FLAM !
This is my toy
Fear of changes
Industrialisation has entered the game...

              ●   Project under version control
              ●   Project under continuous
                  integration
              ●   Technical and functional
                  traceability
What is the mission of today's developer ?




                 ?
Sustainable development
(Almost) Everything is maintenance !



       Creation of an
        application




   Maintenance
 of an application
Nothing is more important than code
But source code is nothing alone
Old times are over
Developing for others
Methodology
Transparency
Software factories evolve




        Makefile         Issue Tracker                 IDE                    Continuous
                                                   Refactoring                Inspection

 VI /              SCM               Continuous                  Unit Tests
Emacs                                Integration
Pushed by requirements
Configuration Manager

●   No change should be authorized to production
    system without being in configuration manager
●   The complete version of an application should
    be found easily in the source control manager
Pushed by requirements
Continuous Integration

●   Projects in SCM can be built by anybody at any
    time
●   Executing unit tests is part of the build process
●   The output of a build is an artifact “ready to
    be used”
●   If one of those requirements is not fulfilled,
    nothing is more important than fixing it
Pushed by requirements
Continuous Inspection

●   Any new code should ship with corresponding
    unit tests
●   No new method should exceed a pre-defined
    level of complexity
●   No cycle between packages should be
    introduced
●   ...
BUT...
Maturity steps should be followed

●   Insuring technical traceability
    Configuration Manager
●   Insuring functional traceability
    Issue Manager
●   Insuring build stability
    Continuous Integration
●   Insuring source code quality
    Continuous Inspection (Sonar)
The end does not justify the means


    Doing the right software




    Doing the software right
What is quality?




      « A well-written program is a program
     where the cost of implementing a feature
 is constant throughout the program's lifetime. »

                                        Itay Maman
How to measure quality ?
The technical debt
The 7 deadly sins
of the developer




                      Sins




                    Technical
                      Debt
The 7 deadly sins ?
Applied to source code

●   ?
●   ?
●   ?
●   ?
●   ?
●   ?
●   ?
The 7 deadly sins ?
Applied to source code

●   Duplications
●   Bad distribution of complexity
●   Spaghetti Design
●   Lack of unit tests
●   No coding standards
●   Potential bugs
●   Not enough or too many comments
The mission of Sonar




  Declare open the hunt of the
   developer's 7 deadly sins
The mission of Sonar
More seriously




Augment everybody's capability
 to reduce, reuse and recycle
         source code
Sonar: a reality




     6,000+        downloads per month (300 in 2008)

     1,300+        subscribers to mailing list

     60            plugins in the open source forge

     150,000       downloads


     X?,000        instances in the world
Demo
Sonar is only a tool !

●   What should happen in case new defects are
    added ?
●   How, when and who should make quality
    standards evolve ?
●   How to train new joiners ?
●   Any measure reported must be analysed
The « Done, Done, Done, Done »


●   Developed
●   Tested
●   Approved by the « Product
    Owner »
●   Technical debt under control
Roadmap 2012

Review                       Expand rules
Process                      and metrics
          Governance
          dashboards
                                        Sonar IDE
                        Quality of
 Track changes          Unit Tests
                                        PL/SQL
                       Code
                       Churn         Developer
                                     Cockpit
                         Sonar-cpd
           VB .NET                       ABAP 2.0
                       C++
Questions & Answers




      Thank You !
       http://www.sonarsource.org
       http://www.sonarsource.com