SlideShare a Scribd company logo
1 of 47
Download to read offline
Continuous code quality
in java projects
Igor Suhorukov
Continuous code quality in java projects
Information from this report is my subjective
opinion based on my experience, knowledge,
mistakes... ;-)
Subjective opinion
6/27/19
2010 DB Blue template
2
Igor Suhorukov
Continuous code quality in java projects
Subjective opinion
6/27/19 2010 DB Blue template
3
https://youtu.be/mGiDkLgy7IM?t=279
Igor Suhorukov
Continuous code quality in java projects
Why Java?
6/27/19 2010 DB Blue template
4
https://madnight.github.io/githut/#/pull_requests/2019/1
Igor Suhorukov
Continuous code quality in java projects
Software functional quality reflects how well it complies with or conforms
to a given design, based on functional requirements or specifications.
Quality is subjective from end user point of view and is not constant in
software development life cycle.
ISO/IEC 9126, ISO/IEC 25000:2014, Сonsortium for IT Software
Quality(CISQ), Software Quality Assessment based on Lifecycle
Expectations(SQALE)
Software quality
6/27/19 2010 DB Blue template
5
Igor Suhorukov
Continuous code quality in java projects
Software development process
6/27/19 2010 DB Blue template
6
Igor Suhorukov
Continuous code quality in java projects
Software development process constraints
6/27/19 2010 DB Blue template
7
Quality
Cost Schedule
Scope
Igor Suhorukov
Continuous code quality in java projects
Metrics measure the quantitative assessment of some
property of software or its specification.
Metrics usage and holy wars:
● How to choose the right metrics?
● Are metrics set blessed?
● What I need to do with metrics results?
Metrics
6/27/19 2010 DB Blue template
8
Igor Suhorukov
Continuous code quality in java projects
● Reliability
● Security
● Maintainability
● Duplications
● Complexity
● Issues/Code smell
https://docs.sonarqube.org/latest/user-guide/metric-definitions/
Complexity metrics for software development
6/27/19 2010 DB Blue template
9
Igor Suhorukov
Continuous code quality in java projects
Technical debt / big ball of mud
6/27/19 2010 DB Blue template
10
Igor Suhorukov
Continuous code quality in java projects
Fragile code and unpredictable application failure after
small changes
Delayed improvements and miss deadlines
Tight coupling code
Technical debt
6/27/19 2010 DB Blue template
11
Igor Suhorukov
Continuous code quality in java projects
Technical debt is related to new code or bug fixes.
Examples: increased code complexity, absence of tests for
new code, subsystem or code decomposition issues and
spaghetti code .
Tech debt as violation of SOLID principles (single
responsibility, open-closed, Liskov substitution, interface
segregation and dependency inversion).
Root cause: dev experience, limited time, team player
discipline.
Technical debt
6/27/19 2010 DB Blue template
12
Igor Suhorukov
Continuous code quality in java projects
Test-driven development (TDD)
Behavior driven development (BDD)
Performance Test Driven Development
Continuous Code Quality Inspection
Is it mandatory or recommended only?
Depends on – team size, project complexity, outsourcing/in house project, schedule,
management culture, team qualification/experience/velocity.
Software quality should be part of SDLC
6/27/19 2010 DB Blue template
13
Igor Suhorukov
Continuous code quality in java projects
Agile Manifesto
Individuals and interactions over processes and tools.
Working software over comprehensive documentation.
Customer collaboration over contract negotiation.
Responding to change over following a plan.
Individuals and interactions
Software quality should be part of SDLC
6/27/19 2010 DB Blue template
14
Igor Suhorukov
Continuous code quality in java projects
Based on functional and non functional requirements:
Black/White-box testing
Manual/Unit/Integration testing/System testing
Mutation testing/Fuzzing
Load testing/Stress Testing/Performance testing
Usability testing
Software quality validation approach
6/27/19 2010 DB Blue template
15
Igor Suhorukov
Continuous code quality in java projects
● Static code analysis just one tool in the box to reach
good quality. Helps team to focus on some issues in
large codebase.
● Formal verification of software programs. Too difficult
to explain specification and limited usage.
● Running dynamic program analysis of software on
emulator or real hardware. Time consuming method.
Software quality. White box testing
6/27/19 2010 DB Blue template
16
Igor Suhorukov
Continuous code quality in java projects
● Search by template in abstract syntax tree(AST).
● Rice's theorem.
Theorem states that all non-trivial, semantic properties of programs are
undecidable.
● False positive alerts.
● Nested method invocation.
Static analysis constraints
6/27/19 2010 DB Blue template
17
Igor Suhorukov
Continuous code quality in java projects
● IntelliJ Idea Community Edition - code inspections
● PVS-Studio Java free for several projects on github.
Too many usage constraints. License key may be
revoked in any time.
● SonarJava static analyzer for SonarLint & SonarQube
Java code static analyzers
6/27/19 2010 DB Blue template
18
Igor Suhorukov
Continuous code quality in java projects
IntelliJ Idea code inspections
6/27/19 2010 DB Blue template
19
Igor Suhorukov
Continuous code quality in java projects
IntelliJ Idea code inspections
6/27/19 2010 DB Blue template
20
Igor Suhorukov
Continuous code quality in java projects
PSV Studio
6/27/19 2010 DB Blue template
21
Igor Suhorukov
Continuous code quality in java projects
SonarLint
6/27/19 2010 DB Blue template
22
Igor Suhorukov
Continuous code quality in java projects
https://www.sonarqube.org Community Edition/Developer
Edition/Enterprise Edition/Data Center Edition
https://sonarcloud.io
SonarQube. Сontinuous code quality server
6/27/19 2010 DB Blue template
23
Igor Suhorukov
Continuous code quality in java projects
From first day
SonarQube. New project
6/27/19 2010 DB Blue template
24
Igor Suhorukov
Continuous code quality in java projects
SonarQube. Code smells
6/27/19 2010 DB Blue template
25
Igor Suhorukov
Continuous code quality in java projects
SonarQube. Strategy how to use it in legacy project
6/27/19 2010 DB Blue template
26
● Ignore existing issues, don’t pass new issue in code. QualityGate by default.
● Fix all issue
● Don’t use Sonar
● ?
Igor Suhorukov
Continuous code quality in java projects
git clone https://github.com/apache/ignite.git
mvn sonar:sonar
SonarQube. Project dashboard
6/27/19 2010 DB Blue template
27
Igor Suhorukov
Continuous code quality in java projects
SonarQube. Duplicate code
6/27/19 2010 DB Blue template
28
Igor Suhorukov
Continuous code quality in java projects
SonarQube. Maintainability
6/27/19 2010 DB Blue template
29
Igor Suhorukov
Continuous code quality in java projects
git clone https://github.com/apache/ignite.git
mvn sonar:sonar
SonarQube. Issues
6/27/19 2010 DB Blue template
30
Igor Suhorukov
Continuous code quality in java projects
SonarQube. New language feature inspection
6/27/19 2010 DB Blue template
31
Igor Suhorukov
Continuous code quality in java projects
SonarQube. Code complexity example
6/27/19 2010 DB Blue template
32
Igor Suhorukov
Continuous code quality in java projects
SonarQube. Issue description
6/27/19 2010 DB Blue template
33
Igor Suhorukov
Continuous code quality in java projects
SonarQube. Rules
6/27/19 2010 DB Blue template
34
https://rules.sonarsource.com/java/
Igor Suhorukov
Continuous code quality in java projects
● https://docs.sonarqube.org/display/SCAN/Analyzing+with+Son
arQube+Scanner+for+Jenkins
● https://docs.sonarqube.org/latest/analysis/pull-request/
● https://sonarcloud.io/documentation/analysis/pull-request/
CI/CD integration
6/27/19 2010 DB Blue template
35
Igor Suhorukov
Continuous code quality in java projects
● Black Duck Software
● Sonatype Nexus
● Artifactory
● Looks good to me LGTM
Alternatives
● https://www.codacy.com
● https://github.com/marketplace/category/code-quality
License compatibility/ known library issues
6/27/19 2010 DB Blue template
36
Igor Suhorukov
Continuous code quality in java projects
● https://github.com/checkstyle/checkstyle
https://github.com/spring-io/spring-javaformat/blob/master/src/checkstyle/checkstyle.xml
Code style
6/27/19 2010 DB Blue template
37
Igor Suhorukov
Continuous code quality in java projects
https://github.com/TNG/ArchUnit-Examples/blob/master/example-
junit5/src/test/java/com/tngtech/archunit/exampletest/junit5/DaoRulesTest.java
Code structure tests
6/27/19 2010 DB Blue template
38
Igor Suhorukov
Continuous code quality in java projects
● javadoc
● Use case(BDD) report - net.masterthought::maven-cucumber-reporting
● SchemaSpy (javadoc for RDBMS)
● PlantUML
Is project documentation actual?
6/27/19 2010 DB Blue template
39
Igor Suhorukov
Continuous code quality in java projects
BDD scenarios reports
6/27/19 2010 DB Blue template
40
Igor Suhorukov
Continuous code quality in java projects
SchemaSpy
6/27/19 2010 DB Blue template
41
Igor Suhorukov
Continuous code quality in java projects
PlantUml
6/27/19 2010 DB Blue template
42
Igor Suhorukov
Continuous code quality in java projects
● Measured technical debt is good argument to ask
management for more resources or change project
scope.
● Quick project state assessment.
● Focus team attention on most important issues.
● Helps to find untested code.
Continuous Code Quality and enterprise project
6/27/19 2010 DB Blue template
43
Igor Suhorukov
Continuous code quality in java projects
● Large open source project can use continuous code
quality approach on regular basis or occasionally
● Some projects just looks like community friendly but is not
in real interactions – too many bureaucracy.
● ML libraries code from scientists developers are very
specific and not so frequently follow common code style.
● I’ve cleaned code and fixed some issues in Spring
framework, Spring Boot, Elasticsearch, H2Database
Continuous Code Quality and open source
6/27/19 2010 DB Blue template
44
Igor Suhorukov
Continuous code quality in java projects
Conclusion
6/27/19 2010 DB Blue template
45
Igor Suhorukov
Continuous code quality in java projects
6/27/19 2010 DB Blue template
46
Thanks!
igor.suhorukov@gmail.com
github.com/igor-suhorukov

