Test-driven
development with
SonarQube
Nanthakumar Suvethan
Software Engineer
Duo Software
Why Software Quality
What is Software Quality
Characteristic of Quality Code
● Easily understandable as it is some text
● Self explanatory
● Uses a simple syntax
● Efficient, Robust, portable, Reusable, Secure, Maintainable
● short, focused units
● Highly Cohesive / Loosely Coupled
● Comment and document the code in necessary situations
● Put everything under version control
Developer's 7 Deadly Sins
1. Duplications
2. Coding standards
3. Lack of coverage
4. Potential bugs
5. Complexity
6. Documentation
7. Design
Who sets standards?
Code Analysis
How to Avoid These Mistakes?
● Code Reviews (manual)
○ Expensive
○ Error Prone
● Use Tools (automated)
○ “Static Code Analysis”
■ is a method of computer program debugging that is done by examining the code
without executing the program.
SonarQube™
● Static Code Analyzer
● Open Source ( Community Edition )
● Web based application
● Covered more than 20 programing languages
● Extendable with plugins
● Out of the box integration to
○ Eclipse, Maven, Ant, SVN, Git, JIRA, Google Analytics…
● Covers the Seven Axes of Quality, also known as
○ “Developers’ Seven Deadly Sins”
Static code analysis usage by
developers
Demo
Continues Code Quality Process
GIT + Jenkins + SonarQube
http://suvethann.blogspot.com/2018/05/integrating-sonarqube-with-jenkins-php.html
“Code Quality is a Religion”
Based on Faith
Beyond Rules

Test driven development with sonarQube

  • 1.
  • 2.
  • 3.
  • 4.
    Characteristic of QualityCode ● Easily understandable as it is some text ● Self explanatory ● Uses a simple syntax ● Efficient, Robust, portable, Reusable, Secure, Maintainable ● short, focused units ● Highly Cohesive / Loosely Coupled ● Comment and document the code in necessary situations ● Put everything under version control
  • 5.
    Developer's 7 DeadlySins 1. Duplications 2. Coding standards 3. Lack of coverage 4. Potential bugs 5. Complexity 6. Documentation 7. Design
  • 7.
  • 8.
  • 9.
    How to AvoidThese Mistakes? ● Code Reviews (manual) ○ Expensive ○ Error Prone ● Use Tools (automated) ○ “Static Code Analysis” ■ is a method of computer program debugging that is done by examining the code without executing the program.
  • 10.
    SonarQube™ ● Static CodeAnalyzer ● Open Source ( Community Edition ) ● Web based application ● Covered more than 20 programing languages ● Extendable with plugins ● Out of the box integration to ○ Eclipse, Maven, Ant, SVN, Git, JIRA, Google Analytics… ● Covers the Seven Axes of Quality, also known as ○ “Developers’ Seven Deadly Sins”
  • 11.
    Static code analysisusage by developers
  • 12.
  • 13.
    Continues Code QualityProcess GIT + Jenkins + SonarQube http://suvethann.blogspot.com/2018/05/integrating-sonarqube-with-jenkins-php.html
  • 14.
    “Code Quality isa Religion” Based on Faith Beyond Rules

Editor's Notes

  • #4 Safety – Poor quality in software can be hazardous to human life and safety. Quality problems can impact the functionality of the software products. Cost – Quality issues cost money to fix.  Whether you believe that a defect is 100x more costly to fix late in the development cycle or not, doing work over because it is defective does not deliver more value than doing it right once. Customer Satisfaction (internal) – Poor quality leads stakeholders to look for someone else to do your job or perhaps shipping your job and all your friend’s jobs somewhere else. Customer Satisfaction (external) – Software products that don’t work, are hard to use (when they don’t need to be), or are buggy don’t tend not to last long in the marketplace. Future Value – Avoiding quality problems increases the amount of time available for the next project or the next set of features.  Increasing quality also improves team morale, improved team morale is directly correlated with increased productivity (which will increase customer satisfaction and reduce cost).  
  • #8 Consortium for IT Software Quality The Consortium for IT Software Quality is an IT industry leadership group that develops international standards for automating the measurement of software size and software structural quality from system source code. Object Management Group The mission of the Object Management Group (OMG) is to develop technology standards that provide real-world value for thousands of vertical industries Software Engineering Institute Carnegie Mellon The Leader in Software Engineering and Cybersecurity