SlideShare a Scribd company logo
Code	quality	in
MVC	systems
Maurício Aniche
@mauricioaniche
60k	and	110k	lines	of	
Java	code!
Me beautiful	code
5
Sugar	level																150																							[70,120]
6
Coupling																				10																								<	15
How	to	find
this	number?
7
Benchmarking
Benchmark
in Controllers
8
Why? their	own	concerns	each	
part	of	the	architecture	
has!
10
Quantiles
Coupling	(CBO)
Aniche, M., Treude, C., Zaidman, A., van Deursen, A., Gerosa, M.A., “SATT: Tailoring Code Metric Thresholds for Different Software
Architectures”. 16th IEEE International Working Conference on Source Code Analysis and Manipulation, 2016.
11
Experts
explained to us
SATT for the rescue
12
13
14
Talk	to	developers	you	
should,	young	
padawan!
A catalogue
of smells
specific to MVC
(after talking to 50 developers)
15
Grrrrrr…
Controllers that offer many
services
Grrrr…
Repositories that deal with
many Entities
Grrrrr…
Aniche, Maurício, Bavota, Gabriele, Treude, Christoph, van Deursen, Arie, Gerosa, Marco.“A Validated Set of Smells in Model-
View-Controller Architecture”. Software Maintenance and Evolution (ICSME), 2016, 32th International Conference, IEEE, 2016.
16
They	are	indeed
bad…
(prone	to
change	and	to	defects)
It	indeed	became	a	tool!
17
Bettercodehub like	it!	J
Database-centric	code
Because	in	the	wrong	
place,	they	are!It’s	very	hard	to	
find	some	SQL	
queries	in	my	
codebase…
Project #	of	
classes
#	of	
commits
#	of	DAOs #	of	
methods
Gnarus 924 10451 39 233
Caelumweb 1321 12077 81 590
There are	many queries!
Queries	can get complicated!
SELECT
p.name as project,
c.id as commitId,
a.name as artifactName,
a.path as artifactPath
FROM
Projects p
JOIN
Commits c ON c.project_id = p.id
JOIN
Artifacts a ON a.commit_id = c.id
WHERE
p.repository = ’Apache’;
Where	
should	I	put	
it?
public class InvoiceDAO {
public Invoice findById(int id) { … }
public ShoppingCart find(User u) { … })
public List<Invoice> getAll() { … }
public void save(Invoice inv) { ...}
}
By	the	method	
signatures	we	
should!
Where	should	
we	start?
Project #	of	DAO	
methods
#	of
”correct”
methods
#	of
”wrong”	
methods
%	of	
wrong	
methods
Caelumweb 590 511 79 13.38%
Gnarus 233 200 33 14.16%
Project #	of
inspected
methods
#	of
agreement
%	of
agreement
Caelumweb 79 59 74.68%
Gnarus 33 16 48.48%
Aniche, Maurício F., Gustavo A. Oliva, and Marco A. Gerosa. “Are the Methods in Your Data Access Objects (DAOs) in the Right Place? A Preliminary
Study.”. 6th Workshop on Managing Technical Debt, in conjunction with ICSME2014, Canada. Short paper.
Phil	Calçado just	
(re-)blogged	
about	it!
http://philcalcado.com/2010/12/23/how_to_write_a_repository.html
Test	code	stability
Not	happen	it	should!
We	hate	system	
testing	because	
we	have	to	
rewrite	them	
often!
Large	selenium	code	is!
A catalogue
of patterns
27
Fixture API
ID in HTML
Move Fast, Move Slow
…
Aniche, M., Guerra, E., Gerosa, M. “A Set of Patterns to Improve Code Quality of Automated Functional Tests of Web Applications”. 21th
Conference on Pattern Languages of Programs. 2014.
Thanks!
@mauricioaniche
Young	me	working	on	a	low	
quality	code	that	I	wrote	myself	at	
my	first	international	project	
(Dominican	Republic,	2006).
Sorry	about	my	hair.
My	bosses	doing	peer	press…	oops,	
pair	programming!

More Related Content

Viewers also liked

Apresentação programação orientada à objetos
Apresentação   programação orientada à objetosApresentação   programação orientada à objetos
Apresentação programação orientada à objetos
soncino
 

Viewers also liked (20)

DNAD 2015 - Métricas de código, pra que te quero?
DNAD 2015 - Métricas de código, pra que te quero?DNAD 2015 - Métricas de código, pra que te quero?
DNAD 2015 - Métricas de código, pra que te quero?
 
TDD depois do mainstream. E agora?
TDD depois do mainstream. E agora?TDD depois do mainstream. E agora?
TDD depois do mainstream. E agora?
 
MTD2014 - Are The Methods In Your DAOs in the Right Place? A Preliminary Study
MTD2014 - Are The Methods In Your DAOs in the Right Place? A Preliminary StudyMTD2014 - Are The Methods In Your DAOs in the Right Place? A Preliminary Study
MTD2014 - Are The Methods In Your DAOs in the Right Place? A Preliminary Study
 