More Related Content

What's hot

A year of SonarQube and TFS/VSTS
A year of SonarQube and TFS/VSTSA year of SonarQube and TFS/VSTS
A year of SonarQube and TFS/VSTSMatteo Emili
 
SonarQube: Continuous Code Inspection
SonarQube: Continuous Code InspectionSonarQube: Continuous Code Inspection
SonarQube: Continuous Code InspectionMichael Jesse
 
Software Engineering Culture - Improve Code Quality
Software Engineering Culture - Improve Code QualitySoftware Engineering Culture - Improve Code Quality
Software Engineering Culture - Improve Code QualityDmytro Patserkovskyi
 
Coding and testing in Software Engineering
Coding and testing in Software EngineeringCoding and testing in Software Engineering
Coding and testing in Software EngineeringAbhay Vijay
 
Spring Framework Core Technologies
Spring Framework Core TechnologiesSpring Framework Core Technologies
Spring Framework Core TechnologiesDmitriy Gorban
 
Soirée du Test Logiciel - Présentation de Kiuwan (Jack ABDO)
Soirée du Test Logiciel - Présentation de Kiuwan (Jack ABDO)Soirée du Test Logiciel - Présentation de Kiuwan (Jack ABDO)
Soirée du Test Logiciel - Présentation de Kiuwan (Jack ABDO)TelecomValley
 
