SlideShare a Scribd company logo
1 of 41
Continuous Inspection
of Code Quality
SonarQube: An Open Source - Code Analysis Platform
Emre Dündar
23.08.2017 – QAIst Meetup
Emre Dündar
 Release Manager @Product Development Unit
@Ericsson R&D - Turkey (2017 - ...)
 Configuration Engineer @SDLC Tools & DevOps Unit
@SoftTech (2014 - 2017)
www.linkedin.com/in/emredundar
emredundar.e@gmail.com
https://emredundar.github.io/
Continuous - X
• Continuous integration
• Continuous delivery
• Continuous testing
• Continuous deployment
• Continuous improvement
Continuous inspection
Continuous Inspection /
• A new approach to code quality management
• Code quality as a part of Software Development Life Cycle (SDLC)
• A clear view of software quality for all stakeholders
• Continuous feedback about software quality
• Obtaining the ability of better software development practices
Continuous Inspection /
... but how?
• On-the-fly: Fix issues before they exist.
• Integration: Analyse on the CI / DevOps pipeline.
• Quality Gates: Reject if not ok.
• Track issues: Track the issues on new code (who committed the issue?)
The value of continuous inspection is to find the issues
while it is easy and cheap to fix.
Continuous Inspection /
Continuous inspection of source code quality
Continuous Inspection /
... how?
Static code analysis
 Analyse source code without execution
 Generate software metrics
Software Metrics
... how to generate?
 Software metrics are generated by matching the measurable properties of software with
numbers.
... purpose?
 to measure software quality
 to find problematic units
 to predict the future of software product
Software Quality Metrics
 Subcomponents of software quality
 What & how to measure?
 Metric x Quality relations
Software Quality Model
Software Quality
Model
- McCall, J. A. (1977)
- Boehm (1978)
- Consortium for IT Software
Quality (CISQ)
- International Standards (ISO,
IEEE...)
Software Quality Metrics
Size metrics / lines of code, classes, functions, files...
Test metrics / unit tests, line coverage...
Complexity / cyclomatic complexity, complexity per function...
Duplications / duplicated blocks, duplicated lines (%)...
Issues / blocker, critical, major, minor, info / Code smells, bugs, vulnerabilities
Technical Debt /
Static Code Analysis
 Readable code
 Maintainable code
 Documented code
 Low complex code
 Coding standards
 High performance code
 Secure code
 Stable code
 Reviewed code
 Technical debt under control
 Clean code
Technical Debt
Kitchen metaphor
Day 1
Technical Debt
Kitchen metaphor
Day 2
Technical Debt
Who will clean?..
Software perspective:
Lack of time + new requests +
new bugs + ...
Does it work? Yes, go on...
Code quality must be the concern of all team,
not just some specialist.
.. there is a need for an assistant...
SonarQube is not just a tool, it is a platform.
Continuous code quality online
SonarQube: Architecture
- SonarQube Scanners don't need to be on the same network as the SonarQube Server.
- There is no communication between SonarQube Scanners and the SonarQube Database.
- SonarQube Scanners scale by adding machines.
SonarQube: Issue cycle
Languages / 20+
Java
JavaScript
PHP
Python
Web
Xml
Android
C#
C/C++ *
Objective-C *
Swift *
PL/SQL *
COBOL *
...
Overall Health
Look for general results…
Leak
Fix the leaks…
SonarQube
Scanners
 Maven
 Gradle
 Ant
 MSBuild
 Jenkins
 CLI
> mvn clean install sonar:sonar
> cd mySourceCode
> sonar-scanner -Dproject.settings=myproject.properties
SonarQube: Rules
Rulesets for each languages
3 main categories: Bugs, vulnerabilities, code smells.
Coding standards
 OWASP, CWE, CERT, MISRA... (Security vulnerabilities)
 Checkstyle (Conventions, coding rules)
 PMD (Bad practices, potential problems)
 FindBugs (Potential bugs)
 ......
http://localhost:9000/coding_rules#languages=java|severities=BLOCKER|types=BUG|tags=cert
Issues
 Code Smells
 Bugs
 Vulnerabilities
SonarQube on DevOps pipeline
SonarLint
 on-the-fly usage over IDEs
 Connect to your own
SonarQube server
 Working with online rulesets
