SlideShare une entreprise Scribd logo
1  sur  38
Télécharger pour lire hors ligne
Something You Always Wanted to Know
About Testing*
*But Were Afraid to Ask
Jorge Juan Barroso Carmona
Android Expert
@flipper83 jorge@karumi.com
if the time should come when you have to make
a choice between what is right, and what is
easy!!
What is Testing?
Checking is confirmation, verification, and
validation. By machines.
Testing is exploration, discovery,
investigation, and learning. By humans.
versus
Why Testing?
Martin
Fowler
“ more Functionality
more Quickly ”
“ Bad code affect to
your Costumer ”
“ Trabajar con una base de tests en condiciones es un puto
gustazo!!! ”
@pedro_g_s
What are Unit Tests?
Black-Box before White-Box
creating tests in an environment where they
have some Control over their own
Destiny.
Be careful, sometimes Context is
Everything.
more Information in a test than in code.
Paranoid?
Don’t create your own Problems.
Turn most unit tests into Assertions.
Don’t test Implementation Details.
“ Si tu Unit test tarda más de 1 segundo, cómprate un pony
y no me vendas que eso es un Unit test ”
@Jordi9
Mock or Stub?
Stubs are canned answers to calls.
Mocks are objects pre-programmed with
expectations.
Avoid creating methods only for stubs.
A Big dependency of Robolectric and
PowerMock is a sign of bad code.
Mock dilema: your test only checks that
your mocks works.
What are Integration Tests?
Don’t test all your Layers at the same time
Or at least Be aware you are doing it
Duplicated tests.
Write O(n!) tests.
where “n” it’s the number of collaborators
Don’t test the System or External Libraries.
Sometimes is a Good practice to test all your
layers.
Why you
should use
Continuous
Integration
The best test is the one that is Never executed.
Increase your Time to develop.
Everyone has the latest executable and can see
what’s happening.
“ automated crap is still crap. ”
James O Coplien
How to
decide the
Test
Coverage?
Low level coverage says that the code is badly
tested, but you cannot claim the opposite with just
high level coverage
100% coverage is to test all possible code paths.
Is TDD here?
Tests are Code, we need to maintain them.
Risk-based Testing: prioritize the test over the
risk of failure, the importance and the impact of
failure.
“ I get paid for code that works, not for tests, so my
philosophy is to test as little as possible to reach a given
level of confidence ”
Kent Beck
“ In most businesses, the only tests that have business
value are those that are derived from business
requirements. ”
James O Coplien
How Does
it affect
to my code?
Silver bullets do not exist.
The really important thing is to write
Faster and better code
And please, expose your Dependencies
and write Readable code
your Code is more important than your tests.
“ If you find your testers splitting up functions to support the
testing process, you’re destroying your system architecture
and code comprehension along with it. Test at a coarser
level of granularity. ”
James O Coplien
“ When you are very thirsty, even dirty water will keep you
alive. ”
J. B. Rainsberger
+ James Bach and michael bolton. checking vs testing (2009 -
2013)
+ Workflows of Refactoring. martin fowler. (oop 2014)
+ Why Most Unit Testing is Waste. James O Coplien (2013)
+ 467 tests, 0 failures, 0 confidence. Katrina Owen (Railsberry
2013)
+ Mocks Aren't Stubs. martin fowler (2007)
+ Integrated Tests Are A Scam. J.B. Rainsberger (2013)
+ Exploratory and Risk Based Testing. Bach, J. Kaner, C. (2004)
+ Decomposing into modules. D.L. Parnas (1972)
+ The Art of Unit Testing. Roy Osherove
+ Test Driven Development: By Example. Kent Beck
+ UnitTest. Martin fowler 2014
References
Q&A?@flipper83 jorge@karumi.com

Contenu connexe

Tendances

Exploratory testing
Exploratory testingExploratory testing
Exploratory testing
Huib Schoots
 

Tendances (20)

Automation vs. intelligence - "follow me if you want to live"
Automation vs. intelligence - "follow me if you want to live"Automation vs. intelligence - "follow me if you want to live"
Automation vs. intelligence - "follow me if you want to live"
 
Guerilla UX Testing Live! 4YFN
Guerilla UX Testing Live! 4YFNGuerilla UX Testing Live! 4YFN
Guerilla UX Testing Live! 4YFN
 