Java Code Quality Tools
Java Code Quality ToolsJava Code Quality Tools
Java Code Quality ToolsOrest Ivasiv
 
Slides for Houston iPhone Developers' Meetup (April 2012)
Slides for Houston iPhone Developers' Meetup (April 2012)Slides for Houston iPhone Developers' Meetup (April 2012)
Slides for Houston iPhone Developers' Meetup (April 2012)lqi
 
Peer Code Review An Agile Process
Peer Code Review An Agile ProcessPeer Code Review An Agile Process
Peer Code Review An Agile Processgsporar
 
Top 10 static code analysis tool
Top 10 static code analysis toolTop 10 static code analysis tool
Top 10 static code analysis toolscmGalaxy Inc
 
Code-Review-Principles-Process-and-Tools (1)
Code-Review-Principles-Process-and-Tools (1)Code-Review-Principles-Process-and-Tools (1)
Code-Review-Principles-Process-and-Tools (1)Aditya Bhuyan
 
Continuous inspection with Sonar
Continuous inspection with SonarContinuous inspection with Sonar
Continuous inspection with Sonargaudol
 
Code Quality Lightning Talk
Code Quality Lightning TalkCode Quality Lightning Talk
Code Quality Lightning TalkJonathan Gregory
 
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 versionDmytro Patserkovskyi
 
