SlideShare una empresa de Scribd logo
1 de 69
Descargar para leer sin conexión
Pra começar...
1969
1969

Hmm...
I have this
idea
1969

Hmm...
I have this
idea
10 minutes
1 week
wait!
what if...
what if...
Just like the Bronx!
No one cares
No one cares
Why should I?
Broken
windows de
práticas
Ceci Fernandes
@cecifernandes
Which practices?
Which practices?

Diz aí!
practices
process
pair programming
daily meeting
definition of done
continuous
delivery
or
continuous
deployment
practices
process
many other
practices
process

code
Code conventions make
you feel too conventional?
Code conventions make
you feel too conventional?

Let's
make it
better!
Much
better
now...
Not for
long.
Code conventions
public class Taxi {
public double cobra(double km, int minutos) {
if (horarioPadrao())
{
return precoBase(km, minutos);
} else
return precoBase(km, minutos) * extra;
}
}
public class Taxi {
public double cobra(double km, int minutos) {
if (horarioPadrao())
return precoBase(km, minutos);
else
return precoBase(km, minutos) * extra;
}
}
public class Taxi {
public double cobra(double Km, int minutos) {
if (horario_padrao())
return precoBase(Km, minutos);
else
return precoBase(Km, minutos) * EXTRA;
}
}
public class Taxi {
public double cobra(double km, int t) {
double valor = calcula(km, t);
if (maisCaro()) {
return valor * extra;
}
return valor;
}
}
public class Taxi {
public double cobra(double km,int minutos) {
if (horarioPadrao()) return precoBase(km,minutos);
else return precoBase(km,minutos)*extra;
}
}
?
Your turn!

What can you do?
Não é pela
posição
das chaves
What
conventions

