SlideShare ist ein Scribd-Unternehmen logo
1 von 69
Downloaden Sie, um offline zu lesen
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

Weitere ähnliche Inhalte

Was ist angesagt?

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
 

Was ist angesagt? (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
 

Andere mochten auch

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
 

Andere mochten auch (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
 

Ähnlich wie 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
 

Ähnlich wie 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
 

Mehr von 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
 

Mehr von 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
 

Kürzlich hochgeladen

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
 
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
 
[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
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
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
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
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
 
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
 
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
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
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
 
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
 

Kürzlich hochgeladen (20)

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
 
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...
 
[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
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
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
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
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
 
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
 
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
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
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
 
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...
 

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.