Embedded software static analysis_Polyspace-WhitePaper_final
Embedded software static analysis_Polyspace-WhitePaper_finalEmbedded software static analysis_Polyspace-WhitePaper_final
Embedded software static analysis_Polyspace-WhitePaper_finalTAMILMARAN C
 
Code Review
Code ReviewCode Review
Code Reviewrantav
 
Software testing Training Syllabus Course
Software testing Training Syllabus CourseSoftware testing Training Syllabus Course
Software testing Training Syllabus CourseTOPS Technologies
 

What's hot (20)

A year of SonarQube and TFS/VSTS
A year of SonarQube and TFS/VSTSA year of SonarQube and TFS/VSTS
A year of SonarQube and TFS/VSTS
 
SonarQube: Continuous Code Inspection
SonarQube: Continuous Code InspectionSonarQube: Continuous Code Inspection
SonarQube: Continuous Code Inspection
 
Software Engineering Culture - Improve Code Quality
Software Engineering Culture - Improve Code QualitySoftware Engineering Culture - Improve Code Quality
Software Engineering Culture - Improve Code Quality
 
Coding and testing in Software Engineering
Coding and testing in Software EngineeringCoding and testing in Software Engineering
Coding and testing in Software Engineering
 
Spring Framework Core Technologies
Spring Framework Core TechnologiesSpring Framework Core Technologies
Spring Framework Core Technologies
 
Soirée du Test Logiciel - Présentation de Kiuwan (Jack ABDO)
Soirée du Test Logiciel - Présentation de Kiuwan (Jack ABDO)Soirée du Test Logiciel - Présentation de Kiuwan (Jack ABDO)
Soirée du Test Logiciel - Présentation de Kiuwan (Jack ABDO)
 
Java Code Quality Tools
Java Code Quality ToolsJava Code Quality Tools
Java Code Quality Tools
 
Slides for Houston iPhone Developers' Meetup (April 2012)
Slides for Houston iPhone Developers' Meetup (April 2012)Slides for Houston iPhone Developers' Meetup (April 2012)
Slides for Houston iPhone Developers' Meetup (April 2012)
 
SonarQube
SonarQubeSonarQube
SonarQube
 
Peer Code Review An Agile Process
Peer Code Review An Agile ProcessPeer Code Review An Agile Process
Peer Code Review An Agile Process
 
Top 10 static code analysis tool
Top 10 static code analysis toolTop 10 static code analysis tool
Top 10 static code analysis tool
 
Code-Review-Principles-Process-and-Tools (1)
Code-Review-Principles-Process-and-Tools (1)Code-Review-Principles-Process-and-Tools (1)
Code-Review-Principles-Process-and-Tools (1)
 
Continuous inspection with Sonar
Continuous inspection with SonarContinuous inspection with Sonar
Continuous inspection with Sonar
 
Code Quality Lightning Talk
Code Quality Lightning TalkCode Quality Lightning Talk
Code Quality Lightning Talk
 
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
 
Embedded software static analysis_Polyspace-WhitePaper_final
Embedded software static analysis_Polyspace-WhitePaper_finalEmbedded software static analysis_Polyspace-WhitePaper_final
Embedded software static analysis_Polyspace-WhitePaper_final
 
Gcs day1
Gcs day1Gcs day1
Gcs day1
 
Code Review
Code ReviewCode Review
Code Review
 
Software testing Training Syllabus Course
Software testing Training Syllabus CourseSoftware testing Training Syllabus Course
Software testing Training Syllabus Course
 
expBSIT (1) (1)
expBSIT (1) (1)expBSIT (1) (1)
expBSIT (1) (1)
 

Similar to Continuous code quality_in_java