http://www.sonarlint.org/
Pull Request
Github, TFS, Bitbucket
Quality Gates
Don’t get commits in from the
gate which brings new
vulnerabilities, high technical
debt, low code coverage…
https://next.sonarqube.com/sonarqube/quality_gates/show/7
Webhook - integrations
Trigger other systems via Webhooks
• Trigger an alerts
• Update a field
• Post a message to a chat room
• Send an e-mail
• Create a ticket
• ....
• Jira ticket
• Email
• Slack message
Demo: SonarQube
SonarQube, SonarLint, VisualStudio, VisualStudio Code, Eclipse, Gitlab, Jenkins, Slack...
References
• https://www.sonarsource.com/
• https://www.sonarqube.org/
• http://www.sonarlint.org/
• Continuous Inspection, Olivier Gaudin - https://www.sonarsource.com/resources/white-papers/continuous-
inspection.html
• Technical Debt, Patroklos Papapetrou - http://thinkapps.com/blog/tag/technical-debt/
• Metric definitions - https://docs.sonarqube.org/display/SONAR/Metric+Definitions
Contact info: www.linkedin.com/in/emredundar
emredundar.e@gmail.com
https://emredundar.github.io/
Emre Dündar

More Related Content

What's hot

Sonarqube
SonarqubeSonarqube
Sonarqube
Kalkey
 
Testing Tool Evaluation Criteria
Testing Tool Evaluation CriteriaTesting Tool Evaluation Criteria
Testing Tool Evaluation Criteria
basma_iti_1984
 

What's hot (20)

Tracking and improving software quality with SonarQube
Tracking and improving software quality with SonarQubeTracking and improving software quality with SonarQube
Tracking and improving software quality with SonarQube
 
Java Source Code Analysis using SonarQube
Java Source Code Analysis using SonarQubeJava Source Code Analysis using SonarQube
Java Source Code Analysis using SonarQube
 
Sonarqube
SonarqubeSonarqube
Sonarqube
 
Sonar Review
Sonar ReviewSonar Review
Sonar Review
 
Sonarqube
SonarqubeSonarqube
Sonarqube
 
Track code quality with SonarQube - short version
Track code quality with SonarQube - short versionTrack code quality with SonarQube - short version
Track code quality with SonarQube - short version
 
The story of SonarQube told to a DevOps Engineer
The story of SonarQube told to a DevOps EngineerThe story of SonarQube told to a DevOps Engineer
The story of SonarQube told to a DevOps Engineer
 
Sonar qube
Sonar qubeSonar qube
Sonar qube
 
Managing code quality with SonarQube
Managing code quality with SonarQubeManaging code quality with SonarQube
Managing code quality with SonarQube
 
SonarQube Presentation.pptx
SonarQube Presentation.pptxSonarQube Presentation.pptx
SonarQube Presentation.pptx
 
Static code analysis with sonar qube
Static code analysis with sonar qubeStatic code analysis with sonar qube
Static code analysis with sonar qube
 
Sonar Overview
Sonar OverviewSonar Overview
Sonar Overview
 
Sonar Tool - JAVA code analysis
Sonar Tool - JAVA code analysisSonar Tool - JAVA code analysis
Sonar Tool - JAVA code analysis
 
The shift left strategy
The shift left strategy The shift left strategy
The shift left strategy
 
CI/CD Tools Universe: The Ultimate List
CI/CD Tools Universe: The Ultimate ListCI/CD Tools Universe: The Ultimate List
CI/CD Tools Universe: The Ultimate List
 
Continuous Code Quality with the Sonar Ecosystem @GeeCON 2017 in Prague
Continuous Code Quality with the Sonar Ecosystem @GeeCON 2017 in PragueContinuous Code Quality with the Sonar Ecosystem @GeeCON 2017 in Prague
Continuous Code Quality with the Sonar Ecosystem @GeeCON 2017 in Prague
 
Testing Tool Evaluation Criteria
Testing Tool Evaluation CriteriaTesting Tool Evaluation Criteria
Testing Tool Evaluation Criteria
 
Sonarlint
SonarlintSonarlint
Sonarlint
 
CI/CD Best Practices for Your DevOps Journey
CI/CD Best  Practices for Your DevOps JourneyCI/CD Best  Practices for Your DevOps Journey
CI/CD Best Practices for Your DevOps Journey
 
TDD and BDD and ATDD
TDD and BDD and ATDDTDD and BDD and ATDD
TDD and BDD and ATDD
 

Similar to Continuous Inspection of Code Quality: SonarQube

5WCSQ - Quality Improvement by the Real-Time Detection of the Problems
5WCSQ - Quality Improvement by the Real-Time Detection of the Problems5WCSQ - Quality Improvement by the Real-Time Detection of the Problems
5WCSQ - Quality Improvement by the Real-Time Detection of the Problems
Takanori Suzuki
 
CiklumJavaSat15112011:Alexey Trusov-Code quality management
CiklumJavaSat15112011:Alexey Trusov-Code quality managementCiklumJavaSat15112011:Alexey Trusov-Code quality management
CiklumJavaSat15112011:Alexey Trusov-Code quality management
Ciklum Ukraine
 