MetricMiner: Supporting Researchers in Mining Software Repositories - SCAM 2013
MetricMiner: Supporting Researchers in Mining Software Repositories - SCAM 2013MetricMiner: Supporting Researchers in Mining Software Repositories - SCAM 2013
MetricMiner: Supporting Researchers in Mining Software Repositories - SCAM 2013
 
Eu meço, tu medes, ele mede.. Mas medimos o quê?
Eu meço, tu medes, ele mede.. Mas medimos o quê?Eu meço, tu medes, ele mede.. Mas medimos o quê?
Eu meço, tu medes, ele mede.. Mas medimos o quê?
 
Code coverage for MSR Researches [Work in Progress]
Code coverage for MSR Researches [Work in Progress]Code coverage for MSR Researches [Work in Progress]
Code coverage for MSR Researches [Work in Progress]
 
ASP.NET MVC - Vinicius Quaiato
ASP.NET MVC - Vinicius QuaiatoASP.NET MVC - Vinicius Quaiato
ASP.NET MVC - Vinicius Quaiato
 
Aprendendo solid com exemplos
Aprendendo solid com exemplosAprendendo solid com exemplos
Aprendendo solid com exemplos
 
Apresentação programação orientada à objetos
Apresentação   programação orientada à objetosApresentação   programação orientada à objetos
Apresentação programação orientada à objetos
 
SOLID Principles
SOLID PrinciplesSOLID Principles
SOLID Principles
 
O que é código bonito?
O que é código bonito?O que é código bonito?
O que é código bonito?
 
Orientação a Objetos e Design Patterns
Orientação a Objetos e Design PatternsOrientação a Objetos e Design Patterns
Orientação a Objetos e Design Patterns
 
Conheça a nova arquitetura do compilador do C# (DNAD 2015)
Conheça a nova arquitetura do compilador do C# (DNAD 2015)Conheça a nova arquitetura do compilador do C# (DNAD 2015)
Conheça a nova arquitetura do compilador do C# (DNAD 2015)
 
Build e release pipeline com docker
Build e release pipeline com dockerBuild e release pipeline com docker
Build e release pipeline com docker
 
Minicurso sobre Evolução de Software no CBSoft 2011
Minicurso sobre Evolução de Software no CBSoft 2011Minicurso sobre Evolução de Software no CBSoft 2011
Minicurso sobre Evolução de Software no CBSoft 2011
 
O que estamos temos feito com mineração de repositório de código no IME?
O que estamos temos feito com mineração de repositório de código no IME?O que estamos temos feito com mineração de repositório de código no IME?
O que estamos temos feito com mineração de repositório de código no IME?
 
Does the Act of Refactoring Really Make Code Simpler? A Preliminary Study - W...
Does the Act of Refactoring Really Make Code Simpler? A Preliminary Study - W...Does the Act of Refactoring Really Make Code Simpler? A Preliminary Study - W...
Does the Act of Refactoring Really Make Code Simpler? A Preliminary Study - W...
 
Test-Driven Development serve pra mim?
Test-Driven Development serve pra mim?Test-Driven Development serve pra mim?
Test-Driven Development serve pra mim?
 
ASP.NET Core com Linux, Docker e Azure
ASP.NET Core com Linux, Docker e AzureASP.NET Core com Linux, Docker e Azure
ASP.NET Core com Linux, Docker e Azure
 
ASP.NET Identity - O Novo componente de Membership do ASP.NET
ASP.NET Identity - O Novo componente de Membership do ASP.NETASP.NET Identity - O Novo componente de Membership do ASP.NET
ASP.NET Identity - O Novo componente de Membership do ASP.NET
 

Similar to Code quality in MVC systems - BENEVOL 2016

Similar to Code quality in MVC systems - BENEVOL 2016 (20)

The computer says no! Software Quality in the DevOps world
The computer says no! Software Quality in the DevOps worldThe computer says no! Software Quality in the DevOps world
The computer says no! Software Quality in the DevOps world
 
PVS-Studio in 2021 - Feature Overview
PVS-Studio in 2021 - Feature OverviewPVS-Studio in 2021 - Feature Overview
PVS-Studio in 2021 - Feature Overview
 
Building beyond billions
Building beyond billionsBuilding beyond billions
Building beyond billions
 
Embedded project-development-training
Embedded project-development-trainingEmbedded project-development-training
Embedded project-development-training
 
Serverless Microservices by Unai Zorrilla
Serverless Microservices by Unai ZorrillaServerless Microservices by Unai Zorrilla
Serverless Microservices by Unai Zorrilla
 
A pattern language for microservices - June 2021
A pattern language for microservices - June 2021 A pattern language for microservices - June 2021
A pattern language for microservices - June 2021
 
Reconstructing microservice-based architectures
Reconstructing microservice-based architecturesReconstructing microservice-based architectures
Reconstructing microservice-based architectures
 
Battery Ventures: Simulating and Visualizing Large Scale Cassandra Deployments
Battery Ventures: Simulating and Visualizing Large Scale Cassandra DeploymentsBattery Ventures: Simulating and Visualizing Large Scale Cassandra Deployments
Battery Ventures: Simulating and Visualizing Large Scale Cassandra Deployments
 
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
 