INTERFACE, by apidays - Crossing the low-code and pro-code chasm: a platform...
INTERFACE, by apidays  - Crossing the low-code and pro-code chasm: a platform...INTERFACE, by apidays  - Crossing the low-code and pro-code chasm: a platform...
INTERFACE, by apidays - Crossing the low-code and pro-code chasm: a platform...apidays
 
Crossing the low-code and pro-code chasm: a platform approach
Crossing the low-code and pro-code chasm: a platform approachCrossing the low-code and pro-code chasm: a platform approach
Crossing the low-code and pro-code chasm: a platform approachAsanka Abeysinghe
 
Technology-Driven Development: Using Automation and Development Techniques to...
Technology-Driven Development: Using Automation and Development Techniques to...Technology-Driven Development: Using Automation and Development Techniques to...
Technology-Driven Development: Using Automation and Development Techniques to...Hiroyuki Ito
 
really really really awesome php application with bdd behat and iterfaces
really really really awesome php application with bdd behat and iterfacesreally really really awesome php application with bdd behat and iterfaces
really really really awesome php application with bdd behat and iterfacesGiulio De Donato
 
QCon'17 talk: CI/CD at scale - lessons from LinkedIn and Mockito
QCon'17 talk: CI/CD at scale - lessons from LinkedIn and MockitoQCon'17 talk: CI/CD at scale - lessons from LinkedIn and Mockito
QCon'17 talk: CI/CD at scale - lessons from LinkedIn and MockitoSzczepan Faber
 
ROS-Industrial Community Forum 12-5-13
ROS-Industrial Community Forum 12-5-13ROS-Industrial Community Forum 12-5-13
ROS-Industrial Community Forum 12-5-13Clay Flannigan
 
Whats New In LabVIEW 2010
Whats New In LabVIEW 2010Whats New In LabVIEW 2010
Whats New In LabVIEW 2010Danny Thomson
 
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 SonarQubePatroklos Papapetrou (Pat)
 
Django e il Rap Elia Contini
Django e il Rap Elia ContiniDjango e il Rap Elia Contini
Django e il Rap Elia ContiniWEBdeBS
 
CI/CD: Lessons from LinkedIn and Mockito
CI/CD: Lessons from LinkedIn and MockitoCI/CD: Lessons from LinkedIn and Mockito
CI/CD: Lessons from LinkedIn and MockitoC4Media
 
Rob Sabourin: On Testing
Rob Sabourin: On TestingRob Sabourin: On Testing
Rob Sabourin: On TestingTechWell
 
