SlideShare una empresa de Scribd logo
1 de 45
Descargar para leer sin conexión
TESTES AUTOMATIZADOS O 
TIME E O CLIENTE SAEM 
GANHANDO!
MAURO QUEM…
MAUROGEORGE.COM.BR
POR QUE DEVEMOS TESTAR?
POR QUE DEVEMOS TESTAR? 
Sistemas grandes sem testes
POR QUE DEVEMOS TESTAR? 
Teste é investimento
POR QUE DEVEMOS TESTAR? 
Sistemas sem testes
POR QUE DEVEMOS TESTAR? 
Sistemas pequenos viram grandes
POR QUE DEVEMOS TESTAR? 
Mas isso vende?
TESTES AUTOMATIZADOS
TDD 
Test-driven development
TDD 
O que é
calculator_spec.rb 
RSpec.describe Calculator do! 
! 
describe ‘.sum' do! 
! 
it 'sum 2 and 2' do! 
expect(Calculator.sum(2, 2)).to eq(4)! 
end! 
end! 
end!
console 
$ rspec spec/calculator_spec.rb! 
! 
/path/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:481:in 
`load_missing_constant': Unable to autoload constant Calculator, expected /path/ 
calculator.rb to define it (LoadError)! 
! from /path/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:180:in 
`const_missing'! 
! from /path/spec/calculator_spec.rb:3:in `<top (required)>'! 
! from /path/gems/rspec-core-3.0.4/lib/rspec/core/configuration.rb:1058:in `load'! 
! from /path/gems/rspec-core-3.0.4/lib/rspec/core/configuration.rb:1058:in `block in 
load_spec_files'! 
! from /path/gems/rspec-core-3.0.4/lib/rspec/core/configuration.rb:1058:in `each'! 
! from /path/gems/rspec-core-3.0.4/lib/rspec/core/configuration.rb:1058:in 
`load_spec_files’ …
calculator.rb 
class Calculator! 
! 
def self.sum(a, b)! 
4! 
end! 
end
console 
$ rspec spec/calculator_spec.rb! 
! 
Run options: include {:focus=>true}! 
! 
All examples were filtered out; ignoring {:focus=>true}! 
! 
Calculator! 
.sum! 
sum 2 and 2! 
! 
Finished in 0.20637 seconds (files took 4.72 seconds to load)! 
1 example, 0 failures! 
! 
Randomized with seed 49032
calculator_spec.rb 
RSpec.describe Calculator do! 
! 
describe '.sum' do! 
! 
it 'sum 2 and 2' do! 
expect(Calculator.sum(2, 2)).to eq(4)! 
end! 
! 
it 'sum 3 and 2' do! 
expect(Calculator.sum(3, 2)).to eq(5)! 
end! 
end! 
end!
console 
1) Calculator.sum sum 3 and 2! 
Failure/Error: expect(Calculator.sum(3, 2)).to eq(5)! 
! 
expected: 5! 
got: 4! 
! 
(compared using ==)! 
# ./spec/calculator_spec.rb:12:in `block (3 levels) in <top (required)>'! 
! 
Finished in 0.24562 seconds (files took 4.67 seconds to load)! 
2 examples, 1 failure! 
! 
Failed examples:! 
! 
rspec ./spec/calculator_spec.rb:11 # Calculator.sum sum 3 and 2
calculator.rb 
class Calculator! 
! 
def self.sum(a, b)! 
a + b! 
end! 
end!
console 
Run options: include {:focus=>true}! 
! 
All examples were filtered out; ignoring {:focus=>true}! 
! 
Calculator! 
.sum! 
sum 2 and 2! 
sum 3 and 2! 
! 
Finished in 0.20995 seconds (files took 4.78 seconds to load)! 
2 examples, 0 failures! 
! 
Randomized with seed 64301
TDD 
Baby steps
TDD 
Refactoring
TDD 
Design de código
TDD 
Simplicidade
TDD 
Qualidade
TDD 
Coding Dojo
BDD 
Behavior-driven development
calculator_spec.rb 
RSpec.describe Calculator do! 
! 
describe '.sum' do! 
! 
it 'sum positive values' do! 
expect(Calculator.sum(2, 2)).to eq(4)! 
end! 
! 
it 'sum negative values' do! 
expect(Calculator.sum(-3, -2)).to eq(-5)! 
end! 
end! 
end!
DIA A DIA
DIA A DIA 
Começar o projeto já com os testes
DIA A DIA 
TDD/BDD
DIA A DIA 
100% de cobertura de testes
DIA A DIA 
Código coletivo
DIA A DIA 
Testes como documentação
DIA A DIA 
Projeto não para se alguém do time for para a NASA
DIA A DIA 
Build de dez minutos
DIA A DIA 
Integração continua
DIA A DIA 
Deploy continuo
XP
XP 
Coragem
XP 
Simplicidade
OBRIGADO!
MAUROGEORGE.COM.BR