DevOps and the Future of Enterprise Security
DevOps and the Future of Enterprise SecurityDevOps and the Future of Enterprise Security
DevOps and the Future of Enterprise Security
 
Microservice Monitoring and Quality Management for Modern Apps and Infrastruc...
Microservice Monitoring and Quality Management for Modern Apps and Infrastruc...Microservice Monitoring and Quality Management for Modern Apps and Infrastruc...
Microservice Monitoring and Quality Management for Modern Apps and Infrastruc...
 
Pattern driven Enterprise Architecture
Pattern driven Enterprise ArchitecturePattern driven Enterprise Architecture
Pattern driven Enterprise Architecture
 
agile microservices @scaibo
agile microservices @scaiboagile microservices @scaibo
agile microservices @scaibo
 
DevOps and the Future of Enterprise Security
DevOps and the Future of Enterprise SecurityDevOps and the Future of Enterprise Security
DevOps and the Future of Enterprise Security
 
Building APIs in a Cloud Native Era
Building APIs in a Cloud Native EraBuilding APIs in a Cloud Native Era
Building APIs in a Cloud Native Era
 
apidays LIVE Paris - Building APIs in a Cloud Native era by Nuwan Dias
apidays LIVE Paris - Building APIs in a Cloud Native era by Nuwan Diasapidays LIVE Paris - Building APIs in a Cloud Native era by Nuwan Dias
apidays LIVE Paris - Building APIs in a Cloud Native era by Nuwan Dias
 
Continuous Inspection of Code Quality: SonarQube
Continuous Inspection of Code Quality: SonarQubeContinuous Inspection of Code Quality: SonarQube
Continuous Inspection of Code Quality: SonarQube
 
What's an SRE at Criteo - Meetup SRE Paris
What's an SRE at Criteo - Meetup SRE ParisWhat's an SRE at Criteo - Meetup SRE Paris
What's an SRE at Criteo - Meetup SRE Paris
 
Aggregating API Services with an API Gateway (BFF)
Aggregating API Services with an API Gateway (BFF)Aggregating API Services with an API Gateway (BFF)
Aggregating API Services with an API Gateway (BFF)
 
Sharique Khan Resume
Sharique Khan ResumeSharique Khan Resume
Sharique Khan Resume
 

More from Maurício Aniche

More from Maurício Aniche (11)

Can ML help software developers? (TEQnation 2022)
Can ML help software developers? (TEQnation 2022)Can ML help software developers? (TEQnation 2022)
Can ML help software developers? (TEQnation 2022)
 
Tracing Back Log Data to its Log Statement: From Research to Practice
Tracing Back Log Data to its Log Statement: From Research to PracticeTracing Back Log Data to its Log Statement: From Research to Practice
Tracing Back Log Data to its Log Statement: From Research to Practice
 
Pragmatic software testing education - SIGCSE 2019
Pragmatic software testing education - SIGCSE 2019Pragmatic software testing education - SIGCSE 2019
Pragmatic software testing education - SIGCSE 2019
 
Test Automation Day 2018
Test Automation Day 2018Test Automation Day 2018
Test Automation Day 2018
 
Software Testing with Caipirinhas and Stroopwafels
Software Testing with Caipirinhas and StroopwafelsSoftware Testing with Caipirinhas and Stroopwafels
Software Testing with Caipirinhas and Stroopwafels
 
[TDC 2014] Métricas de código, pra que te quero?
[TDC 2014] Métricas de código, pra que te quero?[TDC 2014] Métricas de código, pra que te quero?
[TDC 2014] Métricas de código, pra que te quero?
 
Métricas de código, pra que te quero?
Métricas de código, pra que te quero?Métricas de código, pra que te quero?
Métricas de código, pra que te quero?
 
Defesa de mestrado: Como a prática de TDD influencia no projeto de classes em...
Defesa de mestrado: Como a prática de TDD influencia no projeto de classes em...Defesa de mestrado: Como a prática de TDD influencia no projeto de classes em...
Defesa de mestrado: Como a prática de TDD influencia no projeto de classes em...
 
Métodos Ágeis de Desenvolvimento de Software: Uma introdução
Métodos Ágeis de Desenvolvimento de Software: Uma introduçãoMétodos Ágeis de Desenvolvimento de Software: Uma introdução
Métodos Ágeis de Desenvolvimento de Software: Uma introdução
 
The relationship between test and production code quality (@ SIG)
The relationship between test and production code quality (@ SIG)The relationship between test and production code quality (@ SIG)
The relationship between test and production code quality (@ SIG)
 
What Do the Asserts in a Unit Test Tell Us About Code Quality? (CSMR2013)
What Do the Asserts in a Unit Test Tell Us About Code Quality? (CSMR2013)What Do the Asserts in a Unit Test Tell Us About Code Quality? (CSMR2013)
What Do the Asserts in a Unit Test Tell Us About Code Quality? (CSMR2013)
 

Recently uploaded

Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
Bhaskar Mitra
 

Recently uploaded (20)

GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024
 
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
In-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT ProfessionalsIn-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT Professionals
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 

Code quality in MVC systems - BENEVOL 2016