then?
public void atualiza(final List<Parcela> parcelasAAtualizar,
final Usuario usuario, List<Feriado> feriados) {
for (Parcela p : parcelasAAtualizar) {
if (old.isInicial() || auxiliar || financeiro) {
if (old.getConta() != null) {
//
}
if (p.getConta() != null) {
//
}
}
if (!old.isFinal()) {
if (auxiliar || financeiro) {
//
if(old.getPodeUsarNovosCamposDeImposto()) {
//
} else {
//
}
}
// goes on a long way...
public void atualiza(final List<Parcela> parcelasAAtualizar,
final Usuario usuario, List<Feriado> feriados) {
for (Parcela p : parcelasAAtualizar) {
if (old.isInicial() || auxiliar || financeiro) {
if (old.getConta() != null) {
//
}
if (p.getConta() != null) {
//
}
}
if (!old.isFinal()) {
if (auxiliar || financeiro) {
//
if(old.getPodeUsarNovosCamposDeImposto()) {
//
} else {
//
}
}
// goes on a long way...

Cyclomatic
complexity
public TurmaController(HorarioDao horarioDao,
TurmaDao turmaDao, SalaDao salaDao,
CursoDao cursoDao, Info info,
HttpServletResponse response, Result result,
EnhancedValidator enhancedValidator,
UsuarioDao usuarioDao,
InstrutorEmAulaDao instrutorEmAulaDao) {
this._________ = _________;
}
public TurmaController(HorarioDao horarioDao,
TurmaDao turmaDao, SalaDao salaDao,
CursoDao cursoDao, Info info,
HttpServletResponse response, Result result,
EnhancedValidator enhancedValidator,
UsuarioDao usuarioDao,
InstrutorEmAulaDao instrutorEmAulaDao) {
this._________ = _________;
}

[AE]fferent
coupling
public void generateRequestToken(CustomOAuthAccessor accessor) {
// generate oauth_token and oauth_secret
String consumer_key = accessor.getAccessor().consumer.getProperty("name");
// generate token and secret based on consumer_key
// for now use md5 of name + current time as token
String token_data = consumer_key + System.currentTimeMillis();
String token = scramble(token_data);
// creates secret accordingly
String secret_data = consumer_key + System.currentTimeMillis() + token;
String secret = scramble(secret_data);
accessor.setRequestToken(token);
accessor.setSecret(secret);
accessor.setAccessToken(null);
// add to the local cache
customAccessors.add(accessor);
}
public void generateRequestToken(CustomOAuthAccessor accessor) {
// generate oauth_token and oauth_secret
String consumer_key = accessor.getAccessor().consumer.getProperty("name");
// generate token and secret based on consumer_key
// for now use md5 of name + current time as token
String token_data = consumer_key + System.currentTimeMillis();
String token = scramble(token_data);
// creates secret accordingly
String secret_data = consumer_key + System.currentTimeMillis() + token;
String secret = scramble(secret_data);
accessor.setRequestToken(token);
accessor.setSecret(secret);
accessor.setAccessToken(null);
// add to the local cache
customAccessors.add(accessor);
}

Do not
comment
public void generateRequestToken(CustomOAuthAccessor accessor) {
// generate oauth_token and oauth_secret
String consumer_key = accessor.getAccessor().consumer.getProperty("name");
// generate token and secret based on consumer_key
// for now use md5 of name + current time as token
String token_data = consumer_key + System.currentTimeMillis();
String token = scramble(token_data);
// creates secret accordingly
String secret_data = consumer_key + System.currentTimeMillis() + token;
String secret = scramble(secret_data);
accessor.setRequestToken(token);
accessor.setSecret(secret);
accessor.setAccessToken(null);
// add to the local cache
customAccessors.add(accessor);
}

Do not
comment
?
How
about...
Why is ugly a problem?
public class Pagamento {
public void paga (Funcionario f) {
int horasTrabalhadas = f.getHorasTrabalhadas();
if (f.getCargo() == Cargo.INSTRUTOR) {
horasTrabalhadas += f.getHorasAulaDadas();
}
double salario = f.getValorHora() * horasTrabalhadas;
imprimeRecibo(salario);
}
//...
}
public class Pagamento {
public void paga (Funcionario f) {
int horasTrabalhadas = f.getHorasTrabalhadas();
if (f.getCargo() == Cargo.INSTRUTOR) {
horasTrabalhadas += f.getHorasAulaDadas();
}
double salario = f.getValorHora() * horasTrabalhadas;
imprimeRecibo(salario);
}
//...
}
public class Pagamento {
public void paga (Funcionario f) {
int horasTrabalhadas = f.getHorasTrabalhadas();
if (f.getCargo() == Cargo.INSTRUTOR) {
horasTrabalhadas += f.getHorasAulaDadas();
}
double salario = f.getValorPorHora() * horasTrabalhadas;
if (f.getCargo() == Cargo.COMERCIAL) {
salario += f.getCursosVendidos() * f.valorComissao();
}
imprimeRecibo(salario);
}
}
Should
have
fixed me
earlier
Back to the start...
What are the
broken windows
in your team?
What are the
broken windows
in your team?
Are yours the same as
the person next to you?
What are the
broken windows
in your team?
How will
you fix
them?
Broken
windows de
práticas
Ceci Fernandes
@cecifernandes

Más contenido relacionado

La actualidad más candente

Mozilla とブラウザゲーム
Mozilla とブラウザゲームMozilla とブラウザゲーム
Mozilla とブラウザゲームNoritada Shimizu
 
Abusing text/template for data transformation
Abusing text/template for data transformationAbusing text/template for data transformation
Abusing text/template for data transformationArnaud Porterie
 
C++ Programming - 9th Study
C++ Programming - 9th StudyC++ Programming - 9th Study
C++ Programming - 9th StudyChris Ohk
 
Rust Mozlando Tutorial
Rust Mozlando TutorialRust Mozlando Tutorial
Rust Mozlando Tutorialnikomatsakis
 
Kotlin의 코루틴은 어떻게 동작하는가
Kotlin의 코루틴은 어떻게 동작하는가Kotlin의 코루틴은 어떻게 동작하는가
Kotlin의 코루틴은 어떻게 동작하는가Chang W. Doh
 
Code as data as code.
Code as data as code.Code as data as code.
Code as data as code.Mike Fogus
 
C++ game development with oxygine
C++ game development with oxygineC++ game development with oxygine
C++ game development with oxyginecorehard_by
 
Fertile Ground: The Roots of Clojure
Fertile Ground: The Roots of ClojureFertile Ground: The Roots of Clojure
Fertile Ground: The Roots of ClojureMike Fogus
 
The Ring programming language version 1.5.2 book - Part 45 of 181
The Ring programming language version 1.5.2 book - Part 45 of 181The Ring programming language version 1.5.2 book - Part 45 of 181
The Ring programming language version 1.5.2 book - Part 45 of 181Mahmoud Samir Fayed
 
Trip itparsing
Trip itparsingTrip itparsing
Trip itparsingCapIpad
 
C++ Lambda and concurrency
C++ Lambda and concurrencyC++ Lambda and concurrency
C++ Lambda and concurrency명신 김
 
Степан Кольцов — Rust — лучше, чем C++
Степан Кольцов — Rust — лучше, чем C++Степан Кольцов — Rust — лучше, чем C++
Степан Кольцов — Rust — лучше, чем C++Yandex
 
ECMAScript 6 new features
ECMAScript 6 new featuresECMAScript 6 new features
ECMAScript 6 new featuresGephenSG
 
Kotlin from-scratch 2 - functions
Kotlin from-scratch 2 - functionsKotlin from-scratch 2 - functions
Kotlin from-scratch 2 - functionsFranco Lombardo
 
The Macronomicon
The MacronomiconThe Macronomicon
The MacronomiconMike Fogus
 

La actualidad más candente (20)

Mozilla とブラウザゲーム
Mozilla とブラウザゲームMozilla とブラウザゲーム
Mozilla とブラウザゲーム
 
EcmaScript 6
EcmaScript 6 EcmaScript 6
EcmaScript 6
 
Abusing text/template for data transformation
Abusing text/template for data transformationAbusing text/template for data transformation
Abusing text/template for data transformation
 
C++ Programming - 9th Study
C++ Programming - 9th StudyC++ Programming - 9th Study
C++ Programming - 9th Study
 
Rust Mozlando Tutorial
Rust Mozlando TutorialRust Mozlando Tutorial
Rust Mozlando Tutorial
 
Kotlin의 코루틴은 어떻게 동작하는가
Kotlin의 코루틴은 어떻게 동작하는가Kotlin의 코루틴은 어떻게 동작하는가
Kotlin의 코루틴은 어떻게 동작하는가
 
Code as data as code.
Code as data as code.Code as data as code.
Code as data as code.
 
C++ game development with oxygine
C++ game development with oxygineC++ game development with oxygine
C++ game development with oxygine
 
Fertile Ground: The Roots of Clojure
Fertile Ground: The Roots of ClojureFertile Ground: The Roots of Clojure
Fertile Ground: The Roots of Clojure
 
Mintz q207
Mintz q207Mintz q207
Mintz q207
 
The Ring programming language version 1.5.2 book - Part 45 of 181
The Ring programming language version 1.5.2 book - Part 45 of 181The Ring programming language version 1.5.2 book - Part 45 of 181
The Ring programming language version 1.5.2 book - Part 45 of 181
 
Trip itparsing
Trip itparsingTrip itparsing
Trip itparsing
 
C++ Lambda and concurrency
C++ Lambda and concurrencyC++ Lambda and concurrency
C++ Lambda and concurrency
 
Степан Кольцов — Rust — лучше, чем C++
Степан Кольцов — Rust — лучше, чем C++Степан Кольцов — Rust — лучше, чем C++
Степан Кольцов — Rust — лучше, чем C++
 
ECMAScript 6
ECMAScript 6ECMAScript 6
ECMAScript 6
 
ECMAScript 6 new features
ECMAScript 6 new featuresECMAScript 6 new features
ECMAScript 6 new features
 
ES6(ES2015) is beautiful
ES6(ES2015) is beautifulES6(ES2015) is beautiful
ES6(ES2015) is beautiful
 
Voce Tem Orgulho Do Seu Codigo
Voce Tem Orgulho Do Seu CodigoVoce Tem Orgulho Do Seu Codigo
Voce Tem Orgulho Do Seu Codigo
 
Kotlin from-scratch 2 - functions
Kotlin from-scratch 2 - functionsKotlin from-scratch 2 - functions
Kotlin from-scratch 2 - functions
 
The Macronomicon
The MacronomiconThe Macronomicon
The Macronomicon
 

Destacado

Wilson & Kelling's "Broken Windows" Analysis - C Strayer
Wilson & Kelling's "Broken Windows" Analysis - C StrayerWilson & Kelling's "Broken Windows" Analysis - C Strayer
Wilson & Kelling's "Broken Windows" Analysis - C StrayerChristine Strayer
 
Broken Window Theory
Broken Window TheoryBroken Window Theory
Broken Window Theorysinghajay92
 
Broken windows theory
Broken windows theoryBroken windows theory
Broken windows theoryeherrera2
 
Final presentation: Broken Window Theory
Final presentation: Broken Window Theory Final presentation: Broken Window Theory
Final presentation: Broken Window Theory drosenthal2
 

Destacado (6)

Broken windows
Broken windowsBroken windows
Broken windows
 
Wilson & Kelling's "Broken Windows" Analysis - C Strayer
Wilson & Kelling's "Broken Windows" Analysis - C StrayerWilson & Kelling's "Broken Windows" Analysis - C Strayer
Wilson & Kelling's "Broken Windows" Analysis - C Strayer
 
Broken window theory
Broken window theoryBroken window theory
Broken window theory
 
Broken Window Theory
Broken Window TheoryBroken Window Theory
Broken Window Theory
 
Broken windows theory
Broken windows theoryBroken windows theory
Broken windows theory
 
Final presentation: Broken Window Theory
Final presentation: Broken Window Theory Final presentation: Broken Window Theory
Final presentation: Broken Window Theory
 

Similar a Broken windows de práticas ágeis

Working effectively with legacy code
Working effectively with legacy codeWorking effectively with legacy code
Working effectively with legacy codeShriKant Vashishtha
 
Callbacks, Promises, and Coroutines (oh my!): Asynchronous Programming Patter...
Callbacks, Promises, and Coroutines (oh my!): Asynchronous Programming Patter...Callbacks, Promises, and Coroutines (oh my!): Asynchronous Programming Patter...
Callbacks, Promises, and Coroutines (oh my!): Asynchronous Programming Patter...Domenic Denicola
 
Pro typescript.ch03.Object Orientation in TypeScript
Pro typescript.ch03.Object Orientation in TypeScriptPro typescript.ch03.Object Orientation in TypeScript
Pro typescript.ch03.Object Orientation in TypeScriptSeok-joon Yun
 
Introdução à programação orientada para aspectos
Introdução à programação orientada para aspectosIntrodução à programação orientada para aspectos
Introdução à programação orientada para aspectosManuel Menezes de Sequeira
 
Advanced symfony Techniques
Advanced symfony TechniquesAdvanced symfony Techniques
Advanced symfony TechniquesKris Wallsmith
 
AST Transformations at JFokus
AST Transformations at JFokusAST Transformations at JFokus
AST Transformations at JFokusHamletDRC
 
Load Testing with PHP and RedLine13
Load Testing with PHP and RedLine13Load Testing with PHP and RedLine13
Load Testing with PHP and RedLine13Jason Lotito
 
The Promised Land (in Angular)
The Promised Land (in Angular)The Promised Land (in Angular)
The Promised Land (in Angular)Domenic Denicola
 
Virtual Madness @ Etsy
Virtual Madness @ EtsyVirtual Madness @ Etsy
Virtual Madness @ EtsyNishan Subedi
 
Code Generation in PHP - PHPConf 2015
Code Generation in PHP - PHPConf 2015Code Generation in PHP - PHPConf 2015
Code Generation in PHP - PHPConf 2015Lin Yo-An
 
The event-driven nature of javascript – IPC2012
The event-driven nature of javascript – IPC2012The event-driven nature of javascript – IPC2012
The event-driven nature of javascript – IPC2012Martin Schuhfuß
 
JUDCon London 2011 - Bin packing with drools planner by example
JUDCon London 2011 - Bin packing with drools planner by exampleJUDCon London 2011 - Bin packing with drools planner by example
JUDCon London 2011 - Bin packing with drools planner by exampleGeoffrey De Smet
 
Speed up your developments with Symfony2
Speed up your developments with Symfony2Speed up your developments with Symfony2
Speed up your developments with Symfony2Hugo Hamon
 
Ten useful JavaScript tips & best practices
Ten useful JavaScript tips & best practicesTen useful JavaScript tips & best practices
Ten useful JavaScript tips & best practicesAnkit Rastogi
 
A deep dive into PEP-3156 and the new asyncio module
A deep dive into PEP-3156 and the new asyncio moduleA deep dive into PEP-3156 and the new asyncio module
A deep dive into PEP-3156 and the new asyncio moduleSaúl Ibarra Corretgé
 
Effecient javascript
Effecient javascriptEffecient javascript
Effecient javascriptmpnkhan
 
[PL] O klasycznej, programistycznej elegancji
[PL] O klasycznej, programistycznej elegancji[PL] O klasycznej, programistycznej elegancji
[PL] O klasycznej, programistycznej elegancjiJakub Marchwicki
 

Similar a Broken windows de práticas ágeis (20)

Working effectively with legacy code
Working effectively with legacy codeWorking effectively with legacy code
Working effectively with legacy code
 
JavaScript Refactoring
JavaScript RefactoringJavaScript Refactoring
JavaScript Refactoring
 
Callbacks, Promises, and Coroutines (oh my!): Asynchronous Programming Patter...
Callbacks, Promises, and Coroutines (oh my!): Asynchronous Programming Patter...Callbacks, Promises, and Coroutines (oh my!): Asynchronous Programming Patter...
Callbacks, Promises, and Coroutines (oh my!): Asynchronous Programming Patter...
 
Pro typescript.ch03.Object Orientation in TypeScript
Pro typescript.ch03.Object Orientation in TypeScriptPro typescript.ch03.Object Orientation in TypeScript
Pro typescript.ch03.Object Orientation in TypeScript
 
Introdução à programação orientada para aspectos
Introdução à programação orientada para aspectosIntrodução à programação orientada para aspectos
Introdução à programação orientada para aspectos
 
Advanced symfony Techniques
Advanced symfony TechniquesAdvanced symfony Techniques
Advanced symfony Techniques
 
JavaScript Lessons 2023
JavaScript Lessons 2023JavaScript Lessons 2023
JavaScript Lessons 2023
 
AST Transformations at JFokus
AST Transformations at JFokusAST Transformations at JFokus
AST Transformations at JFokus
 
ES6, WTF?
ES6, WTF?ES6, WTF?
ES6, WTF?
 
Load Testing with PHP and RedLine13
Load Testing with PHP and RedLine13Load Testing with PHP and RedLine13
Load Testing with PHP and RedLine13
 
The Promised Land (in Angular)
The Promised Land (in Angular)The Promised Land (in Angular)
The Promised Land (in Angular)
 
Virtual Madness @ Etsy
Virtual Madness @ EtsyVirtual Madness @ Etsy
Virtual Madness @ Etsy
 
Code Generation in PHP - PHPConf 2015
Code Generation in PHP - PHPConf 2015Code Generation in PHP - PHPConf 2015
Code Generation in PHP - PHPConf 2015
 
The event-driven nature of javascript – IPC2012
The event-driven nature of javascript – IPC2012The event-driven nature of javascript – IPC2012
The event-driven nature of javascript – IPC2012
 
JUDCon London 2011 - Bin packing with drools planner by example
JUDCon London 2011 - Bin packing with drools planner by exampleJUDCon London 2011 - Bin packing with drools planner by example
JUDCon London 2011 - Bin packing with drools planner by example
 
Speed up your developments with Symfony2
Speed up your developments with Symfony2Speed up your developments with Symfony2
Speed up your developments with Symfony2
 
Ten useful JavaScript tips & best practices
Ten useful JavaScript tips & best practicesTen useful JavaScript tips & best practices
Ten useful JavaScript tips & best practices
 
A deep dive into PEP-3156 and the new asyncio module
A deep dive into PEP-3156 and the new asyncio moduleA deep dive into PEP-3156 and the new asyncio module
A deep dive into PEP-3156 and the new asyncio module
 
Effecient javascript
Effecient javascriptEffecient javascript
Effecient javascript
 
[PL] O klasycznej, programistycznej elegancji
[PL] O klasycznej, programistycznej elegancji[PL] O klasycznej, programistycznej elegancji
[PL] O klasycznej, programistycznej elegancji
 

Más de Cecilia Fernandes

Java pra web mais fácil com MVC
Java pra web mais fácil com MVCJava pra web mais fácil com MVC
Java pra web mais fácil com MVCCecilia Fernandes
 
There and back again (as presented at Agile 2012, Dallas, TX)
There and back again (as presented at Agile 2012, Dallas, TX)There and back again (as presented at Agile 2012, Dallas, TX)
There and back again (as presented at Agile 2012, Dallas, TX)Cecilia Fernandes
 
AgileBrazil2012 - Fuja da Inércia
AgileBrazil2012 - Fuja da InérciaAgileBrazil2012 - Fuja da Inércia
AgileBrazil2012 - Fuja da InérciaCecilia Fernandes
 
Usando melhor as Collections
Usando melhor as CollectionsUsando melhor as Collections
Usando melhor as CollectionsCecilia Fernandes
 
Melhorando um Ambiente Ágil
Melhorando um Ambiente ÁgilMelhorando um Ambiente Ágil
Melhorando um Ambiente ÁgilCecilia Fernandes
 
O problema é seu... a solução também
O problema é seu... a solução tambémO problema é seu... a solução também
O problema é seu... a solução tambémCecilia Fernandes
 

Más de Cecilia Fernandes (8)

Testes Lentos? Agiliza aí!
Testes Lentos? Agiliza aí!Testes Lentos? Agiliza aí!
Testes Lentos? Agiliza aí!
 
Java pra web mais fácil com MVC
Java pra web mais fácil com MVCJava pra web mais fácil com MVC
Java pra web mais fácil com MVC
 
There and back again (as presented at Agile 2012, Dallas, TX)
There and back again (as presented at Agile 2012, Dallas, TX)There and back again (as presented at Agile 2012, Dallas, TX)
There and back again (as presented at Agile 2012, Dallas, TX)
 
AgileBrazil2012 - Fuja da Inércia
AgileBrazil2012 - Fuja da InérciaAgileBrazil2012 - Fuja da Inércia
AgileBrazil2012 - Fuja da Inércia
 
Usando melhor as Collections
Usando melhor as CollectionsUsando melhor as Collections
Usando melhor as Collections
 
Melhorando um Ambiente Ágil
Melhorando um Ambiente ÁgilMelhorando um Ambiente Ágil
Melhorando um Ambiente Ágil
 
There and back again
There and back againThere and back again
There and back again
 
O problema é seu... a solução também
O problema é seu... a solução tambémO problema é seu... a solução também
O problema é seu... a solução também
 

Último

Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 

Último (20)

Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 

Broken windows de práticas ágeis

  • 5.
  • 6.
  • 8.
  • 10. wait!
  • 13. Just like the Bronx!
  • 14.
  • 16. No one cares Why should I?
  • 27. Code conventions make you feel too conventional?
  • 28. Code conventions make you feel too conventional? Let's make it better!
  • 32. public class Taxi { public double cobra(double km, int minutos) { if (horarioPadrao()) { return precoBase(km, minutos); } else return precoBase(km, minutos) * extra; } }
  • 33. public class Taxi { public double cobra(double km, int minutos) { if (horarioPadrao()) return precoBase(km, minutos); else return precoBase(km, minutos) * extra; } }
  • 34. public class Taxi { public double cobra(double Km, int minutos) { if (horario_padrao()) return precoBase(Km, minutos); else return precoBase(Km, minutos) * EXTRA; } }
  • 35. public class Taxi { public double cobra(double km, int t) { double valor = calcula(km, t); if (maisCaro()) { return valor * extra; } return valor; } }
  • 36. public class Taxi { public double cobra(double km,int minutos) { if (horarioPadrao()) return precoBase(km,minutos); else return precoBase(km,minutos)*extra; } }
  • 37.
  • 38. ?
  • 40.
  • 43. public void atualiza(final List<Parcela> parcelasAAtualizar, final Usuario usuario, List<Feriado> feriados) { for (Parcela p : parcelasAAtualizar) { if (old.isInicial() || auxiliar || financeiro) { if (old.getConta() != null) { // } if (p.getConta() != null) { // } } if (!old.isFinal()) { if (auxiliar || financeiro) { // if(old.getPodeUsarNovosCamposDeImposto()) { // } else { // } } // goes on a long way...
  • 44. public void atualiza(final List<Parcela> parcelasAAtualizar, final Usuario usuario, List<Feriado> feriados) { for (Parcela p : parcelasAAtualizar) { if (old.isInicial() || auxiliar || financeiro) { if (old.getConta() != null) { // } if (p.getConta() != null) { // } } if (!old.isFinal()) { if (auxiliar || financeiro) { // if(old.getPodeUsarNovosCamposDeImposto()) { // } else { // } } // goes on a long way... Cyclomatic complexity
  • 45. public TurmaController(HorarioDao horarioDao, TurmaDao turmaDao, SalaDao salaDao, CursoDao cursoDao, Info info, HttpServletResponse response, Result result, EnhancedValidator enhancedValidator, UsuarioDao usuarioDao, InstrutorEmAulaDao instrutorEmAulaDao) { this._________ = _________; }
  • 46. public TurmaController(HorarioDao horarioDao, TurmaDao turmaDao, SalaDao salaDao, CursoDao cursoDao, Info info, HttpServletResponse response, Result result, EnhancedValidator enhancedValidator, UsuarioDao usuarioDao, InstrutorEmAulaDao instrutorEmAulaDao) { this._________ = _________; } [AE]fferent coupling
  • 47. public void generateRequestToken(CustomOAuthAccessor accessor) { // generate oauth_token and oauth_secret String consumer_key = accessor.getAccessor().consumer.getProperty("name"); // generate token and secret based on consumer_key // for now use md5 of name + current time as token String token_data = consumer_key + System.currentTimeMillis(); String token = scramble(token_data); // creates secret accordingly String secret_data = consumer_key + System.currentTimeMillis() + token; String secret = scramble(secret_data); accessor.setRequestToken(token); accessor.setSecret(secret); accessor.setAccessToken(null); // add to the local cache customAccessors.add(accessor); }
  • 48. public void generateRequestToken(CustomOAuthAccessor accessor) { // generate oauth_token and oauth_secret String consumer_key = accessor.getAccessor().consumer.getProperty("name"); // generate token and secret based on consumer_key // for now use md5 of name + current time as token String token_data = consumer_key + System.currentTimeMillis(); String token = scramble(token_data); // creates secret accordingly String secret_data = consumer_key + System.currentTimeMillis() + token; String secret = scramble(secret_data); accessor.setRequestToken(token); accessor.setSecret(secret); accessor.setAccessToken(null); // add to the local cache customAccessors.add(accessor); } Do not comment
  • 49. public void generateRequestToken(CustomOAuthAccessor accessor) { // generate oauth_token and oauth_secret String consumer_key = accessor.getAccessor().consumer.getProperty("name"); // generate token and secret based on consumer_key // for now use md5 of name + current time as token String token_data = consumer_key + System.currentTimeMillis(); String token = scramble(token_data); // creates secret accordingly String secret_data = consumer_key + System.currentTimeMillis() + token; String secret = scramble(secret_data); accessor.setRequestToken(token); accessor.setSecret(secret); accessor.setAccessToken(null); // add to the local cache customAccessors.add(accessor); } Do not comment
  • 50. ?
  • 52. Why is ugly a problem?
  • 53. public class Pagamento { public void paga (Funcionario f) { int horasTrabalhadas = f.getHorasTrabalhadas(); if (f.getCargo() == Cargo.INSTRUTOR) { horasTrabalhadas += f.getHorasAulaDadas(); } double salario = f.getValorHora() * horasTrabalhadas; imprimeRecibo(salario); } //... }
  • 54. public class Pagamento { public void paga (Funcionario f) { int horasTrabalhadas = f.getHorasTrabalhadas(); if (f.getCargo() == Cargo.INSTRUTOR) { horasTrabalhadas += f.getHorasAulaDadas(); } double salario = f.getValorHora() * horasTrabalhadas; imprimeRecibo(salario); } //... }
  • 55. public class Pagamento { public void paga (Funcionario f) { int horasTrabalhadas = f.getHorasTrabalhadas(); if (f.getCargo() == Cargo.INSTRUTOR) { horasTrabalhadas += f.getHorasAulaDadas(); } double salario = f.getValorPorHora() * horasTrabalhadas; if (f.getCargo() == Cargo.COMERCIAL) { salario += f.getCursosVendidos() * f.valorComissao(); } imprimeRecibo(salario); } }
  • 56.
  • 57.
  • 59. Back to the start...
  • 60. What are the broken windows in your team?
  • 61. What are the broken windows in your team? Are yours the same as the person next to you?
  • 62. What are the broken windows in your team? How will you fix them?
  • 63.
  • 64.
  • 65.
  • 66.
  • 67.
  • 68.