Fantastic Tests - The Crimes of Bad Test Design
Fantastic Tests - The Crimes of Bad Test DesignFantastic Tests - The Crimes of Bad Test Design
Fantastic Tests - The Crimes of Bad Test Design
 
Intro to TDD
Intro to TDDIntro to TDD
Intro to TDD
 
Agile Testers: Becoming a key asset for your team
Agile Testers: Becoming a key asset for your teamAgile Testers: Becoming a key asset for your team
Agile Testers: Becoming a key asset for your team
 
The Only Way to Test!
The Only Way to Test!The Only Way to Test!
The Only Way to Test!
 
TDD & Effective Software Development
TDD & Effective Software DevelopmentTDD & Effective Software Development
TDD & Effective Software Development
 
Reducing Test Case Bloat2 1
Reducing Test Case Bloat2 1Reducing Test Case Bloat2 1
Reducing Test Case Bloat2 1
 
Exploratory testing part 3
Exploratory testing part 3Exploratory testing part 3
Exploratory testing part 3
 
Exploratory testing
Exploratory testingExploratory testing
Exploratory testing
 
What is this exploratory testing thing
What is this exploratory testing thingWhat is this exploratory testing thing
What is this exploratory testing thing
 
Caveon Webinar Series - Discrete Option Multiple Choice: A Revolution in Te...
Caveon Webinar Series  - Discrete Option Multiple Choice:  A Revolution in Te...Caveon Webinar Series  - Discrete Option Multiple Choice:  A Revolution in Te...
Caveon Webinar Series - Discrete Option Multiple Choice: A Revolution in Te...
 
Test-Driven Development
 Test-Driven Development  Test-Driven Development
Test-Driven Development
 
Open source bridge testing antipatterns presentation
Open source bridge testing antipatterns presentationOpen source bridge testing antipatterns presentation
Open source bridge testing antipatterns presentation
 
Introduction to Exploratory Testing
Introduction to Exploratory TestingIntroduction to Exploratory Testing
Introduction to Exploratory Testing
 
TDD Introduction with Kata FizzBuzz
TDD Introduction with Kata FizzBuzzTDD Introduction with Kata FizzBuzz
TDD Introduction with Kata FizzBuzz
 
James thomas
James thomasJames thomas
James thomas
 
Testing in production
Testing in productionTesting in production
Testing in production
 
What is What is Professional Testing?
What is What is Professional Testing?What is What is Professional Testing?
What is What is Professional Testing?
 
BTDConf: Breaking Illusions: Testing is Your Most Valuable Asset
BTDConf: Breaking Illusions: Testing is Your Most Valuable AssetBTDConf: Breaking Illusions: Testing is Your Most Valuable Asset
BTDConf: Breaking Illusions: Testing is Your Most Valuable Asset
 

En vedette

PD workshop - polling and forms
PD workshop - polling and formsPD workshop - polling and forms
PD workshop - polling and forms
eprice0030
 
Definition of Matter Lab
Definition of Matter LabDefinition of Matter Lab
Definition of Matter Lab
jmori1
 
Power Notes Measurements and Dealing with Data
Power Notes   Measurements and Dealing with DataPower Notes   Measurements and Dealing with Data
Power Notes Measurements and Dealing with Data
jmori1
 
Seminario Vibrazioni in Lavorazione
Seminario Vibrazioni in LavorazioneSeminario Vibrazioni in Lavorazione
Seminario Vibrazioni in Lavorazione
Marco Leonesio
 
Researchers - recommendations from AIGLIA2014
Researchers - recommendations from AIGLIA2014Researchers - recommendations from AIGLIA2014
Researchers - recommendations from AIGLIA2014
futureagricultures
 
6 class and methods
6    class and methods6    class and methods
6 class and methods
Tuan Ngo
 
Introduction to Density
Introduction to Density  Introduction to Density
Introduction to Density
jmori1
 

En vedette (20)

PD workshop - polling and forms
PD workshop - polling and formsPD workshop - polling and forms
PD workshop - polling and forms
 
Definition of Matter Lab
Definition of Matter LabDefinition of Matter Lab
Definition of Matter Lab
 
Natal fest 2011
Natal fest 2011Natal fest 2011
Natal fest 2011
 