Más contenido relacionado

Destacado

Minicurso Git Semcomp Beta
Minicurso Git   Semcomp BetaMinicurso Git   Semcomp Beta
Minicurso Git Semcomp Beta
Bruno Orlandi
 
Mini-curso de git -- SECOMP-UFS
Mini-curso de git -- SECOMP-UFSMini-curso de git -- SECOMP-UFS
Mini-curso de git -- SECOMP-UFS
Felipe Carvalho
 

Destacado (20)

Minicurso GIT PET Computação
Minicurso GIT PET ComputaçãoMinicurso GIT PET Computação
Minicurso GIT PET Computação
 
Model of the colossus @ Rupy Brazil 2013
Model of the colossus @ Rupy Brazil 2013 Model of the colossus @ Rupy Brazil 2013
Model of the colossus @ Rupy Brazil 2013
 
Posix
PosixPosix
Posix
 
Rails front-end com bourbon e sua familia @ Front in Maceió 2014
Rails front-end com bourbon e sua familia @ Front in Maceió 2014Rails front-end com bourbon e sua familia @ Front in Maceió 2014
Rails front-end com bourbon e sua familia @ Front in Maceió 2014
 
O efeito borboleta ágil: Do caos ao hackathon
O efeito borboleta ágil: Do caos ao hackathonO efeito borboleta ágil: Do caos ao hackathon
O efeito borboleta ágil: Do caos ao hackathon
 
RSpec Best Friends @ TDC São Paulo 2014
RSpec Best Friends @ TDC São Paulo 2014RSpec Best Friends @ TDC São Paulo 2014
RSpec Best Friends @ TDC São Paulo 2014
 
Git em ambiente Subversion
Git em ambiente SubversionGit em ambiente Subversion
Git em ambiente Subversion
 
A startup de 1500 funcionários
A startup de 1500 funcionáriosA startup de 1500 funcionários
A startup de 1500 funcionários
 
Aprendendo com projetos open source @ RubyConf 2015
Aprendendo com projetos open source @ RubyConf 2015Aprendendo com projetos open source @ RubyConf 2015
Aprendendo com projetos open source @ RubyConf 2015
 
O cliente e o time juntos por um só objetivo! @ CONADEV 2014
O cliente e o time juntos por um só objetivo! @ CONADEV 2014O cliente e o time juntos por um só objetivo! @ CONADEV 2014
O cliente e o time juntos por um só objetivo! @ CONADEV 2014
 
RSpec Best Friends @ Rupy Natal 2014
RSpec Best Friends @ Rupy Natal 2014RSpec Best Friends @ Rupy Natal 2014
RSpec Best Friends @ Rupy Natal 2014
 
jQuery
jQueryjQuery
jQuery
 
Minicurso Git Semcomp Beta
Minicurso Git   Semcomp BetaMinicurso Git   Semcomp Beta
Minicurso Git Semcomp Beta
 
Git para iniciantes v1.3.0 @ PHP Conference Brasil 2012
Git para iniciantes v1.3.0 @ PHP Conference Brasil 2012Git para iniciantes v1.3.0 @ PHP Conference Brasil 2012
Git para iniciantes v1.3.0 @ PHP Conference Brasil 2012
 
TDC2016POA | Trilha Empreendedorismo - Faça mais, reclame menos.
TDC2016POA | Trilha Empreendedorismo - Faça mais, reclame menos.TDC2016POA | Trilha Empreendedorismo - Faça mais, reclame menos.
TDC2016POA | Trilha Empreendedorismo - Faça mais, reclame menos.
 
TDC2016POA | Trilha Ruby - Testes de contrato em um contexto de services e mi...
TDC2016POA | Trilha Ruby - Testes de contrato em um contexto de services e mi...TDC2016POA | Trilha Ruby - Testes de contrato em um contexto de services e mi...
TDC2016POA | Trilha Ruby - Testes de contrato em um contexto de services e mi...
 
Minicurso Git
Minicurso GitMinicurso Git
Minicurso Git
 
Aula 2 - Curso Git e Github - Webschool
Aula 2 - Curso Git e Github - WebschoolAula 2 - Curso Git e Github - Webschool
Aula 2 - Curso Git e Github - Webschool
 
Mini-curso de git -- SECOMP-UFS
Mini-curso de git -- SECOMP-UFSMini-curso de git -- SECOMP-UFS
Mini-curso de git -- SECOMP-UFS
 
Aula 6 - Curso Git e Github - Webschool
Aula 6 - Curso Git e Github - WebschoolAula 6 - Curso Git e Github - Webschool
Aula 6 - Curso Git e Github - Webschool
 

Similar a Testes automatizados o time e o cliente saem ganhando! @ Agile Vale 2014