Software Engineering as the Next Level Up from Programming (Oracle Groundbrea...
Software Engineering as the Next Level Up from Programming (Oracle Groundbrea...Software Engineering as the Next Level Up from Programming (Oracle Groundbrea...
Software Engineering as the Next Level Up from Programming (Oracle Groundbrea...Lucas Jellema
 

Similar to Continuous code quality_in_java (20)

postgres.pptx
postgres.pptxpostgres.pptx
postgres.pptx
 
INTERFACE, by apidays - Crossing the low-code and pro-code chasm: a platform...
INTERFACE, by apidays  - Crossing the low-code and pro-code chasm: a platform...INTERFACE, by apidays  - Crossing the low-code and pro-code chasm: a platform...
INTERFACE, by apidays - Crossing the low-code and pro-code chasm: a platform...
 
Crossing the low-code and pro-code chasm: a platform approach
Crossing the low-code and pro-code chasm: a platform approachCrossing the low-code and pro-code chasm: a platform approach
Crossing the low-code and pro-code chasm: a platform approach
 
Technology-Driven Development: Using Automation and Development Techniques to...
Technology-Driven Development: Using Automation and Development Techniques to...Technology-Driven Development: Using Automation and Development Techniques to...
Technology-Driven Development: Using Automation and Development Techniques to...
 
really really really awesome php application with bdd behat and iterfaces
really really really awesome php application with bdd behat and iterfacesreally really really awesome php application with bdd behat and iterfaces
really really really awesome php application with bdd behat and iterfaces
 
QCon'17 talk: CI/CD at scale - lessons from LinkedIn and Mockito
QCon'17 talk: CI/CD at scale - lessons from LinkedIn and MockitoQCon'17 talk: CI/CD at scale - lessons from LinkedIn and Mockito
QCon'17 talk: CI/CD at scale - lessons from LinkedIn and Mockito
 
ROS-Industrial Community Forum 12-5-13
ROS-Industrial Community Forum 12-5-13ROS-Industrial Community Forum 12-5-13
ROS-Industrial Community Forum 12-5-13
 
Sonar
SonarSonar
Sonar
 
Bje final present-v.1.0
Bje final present-v.1.0Bje final present-v.1.0
Bje final present-v.1.0
 
Whats New In LabVIEW 2010
Whats New In LabVIEW 2010Whats New In LabVIEW 2010
Whats New In LabVIEW 2010
 
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
 
mydevops.pptx
mydevops.pptxmydevops.pptx
mydevops.pptx
 
deepak
deepakdeepak
deepak
 
Lego1 Powerpoint
Lego1 PowerpointLego1 Powerpoint
Lego1 Powerpoint
 
Django e il Rap Elia Contini
Django e il Rap Elia ContiniDjango e il Rap Elia Contini
Django e il Rap Elia Contini
 
Icpc16.ppt
Icpc16.pptIcpc16.ppt
Icpc16.ppt
 
Icpc16.ppt
Icpc16.pptIcpc16.ppt
Icpc16.ppt
 
CI/CD: Lessons from LinkedIn and Mockito
CI/CD: Lessons from LinkedIn and MockitoCI/CD: Lessons from LinkedIn and Mockito
CI/CD: Lessons from LinkedIn and Mockito
 
Rob Sabourin: On Testing
Rob Sabourin: On TestingRob Sabourin: On Testing
Rob Sabourin: On Testing
 
Software Engineering as the Next Level Up from Programming (Oracle Groundbrea...
Software Engineering as the Next Level Up from Programming (Oracle Groundbrea...Software Engineering as the Next Level Up from Programming (Oracle Groundbrea...
Software Engineering as the Next Level Up from Programming (Oracle Groundbrea...
 

Recently uploaded

Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsPrecisely
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfngoud9212
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 

Recently uploaded (20)

Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power Systems
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdf
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 

Continuous code quality_in_java

  • 2. Igor Suhorukov Continuous code quality in java projects Information from this report is my subjective opinion based on my experience, knowledge, mistakes... ;-) Subjective opinion 6/27/19 2010 DB Blue template 2
  • 3. Igor Suhorukov Continuous code quality in java projects Subjective opinion 6/27/19 2010 DB Blue template 3 https://youtu.be/mGiDkLgy7IM?t=279
  • 4. Igor Suhorukov Continuous code quality in java projects Why Java? 6/27/19 2010 DB Blue template 4 https://madnight.github.io/githut/#/pull_requests/2019/1
  • 5. Igor Suhorukov Continuous code quality in java projects Software functional quality reflects how well it complies with or conforms to a given design, based on functional requirements or specifications. Quality is subjective from end user point of view and is not constant in software development life cycle. ISO/IEC 9126, ISO/IEC 25000:2014, Сonsortium for IT Software Quality(CISQ), Software Quality Assessment based on Lifecycle Expectations(SQALE) Software quality 6/27/19 2010 DB Blue template 5
  • 6. Igor Suhorukov Continuous code quality in java projects Software development process 6/27/19 2010 DB Blue template 6
  • 7. Igor Suhorukov Continuous code quality in java projects Software development process constraints 6/27/19 2010 DB Blue template 7 Quality Cost Schedule Scope
  • 8. Igor Suhorukov Continuous code quality in java projects Metrics measure the quantitative assessment of some property of software or its specification. Metrics usage and holy wars: ● How to choose the right metrics? ● Are metrics set blessed? ● What I need to do with metrics results? Metrics 6/27/19 2010 DB Blue template 8
  • 9. Igor Suhorukov Continuous code quality in java projects ● Reliability ● Security ● Maintainability ● Duplications ● Complexity ● Issues/Code smell https://docs.sonarqube.org/latest/user-guide/metric-definitions/ Complexity metrics for software development 6/27/19 2010 DB Blue template 9
  • 10. Igor Suhorukov Continuous code quality in java projects Technical debt / big ball of mud 6/27/19 2010 DB Blue template 10
  • 11. Igor Suhorukov Continuous code quality in java projects Fragile code and unpredictable application failure after small changes Delayed improvements and miss deadlines Tight coupling code Technical debt 6/27/19 2010 DB Blue template 11
  • 12. Igor Suhorukov Continuous code quality in java projects Technical debt is related to new code or bug fixes. Examples: increased code complexity, absence of tests for new code, subsystem or code decomposition issues and spaghetti code . Tech debt as violation of SOLID principles (single responsibility, open-closed, Liskov substitution, interface segregation and dependency inversion). Root cause: dev experience, limited time, team player discipline. Technical debt 6/27/19 2010 DB Blue template 12
  • 13. Igor Suhorukov Continuous code quality in java projects Test-driven development (TDD) Behavior driven development (BDD) Performance Test Driven Development Continuous Code Quality Inspection Is it mandatory or recommended only? Depends on – team size, project complexity, outsourcing/in house project, schedule, management culture, team qualification/experience/velocity. Software quality should be part of SDLC 6/27/19 2010 DB Blue template 13
  • 14. Igor Suhorukov Continuous code quality in java projects Agile Manifesto Individuals and interactions over processes and tools. Working software over comprehensive documentation. Customer collaboration over contract negotiation. Responding to change over following a plan. Individuals and interactions Software quality should be part of SDLC 6/27/19 2010 DB Blue template 14
  • 15. Igor Suhorukov Continuous code quality in java projects Based on functional and non functional requirements: Black/White-box testing Manual/Unit/Integration testing/System testing Mutation testing/Fuzzing Load testing/Stress Testing/Performance testing Usability testing Software quality validation approach 6/27/19 2010 DB Blue template 15
  • 16. Igor Suhorukov Continuous code quality in java projects ● Static code analysis just one tool in the box to reach good quality. Helps team to focus on some issues in large codebase. ● Formal verification of software programs. Too difficult to explain specification and limited usage. ● Running dynamic program analysis of software on emulator or real hardware. Time consuming method. Software quality. White box testing 6/27/19 2010 DB Blue template 16
  • 17. Igor Suhorukov Continuous code quality in java projects ● Search by template in abstract syntax tree(AST). ● Rice's theorem. Theorem states that all non-trivial, semantic properties of programs are undecidable. ● False positive alerts. ● Nested method invocation. Static analysis constraints 6/27/19 2010 DB Blue template 17
  • 18. Igor Suhorukov Continuous code quality in java projects ● IntelliJ Idea Community Edition - code inspections ● PVS-Studio Java free for several projects on github. Too many usage constraints. License key may be revoked in any time. ● SonarJava static analyzer for SonarLint & SonarQube Java code static analyzers 6/27/19 2010 DB Blue template 18
  • 19. Igor Suhorukov Continuous code quality in java projects IntelliJ Idea code inspections 6/27/19 2010 DB Blue template 19
  • 20. Igor Suhorukov Continuous code quality in java projects IntelliJ Idea code inspections 6/27/19 2010 DB Blue template 20
  • 21. Igor Suhorukov Continuous code quality in java projects PSV Studio 6/27/19 2010 DB Blue template 21
  • 22. Igor Suhorukov Continuous code quality in java projects SonarLint 6/27/19 2010 DB Blue template 22
  • 23. Igor Suhorukov Continuous code quality in java projects https://www.sonarqube.org Community Edition/Developer Edition/Enterprise Edition/Data Center Edition https://sonarcloud.io SonarQube. Сontinuous code quality server 6/27/19 2010 DB Blue template 23
  • 24. Igor Suhorukov Continuous code quality in java projects From first day SonarQube. New project 6/27/19 2010 DB Blue template 24
  • 25. Igor Suhorukov Continuous code quality in java projects SonarQube. Code smells 6/27/19 2010 DB Blue template 25
  • 26. Igor Suhorukov Continuous code quality in java projects SonarQube. Strategy how to use it in legacy project 6/27/19 2010 DB Blue template 26 ● Ignore existing issues, don’t pass new issue in code. QualityGate by default. ● Fix all issue ● Don’t use Sonar ● ?
  • 27. Igor Suhorukov Continuous code quality in java projects git clone https://github.com/apache/ignite.git mvn sonar:sonar SonarQube. Project dashboard 6/27/19 2010 DB Blue template 27
  • 28. Igor Suhorukov Continuous code quality in java projects SonarQube. Duplicate code 6/27/19 2010 DB Blue template 28
  • 29. Igor Suhorukov Continuous code quality in java projects SonarQube. Maintainability 6/27/19 2010 DB Blue template 29
  • 30. Igor Suhorukov Continuous code quality in java projects git clone https://github.com/apache/ignite.git mvn sonar:sonar SonarQube. Issues 6/27/19 2010 DB Blue template 30
  • 31. Igor Suhorukov Continuous code quality in java projects SonarQube. New language feature inspection 6/27/19 2010 DB Blue template 31
  • 32. Igor Suhorukov Continuous code quality in java projects SonarQube. Code complexity example 6/27/19 2010 DB Blue template 32
  • 33. Igor Suhorukov Continuous code quality in java projects SonarQube. Issue description 6/27/19 2010 DB Blue template 33
  • 34. Igor Suhorukov Continuous code quality in java projects SonarQube. Rules 6/27/19 2010 DB Blue template 34 https://rules.sonarsource.com/java/
  • 35. Igor Suhorukov Continuous code quality in java projects ● https://docs.sonarqube.org/display/SCAN/Analyzing+with+Son arQube+Scanner+for+Jenkins ● https://docs.sonarqube.org/latest/analysis/pull-request/ ● https://sonarcloud.io/documentation/analysis/pull-request/ CI/CD integration 6/27/19 2010 DB Blue template 35
  • 36. Igor Suhorukov Continuous code quality in java projects ● Black Duck Software ● Sonatype Nexus ● Artifactory ● Looks good to me LGTM Alternatives ● https://www.codacy.com ● https://github.com/marketplace/category/code-quality License compatibility/ known library issues 6/27/19 2010 DB Blue template 36
  • 37. Igor Suhorukov Continuous code quality in java projects ● https://github.com/checkstyle/checkstyle https://github.com/spring-io/spring-javaformat/blob/master/src/checkstyle/checkstyle.xml Code style 6/27/19 2010 DB Blue template 37
  • 38. Igor Suhorukov Continuous code quality in java projects https://github.com/TNG/ArchUnit-Examples/blob/master/example- junit5/src/test/java/com/tngtech/archunit/exampletest/junit5/DaoRulesTest.java Code structure tests 6/27/19 2010 DB Blue template 38
  • 39. Igor Suhorukov Continuous code quality in java projects ● javadoc ● Use case(BDD) report - net.masterthought::maven-cucumber-reporting ● SchemaSpy (javadoc for RDBMS) ● PlantUML Is project documentation actual? 6/27/19 2010 DB Blue template 39
  • 40. Igor Suhorukov Continuous code quality in java projects BDD scenarios reports 6/27/19 2010 DB Blue template 40
  • 41. Igor Suhorukov Continuous code quality in java projects SchemaSpy 6/27/19 2010 DB Blue template 41
  • 42. Igor Suhorukov Continuous code quality in java projects PlantUml 6/27/19 2010 DB Blue template 42
  • 43. Igor Suhorukov Continuous code quality in java projects ● Measured technical debt is good argument to ask management for more resources or change project scope. ● Quick project state assessment. ● Focus team attention on most important issues. ● Helps to find untested code. Continuous Code Quality and enterprise project 6/27/19 2010 DB Blue template 43
  • 44. Igor Suhorukov Continuous code quality in java projects ● Large open source project can use continuous code quality approach on regular basis or occasionally ● Some projects just looks like community friendly but is not in real interactions – too many bureaucracy. ● ML libraries code from scientists developers are very specific and not so frequently follow common code style. ● I’ve cleaned code and fixed some issues in Spring framework, Spring Boot, Elasticsearch, H2Database Continuous Code Quality and open source 6/27/19 2010 DB Blue template 44
  • 45. Igor Suhorukov Continuous code quality in java projects Conclusion 6/27/19 2010 DB Blue template 45
  • 46. Igor Suhorukov Continuous code quality in java projects 6/27/19 2010 DB Blue template 46