Стратегия развития Фонда и корпоративное управление
Стратегия развития Фонда и корпоративное управлениеСтратегия развития Фонда и корпоративное управление
Стратегия развития Фонда и корпоративное управление
 
Power Notes Measurements and Dealing with Data
Power Notes   Measurements and Dealing with DataPower Notes   Measurements and Dealing with Data
Power Notes Measurements and Dealing with Data
 
Pitch
PitchPitch
Pitch
 
Как не испортить праздник
Как не испортить праздникКак не испортить праздник
Как не испортить праздник
 
Lagu-lagu SM
Lagu-lagu SMLagu-lagu SM
Lagu-lagu SM
 
Jdbc 1
Jdbc 1Jdbc 1
Jdbc 1
 
Pt 3
Pt 3Pt 3
Pt 3
 
Seminario Vibrazioni in Lavorazione
Seminario Vibrazioni in LavorazioneSeminario Vibrazioni in Lavorazione
Seminario Vibrazioni in Lavorazione
 
Yenner fotos
Yenner fotosYenner fotos
Yenner fotos
 
Researchers - recommendations from AIGLIA2014
Researchers - recommendations from AIGLIA2014Researchers - recommendations from AIGLIA2014
Researchers - recommendations from AIGLIA2014
 
6 class and methods
6    class and methods6    class and methods
6 class and methods
 
Модель стратегии холдинга
Модель стратегии холдингаМодель стратегии холдинга
Модель стратегии холдинга
 
C 3
C 3C 3
C 3
 
05 04 wh_chris_walker
05 04 wh_chris_walker05 04 wh_chris_walker
05 04 wh_chris_walker
 
Devon
DevonDevon
Devon
 
Introduction to Density
Introduction to Density  Introduction to Density
Introduction to Density
 
Figure
Figure Figure
Figure
 

Similaire à All you need know about testing

5-Ways-to-Revolutionize-Your-Software-Testing
5-Ways-to-Revolutionize-Your-Software-Testing5-Ways-to-Revolutionize-Your-Software-Testing
5-Ways-to-Revolutionize-Your-Software-Testing
Mary Clemons
 
Pragmatic Not Dogmatic TDD Agile2012 by Joseph Yoder and Rebecca Wirfs-Brock
Pragmatic Not Dogmatic TDD Agile2012 by Joseph Yoder and Rebecca Wirfs-BrockPragmatic Not Dogmatic TDD Agile2012 by Joseph Yoder and Rebecca Wirfs-Brock
Pragmatic Not Dogmatic TDD Agile2012 by Joseph Yoder and Rebecca Wirfs-Brock
Joseph Yoder
 
Pragmatic notdogmatictdd agile2012
Pragmatic notdogmatictdd   agile2012Pragmatic notdogmatictdd   agile2012
Pragmatic notdogmatictdd agile2012
drewz lin
 
Becoming a software testing expert
Becoming a software testing expertBecoming a software testing expert
Becoming a software testing expert
moosix
 
An Introduction to unit testing
An Introduction to unit testingAn Introduction to unit testing
An Introduction to unit testing
Steven Casey
 
I Smell A RAT- Rapid Application Testing
I Smell A RAT- Rapid Application TestingI Smell A RAT- Rapid Application Testing
I Smell A RAT- Rapid Application Testing
Peter Presnell
 

Similaire à All you need know about testing (20)

assertYourself - Breaking the Theories and Assumptions of Unit Testing in Flex
assertYourself - Breaking the Theories and Assumptions of Unit Testing in FlexassertYourself - Breaking the Theories and Assumptions of Unit Testing in Flex
assertYourself - Breaking the Theories and Assumptions of Unit Testing in Flex
 
Unit Test Lab - Why Write Unit Tests?
Unit Test Lab - Why Write Unit Tests?Unit Test Lab - Why Write Unit Tests?
Unit Test Lab - Why Write Unit Tests?
 
Test Drive Development
Test Drive DevelopmentTest Drive Development
Test Drive Development
 
5-Ways-to-Revolutionize-Your-Software-Testing
5-Ways-to-Revolutionize-Your-Software-Testing5-Ways-to-Revolutionize-Your-Software-Testing
5-Ways-to-Revolutionize-Your-Software-Testing
 