Performance Optimization of Rails Applications
Performance Optimization of Rails ApplicationsPerformance Optimization of Rails Applications
Performance Optimization of Rails Applications
Serge Smetana
 
Tdd for BT E2E test community
Tdd for BT E2E test communityTdd for BT E2E test community
Tdd for BT E2E test community
Kerry Buckley
 
Hidden Gems of Performance Tuning: Hierarchical Profiler and DML Trigger Opti...
Hidden Gems of Performance Tuning: Hierarchical Profiler and DML Trigger Opti...Hidden Gems of Performance Tuning: Hierarchical Profiler and DML Trigger Opti...
Hidden Gems of Performance Tuning: Hierarchical Profiler and DML Trigger Opti...
Michael Rosenblum
 
Effective TDD - Less is more
Effective TDD - Less is moreEffective TDD - Less is more
Effective TDD - Less is more
Ben Lau
 

Similar a Testes automatizados o time e o cliente saem ganhando! @ Agile Vale 2014 (20)

Performance Optimization of Rails Applications
Performance Optimization of Rails ApplicationsPerformance Optimization of Rails Applications
Performance Optimization of Rails Applications
 
Tdd for BT E2E test community
Tdd for BT E2E test communityTdd for BT E2E test community
Tdd for BT E2E test community
 
20141210 rakuten techtalk
20141210 rakuten techtalk20141210 rakuten techtalk
20141210 rakuten techtalk
 
Hidden Gems of Performance Tuning: Hierarchical Profiler and DML Trigger Opti...
Hidden Gems of Performance Tuning: Hierarchical Profiler and DML Trigger Opti...Hidden Gems of Performance Tuning: Hierarchical Profiler and DML Trigger Opti...
Hidden Gems of Performance Tuning: Hierarchical Profiler and DML Trigger Opti...
 
Effective TDD - Less is more
Effective TDD - Less is moreEffective TDD - Less is more
Effective TDD - Less is more
 
Rspec and Capybara Intro Tutorial at RailsConf 2013
Rspec and Capybara Intro Tutorial at RailsConf 2013Rspec and Capybara Intro Tutorial at RailsConf 2013
Rspec and Capybara Intro Tutorial at RailsConf 2013
 
Serverless in production, an experience report (LNUG)
Serverless in production, an experience report (LNUG)Serverless in production, an experience report (LNUG)
Serverless in production, an experience report (LNUG)
 
The Ultimate Question of Programming, Refactoring, and Everything
The Ultimate Question of Programming, Refactoring, and EverythingThe Ultimate Question of Programming, Refactoring, and Everything
The Ultimate Question of Programming, Refactoring, and Everything
 
The Ultimate Question of Programming, Refactoring, and Everything
The Ultimate Question of Programming, Refactoring, and EverythingThe Ultimate Question of Programming, Refactoring, and Everything
The Ultimate Question of Programming, Refactoring, and Everything
 
Rails Performance
Rails PerformanceRails Performance
Rails Performance
 
Mock cli with Python unittest
Mock cli with Python unittestMock cli with Python unittest
Mock cli with Python unittest
 
News In The Net40
News In The Net40News In The Net40
News In The Net40
 
Serverless in Production, an experience report (cloudXchange)
Serverless in Production, an experience report (cloudXchange)Serverless in Production, an experience report (cloudXchange)
Serverless in Production, an experience report (cloudXchange)
 
SPARKNaCl: A verified, fast cryptographic library
SPARKNaCl: A verified, fast cryptographic librarySPARKNaCl: A verified, fast cryptographic library
SPARKNaCl: A verified, fast cryptographic library
 
Design Summit - Rails 4 Migration - Aaron Patterson
Design Summit - Rails 4 Migration - Aaron PattersonDesign Summit - Rails 4 Migration - Aaron Patterson
Design Summit - Rails 4 Migration - Aaron Patterson
 
TDD with Puppet Tutorial presented at Cascadia IT Conference 2014-03-07
TDD with Puppet Tutorial presented at Cascadia IT Conference 2014-03-07TDD with Puppet Tutorial presented at Cascadia IT Conference 2014-03-07
TDD with Puppet Tutorial presented at Cascadia IT Conference 2014-03-07
 
TestUpload
TestUploadTestUpload
TestUpload
 
Writing Metasploit Plugins
Writing Metasploit PluginsWriting Metasploit Plugins
Writing Metasploit Plugins
 
A Life of breakpoint
A Life of breakpointA Life of breakpoint
A Life of breakpoint
 
Raising the Bar on Robotics Code Quality
Raising the Bar on Robotics Code QualityRaising the Bar on Robotics Code Quality
Raising the Bar on Robotics Code Quality
 

Último

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Último (20)

AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
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
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
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
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.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
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 

Testes automatizados o time e o cliente saem ganhando! @ Agile Vale 2014