Ady beleanu automate-theprocessdelivery
Ady beleanu   automate-theprocessdeliveryAdy beleanu   automate-theprocessdelivery
Ady beleanu automate-theprocessdelivery
Romania Testing
 
Would Static Analysis Tools Help Developers with Code Reviews?
Would Static Analysis Tools Help Developers with Code Reviews?Would Static Analysis Tools Help Developers with Code Reviews?
Would Static Analysis Tools Help Developers with Code Reviews?
Sebastiano Panichella
 

Similar to Continuous Inspection of Code Quality: SonarQube (20)

The computer says no v2
The computer says no v2The computer says no v2
The computer says no v2
 
Test-Driven Code Review: An Empirical Study
Test-Driven Code Review: An Empirical StudyTest-Driven Code Review: An Empirical Study
Test-Driven Code Review: An Empirical Study
 
Part5 - enforcing coding standard and best practices with jas forge v1.0
Part5 -  enforcing coding standard and best practices with jas forge v1.0Part5 -  enforcing coding standard and best practices with jas forge v1.0
Part5 - enforcing coding standard and best practices with jas forge v1.0
 
GPCE16: Automatic Non-functional Testing of Code Generators Families
GPCE16: Automatic Non-functional Testing of Code Generators FamiliesGPCE16: Automatic Non-functional Testing of Code Generators Families
GPCE16: Automatic Non-functional Testing of Code Generators Families
 
What is SonarQube in DevOps.docx
What is SonarQube in DevOps.docxWhat is SonarQube in DevOps.docx
What is SonarQube in DevOps.docx
 
Technical debt management strategies
Technical debt management strategiesTechnical debt management strategies
Technical debt management strategies
 
Software Architecture - Allocation taxonomies: building, deployment and distr...
Software Architecture - Allocation taxonomies: building, deployment and distr...Software Architecture - Allocation taxonomies: building, deployment and distr...
Software Architecture - Allocation taxonomies: building, deployment and distr...
 
5WCSQ - Quality Improvement by the Real-Time Detection of the Problems
5WCSQ - Quality Improvement by the Real-Time Detection of the Problems5WCSQ - Quality Improvement by the Real-Time Detection of the Problems
5WCSQ - Quality Improvement by the Real-Time Detection of the Problems
 
Enhancing Your Test Automation Scenario Coverage with Selenium - QA or the Hi...
Enhancing Your Test Automation Scenario Coverage with Selenium - QA or the Hi...Enhancing Your Test Automation Scenario Coverage with Selenium - QA or the Hi...
Enhancing Your Test Automation Scenario Coverage with Selenium - QA or the Hi...
 
Software Analytics: Data Analytics for Software Engineering and Security
Software Analytics: Data Analytics for Software Engineering and SecuritySoftware Analytics: Data Analytics for Software Engineering and Security
Software Analytics: Data Analytics for Software Engineering and Security
 
CiklumJavaSat15112011:Alexey Trusov-Code quality management
CiklumJavaSat15112011:Alexey Trusov-Code quality managementCiklumJavaSat15112011:Alexey Trusov-Code quality management
CiklumJavaSat15112011:Alexey Trusov-Code quality management
 
The Next Static Code Analysis Tool - Today and Tomorrow
The Next Static Code Analysis Tool - Today and TomorrowThe Next Static Code Analysis Tool - Today and Tomorrow
The Next Static Code Analysis Tool - Today and Tomorrow
 
Ensuring code quality
Ensuring code qualityEnsuring code quality
Ensuring code quality
 
Rtc2014 automate the_process_deliver_quality_ady_beleanu
Rtc2014 automate the_process_deliver_quality_ady_beleanuRtc2014 automate the_process_deliver_quality_ady_beleanu
Rtc2014 automate the_process_deliver_quality_ady_beleanu
 
Ady beleanu automate-theprocessdelivery
Ady beleanu   automate-theprocessdeliveryAdy beleanu   automate-theprocessdelivery
Ady beleanu automate-theprocessdelivery
 
SonarQube.pptx
SonarQube.pptxSonarQube.pptx
SonarQube.pptx
 
Would Static Analysis Tools Help Developers with Code Reviews?
Would Static Analysis Tools Help Developers with Code Reviews?Would Static Analysis Tools Help Developers with Code Reviews?
Would Static Analysis Tools Help Developers with Code Reviews?
 
Code Quality - Security
Code Quality - SecurityCode Quality - Security
Code Quality - Security
 
mydevops.pptx
mydevops.pptxmydevops.pptx
mydevops.pptx
 
Sonar En
Sonar EnSonar En
Sonar En
 

Recently uploaded

CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 

Recently uploaded (20)

The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verifiedSector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 

Continuous Inspection of Code Quality: SonarQube