Caveon Webinar Series - Discrete Option Multiple Choice April 2014
Caveon Webinar Series -  Discrete Option Multiple Choice April 2014 Caveon Webinar Series -  Discrete Option Multiple Choice April 2014
Caveon Webinar Series - Discrete Option Multiple Choice April 2014
 
Things Could Get Worse: Ideas About Regression Testing
Things Could Get Worse: Ideas About Regression TestingThings Could Get Worse: Ideas About Regression Testing
Things Could Get Worse: Ideas About Regression Testing
 
Unit testing
Unit testingUnit testing
Unit testing
 
Pragmatic Not Dogmatic TDD Agile2012 by Joseph Yoder and Rebecca Wirfs-Brock
Pragmatic Not Dogmatic TDD Agile2012 by Joseph Yoder and Rebecca Wirfs-BrockPragmatic Not Dogmatic TDD Agile2012 by Joseph Yoder and Rebecca Wirfs-Brock
Pragmatic Not Dogmatic TDD Agile2012 by Joseph Yoder and Rebecca Wirfs-Brock
 
Pragmatic notdogmatictdd agile2012
Pragmatic notdogmatictdd   agile2012Pragmatic notdogmatictdd   agile2012
Pragmatic notdogmatictdd agile2012
 
Michael Bolton - Two futures of software testing - Sept 2010
Michael Bolton - Two futures of software testing - Sept 2010Michael Bolton - Two futures of software testing - Sept 2010
Michael Bolton - Two futures of software testing - Sept 2010
 
The limits of unit testing by Craig Stuntz
The limits of unit testing by Craig StuntzThe limits of unit testing by Craig Stuntz
The limits of unit testing by Craig Stuntz
 
The Limits of Unit Testing by Craig Stuntz
The Limits of Unit Testing by Craig StuntzThe Limits of Unit Testing by Craig Stuntz
The Limits of Unit Testing by Craig Stuntz
 
Becoming a software testing expert
Becoming a software testing expertBecoming a software testing expert
Becoming a software testing expert
 
An Introduction to unit testing
An Introduction to unit testingAn Introduction to unit testing
An Introduction to unit testing
 
Good Unit Tests Ask For Quality Code
Good Unit Tests Ask For Quality CodeGood Unit Tests Ask For Quality Code
Good Unit Tests Ask For Quality Code
 
Unit Testing
Unit TestingUnit Testing
Unit Testing
 
I Smell A RAT- Rapid Application Testing
I Smell A RAT- Rapid Application TestingI Smell A RAT- Rapid Application Testing
I Smell A RAT- Rapid Application Testing
 
Agile code quality metrics
Agile code quality metricsAgile code quality metrics
Agile code quality metrics
 
Software engineering 101 - The basics you should hear about at least once
Software engineering 101 - The basics you should hear about at least onceSoftware engineering 101 - The basics you should hear about at least once
Software engineering 101 - The basics you should hear about at least once
 
A Rapid Introduction to Rapid Software Testing
A Rapid Introduction to Rapid Software TestingA Rapid Introduction to Rapid Software Testing
A Rapid Introduction to Rapid Software Testing
 

Plus de Jorge Barroso

Plus de Jorge Barroso (10)

Tensor for android
Tensor for androidTensor for android
Tensor for android
 
Forgetting android v2
Forgetting android v2Forgetting android v2
Forgetting android v2
 
Get out of my thread (Trabajando en diferido)
Get out of my thread (Trabajando en diferido)Get out of my thread (Trabajando en diferido)
Get out of my thread (Trabajando en diferido)
 
Presistiendo que es gerundio (My storing story)
Presistiendo que es gerundio (My storing story)Presistiendo que es gerundio (My storing story)
Presistiendo que es gerundio (My storing story)
 
Mobile development for startups
Mobile development for startupsMobile development for startups
Mobile development for startups
 
Androides y Mazmorras. Part I (dungeons & robots)
Androides y Mazmorras. Part I (dungeons & robots)Androides y Mazmorras. Part I (dungeons & robots)
Androides y Mazmorras. Part I (dungeons & robots)
 
Learning android with AOSP
Learning android with AOSPLearning android with AOSP
Learning android with AOSP
 
Material for old school
Material for old schoolMaterial for old school
Material for old school
 
Material design basics
Material design basicsMaterial design basics
Material design basics
 
Forgetting android
Forgetting androidForgetting android
Forgetting android
 

Dernier

Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
Cara Menggugurkan Kandungan 087776558899
 

Dernier (6)

FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCR
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCRFULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCR
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCR
 
9999266834 Call Girls In Noida Sector 52 (Delhi) Call Girl Service
9999266834 Call Girls In Noida Sector 52 (Delhi) Call Girl Service9999266834 Call Girls In Noida Sector 52 (Delhi) Call Girl Service
9999266834 Call Girls In Noida Sector 52 (Delhi) Call Girl Service
 
Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
 
BDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort Service
 
Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost Lover
Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost LoverPowerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost Lover
Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost Lover
 
Leading Mobile App Development Companies in India (2).pdf
Leading Mobile App Development Companies in India (2).pdfLeading Mobile App Development Companies in India (2).pdf
Leading Mobile App Development Companies in India (2).pdf
 

All you need know about testing

  • 1. Something You Always Wanted to Know About Testing* *But Were Afraid to Ask Jorge Juan Barroso Carmona Android Expert @flipper83 jorge@karumi.com
  • 2. if the time should come when you have to make a choice between what is right, and what is easy!!
  • 4. Checking is confirmation, verification, and validation. By machines. Testing is exploration, discovery, investigation, and learning. By humans. versus
  • 6. “ more Functionality more Quickly ” “ Bad code affect to your Costumer ”
  • 7. “ Trabajar con una base de tests en condiciones es un puto gustazo!!! ” @pedro_g_s
  • 8. What are Unit Tests?
  • 10. creating tests in an environment where they have some Control over their own Destiny. Be careful, sometimes Context is Everything.
  • 11. more Information in a test than in code. Paranoid?
  • 12. Don’t create your own Problems. Turn most unit tests into Assertions. Don’t test Implementation Details.
  • 13. “ Si tu Unit test tarda más de 1 segundo, cómprate un pony y no me vendas que eso es un Unit test ” @Jordi9
  • 15. Stubs are canned answers to calls. Mocks are objects pre-programmed with expectations.
  • 16. Avoid creating methods only for stubs.
  • 17. A Big dependency of Robolectric and PowerMock is a sign of bad code.
  • 18. Mock dilema: your test only checks that your mocks works.
  • 20. Don’t test all your Layers at the same time Or at least Be aware you are doing it
  • 21. Duplicated tests. Write O(n!) tests. where “n” it’s the number of collaborators
  • 22. Don’t test the System or External Libraries. Sometimes is a Good practice to test all your layers.
  • 24. The best test is the one that is Never executed. Increase your Time to develop. Everyone has the latest executable and can see what’s happening.
  • 25. “ automated crap is still crap. ” James O Coplien
  • 27. Low level coverage says that the code is badly tested, but you cannot claim the opposite with just high level coverage
  • 28. 100% coverage is to test all possible code paths. Is TDD here? Tests are Code, we need to maintain them.
  • 29. Risk-based Testing: prioritize the test over the risk of failure, the importance and the impact of failure.
  • 30. “ I get paid for code that works, not for tests, so my philosophy is to test as little as possible to reach a given level of confidence ” Kent Beck “ In most businesses, the only tests that have business value are those that are derived from business requirements. ” James O Coplien
  • 32. Silver bullets do not exist.
  • 33. The really important thing is to write Faster and better code
  • 34. And please, expose your Dependencies and write Readable code
  • 35. your Code is more important than your tests.
  • 36. “ If you find your testers splitting up functions to support the testing process, you’re destroying your system architecture and code comprehension along with it. Test at a coarser level of granularity. ” James O Coplien “ When you are very thirsty, even dirty water will keep you alive. ” J. B. Rainsberger
  • 37. + James Bach and michael bolton. checking vs testing (2009 - 2013) + Workflows of Refactoring. martin fowler. (oop 2014) + Why Most Unit Testing is Waste. James O Coplien (2013) + 467 tests, 0 failures, 0 confidence. Katrina Owen (Railsberry 2013) + Mocks Aren't Stubs. martin fowler (2007) + Integrated Tests Are A Scam. J.B. Rainsberger (2013) + Exploratory and Risk Based Testing. Bach, J. Kaner, C. (2004) + Decomposing into modules. D.L. Parnas (1972) + The Art of Unit Testing. Roy Osherove + Test Driven Development: By Example. Kent Beck + UnitTest. Martin fowler 2014 References