SlideShare una empresa de Scribd logo
1 de 53
Descargar para leer sin conexión
Testen: Je mehr Du es tust,
desto mehr wirst Du es lieben
“I can’t believe we’re still talking about this!”
Testen: Je mehr Du es liebst,
desto mehr wirst Du es tun
“I can’t believe we’re still talking about this!”
Sebastian Bergmann
@s_bergmann
sebastian@thephp.cc
27 years programming experience
19 years PHP experience
Co-Founder of thePHP.cc
Jeffrey A. "jam" McGuire
Evangelist, DevRel Acquia
dev.acquia.com/podcast
@horncologne
jam@acquia.com
horncologne@gmail.com
Acquia Podcast:
dev.acquia.com/podcast
Introduction
Why testing? What’s the problem?
Benefits of testing.
Addressing roadblocks and
objections to testing.
Result!
Outline
Why testing?
“The software team not only has to ensure that it makes a
positive contribution to the business goals; it must also ensure
that it makes as few negative contributions … as possible.” -
Andresen.
Benefits of testing
(business cases)
“Testing solves many problems, the least of which is being
sure the code does what it is supposed to do.”
Benefits of testing
(business cases)
“Testing solves many problems, the least of which is being
sure the code does what it is supposed to do.”
The Phoenix Project: A Novel About
IT, DevOps, and Helping Your
Business Win
Gene Kim, Kevin Behr, George
Spafford
https://en.wikipedia.org/wiki/
The_Phoenix_Project_(novel)
The Four Types of Work
1. Business project
2. IT (Infrastructure/Internal) project
3. Changes (Operational/Maintenance)
4. Unplanned work
TDD & the Four Types of Work
TDD helps focus on delivering
features/value through business and
IT projects.
TDD makes changes (Operational/
Maintenance) faster, more secure
TDD reduces unplanned work
Really?
Yes, really.
Time out!
State-of-play?
Do you even test?
I find your lack of tests disturbing.
Really?
Yes, really.
http://dl.acm.org/citation.cfm?id=952753
SAC '03 Proceedings of the 2003 ACM
symposium on Applied computing
Pages 1135-1139
ACM New York, NY, USA ©2003
ISBN:1-58113-624-2
1
http://dl.acm.org/citation.cfm?id=1159787
ISESE '06 Proceedings of the 2006 ACM/IEEE
international symposium on Empirical software
engineering, Pages 356-363
ACM New York, NY, USA ©2006
ISBN:1-59593-218-6
2
http://dl.acm.org/citation.cfm?id=1070834
IEEE Transactions on Software Engineering
Volume 31 Issue 3, March 2005
Page 226-237
3
http://dl.acm.org/citation.cfm?id=1802420
ISSRE'09 Proceedings of the 20th IEEE
international conference on software reliability
engineering, Pages 81-89
IEEE Press Piscataway, NJ, USA ©2009
ISBN: 978-1-4244-5375-7
4
http://dl.acm.org/citation.cfm?id=776892
ICSE '03 Proceedings of the 25th International
Conference on Software Engineering,
Pages 564-569, IEEE Computer Society
Washington, DC, USA ©2003
ISBN:0-7695-1877-X
5
Pro
1. 18% more functional tests passed
2. More than 2X increase in code quality,

tests served as “auto documentation”
3. more tests == more productivity

more productivity == better quality
4. 20.9% decrease in defects,

decrease in defects found by customers

5. 50% reduction in defect rate,

the test suite “will improve quality over
lifetime of the software system”, “quality
contract” between team members
6. TDD ROI … Show me the money!
Con
1. 16% more development time
2. 15% more development time

3. -

4. 30% more development time

non-iterative testing (improvement
possible)
5. (“minimal development productivity
impact”)



6. -



Summary
http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.7.4232
About the Return on Investment of Test-Driven Development (2003)
Matthias M. Müller , Frank Padberg
International Workshop on Economics-Driven Software Engineering
Research EDSER-5
6
Conventional
TDD
Development Quality Assurance
Development
Investment
Life Cycle Benefit
Net Return
Müller / Radberg - TDD Benefit/Cost Ratio Calculation
Photo by CEphoto, Uwe Aranas
“In most cases, a client will not
state how long a comparable
previous system functioned …
Request this information and use it
in relation to test-driven
development.” - Andresen.
Photo by CEphoto, Uwe Aranas
Developers!
This book is your friend!
https://leanpub.com/
SellingTestDrivenProjects
Boehm - Relative cost of a bug-fix
0
40
80
120
160 150X
50X
20X
10X5X1X
Requirements Design Code Developer
Tests
Acceptance
Tests
Operations
Developers!
This book is your friend!
https://leanpub.com/
SellingTestDrivenProjects
Delivering the project
is only the beginning
of delivering value.
“Many software teams present quality assurance as a
separate item in their offer … This gives clients the impression
that it is an element that can be eliminated.” - Andresen.
Sounds convincing … Devs?
Roadblocks,
Questions,
Objections
Getting to testing
Objections &
Questions
1. What can developers get out
testing?
2. How does testing save time and
frustration?
3. But I’m writing the software twice!
That’s twice as much work!
4. What’s the most important tip you
can give about testing?
Objections &
Questions
1. What can developers get out
testing?
2. How does testing save time and
frustration?
3. But I’m writing the software twice!
That’s twice as much work!
4. What’s the most important tip you
can give about testing?
Specification
Documentation
Verification
“Die Hauptaufgabe eines Entwicklers
ist nicht das Schreiben von Code,
sondern das Verstehen eines
Problems. Das Formulieren von Tests,
also der Zielvorgaben, hilft, ein
Problem Schritt für Schritt zu
durchdringen. Die Tests treiben die
Entwicklung also nicht als
Selbstzweck, sondern tun dies, indem
sie die notwendigen Denkprozesse
anstoßen.”
https://thephp.cc/neuigkeiten/2017/02/testen-haelt-mich-von-der-arbeit-ab
Carola
Lilienthal
llsa.de
Carola Lilienthal
class AuctionTest extends PHPUnitFrameworkTestCase
{
private $auction;
protected function setUp()
{
$this->auction = new Auction(
new User(
new Name('Tess Tester'),
new Email('tester@example.com')
),
new Description('...'),
new DateTimeImmutable('2017-04-07'),
new DateTimeImmutable('2017-04-15'),
EUR::fromCents(100)
);
}
// ...
}
class AuctionTest extends PHPUnitFrameworkTestCase
{
// ...
public function testUserCannotBidOnOwnAuction()
{
$this->expectException(
CannotBidOnOwnAuctionException::class
);
$this->auction->bid(
new Bid(
new DateTimeImmutable(‘2017-04-08'),
$this->auction->getUser(),
EUR::fromCents(100)
)
);
}
}
$ phpunit --testdox AuctionTest
PHPUnit 6.0.13 by Sebastian Bergmann and contributors.
Runtime: PHP 7.1.2 with Xdebug 2.5.1
Configuration: /home/sb/example/phpunit.xml
Auction
[x] Has description
[x] Has start date
[x] Has end date
[x] Has initial price
[x] User can bid on auction created by another user
[x] User cannot bid on own auction
[x] User cannot bid on auction that has not yet started
[x] User cannot bid on auction that has already ended
Result! Result!
Introduction
Why testing? What’s the problem?
Benefits of testing.
Addressing roadblocks and
objections to testing.
Result!
Recap
Photo Credits
https://creativecommons.org/licenses/by-nc-sa/2.0/:
Sebastian Bergmann https://www.flickr.com/photos/stuartherbert/
6231499431
Locomotive spec https://www.flickr.com/photos/
12567713@N00/281324130
Steam engine https://www.flickr.com/photos/lofink/445470024
Train maintenance https://www.flickr.com/photos/kheelcenter/
5279863818/
Motorcycle rider https://www.flickr.com/photos/conner395/8339912312
https://creativecommons.org/licenses/by-nc-sa/2.0/:
Köln/Bonn Flughafen night https://www.flickr.com/photos/top10-flickr/
8676295874/
Köln/Bonn Flughafen day https://www.flickr.com/photos/
dirkvorderstrasse/10583451894/
Flughafen Köln/Bonn ceiling https://www.flickr.com/photos/
fridgemonkey/4262843982/
—————
Köln Musical Dome photo by CEphoto, Uwe Aranas https://
commons.wikimedia.org/wiki/File:Cologne_Germany_Musical-
Dome-01.jpg
Developers!
This book is your friend!
https://leanpub.com/
SellingTestDrivenProjects
Carola
Lilienthal
llsa.de
http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.7.4232
About the Return on Investment of Test-Driven Development (2003)
Matthias M. Müller , Frank Padberg
International Workshop on Economics-Driven Software Engineering
Research EDSER-5
6
Thank you!
Questions?
Sebastian Bergmann
@s_bergmann

sebastian@thephp.cc

Jeffrey A. "jam" McGuire
@horncologne

jam@acquia.com

horncologne@gmail.com

Más contenido relacionado

La actualidad más candente

Why Do User Research And Usability Testing
Why Do User Research And Usability TestingWhy Do User Research And Usability Testing
Why Do User Research And Usability Testing
Robert Stackhouse
 
Pair Programming Presentation
Pair Programming PresentationPair Programming Presentation
Pair Programming Presentation
ThoughtWorks
 
Test driven development
Test driven developmentTest driven development
Test driven development
Sunil Prasad
 
Extreme & pair programming Slides ppt
Extreme & pair programming Slides pptExtreme & pair programming Slides ppt
Extreme & pair programming Slides ppt
Mr SMAK
 
Teaching Kids Programming
Teaching Kids ProgrammingTeaching Kids Programming
Teaching Kids Programming
Lynn Langit
 
Top 10 Qualities of a QA Tester
Top 10 Qualities of a QA TesterTop 10 Qualities of a QA Tester
Top 10 Qualities of a QA Tester
Stacey Brown-Sommers
 

La actualidad más candente (20)

Why Do User Research And Usability Testing
Why Do User Research And Usability TestingWhy Do User Research And Usability Testing
Why Do User Research And Usability Testing
 
The New Agile Testing Quadrants: Bringing Skilled Testers and Developers Toge...
The New Agile Testing Quadrants: Bringing Skilled Testers and Developers Toge...The New Agile Testing Quadrants: Bringing Skilled Testers and Developers Toge...
The New Agile Testing Quadrants: Bringing Skilled Testers and Developers Toge...
 
Pair Programming Presentation
Pair Programming PresentationPair Programming Presentation
Pair Programming Presentation
 
Agileee 2012
Agileee 2012Agileee 2012
Agileee 2012
 
Agile Software Development and Test Driven Development: Agil8's Dave Putman 3...
Agile Software Development and Test Driven Development: Agil8's Dave Putman 3...Agile Software Development and Test Driven Development: Agil8's Dave Putman 3...
Agile Software Development and Test Driven Development: Agil8's Dave Putman 3...
 
Agile principles and practices
Agile principles and practicesAgile principles and practices
Agile principles and practices
 
Hey You Got Your TDD in my SQL DB by Jeff McKenzie
Hey You Got Your TDD in my SQL DB by Jeff McKenzieHey You Got Your TDD in my SQL DB by Jeff McKenzie
Hey You Got Your TDD in my SQL DB by Jeff McKenzie
 
Become Software Tester or Developer
Become Software Tester or DeveloperBecome Software Tester or Developer
Become Software Tester or Developer
 
Software testing
Software testingSoftware testing
Software testing
 
Test driven development
Test driven developmentTest driven development
Test driven development
 
Move test planning before implementation
Move test planning before implementationMove test planning before implementation
Move test planning before implementation
 
Best pratice
Best praticeBest pratice
Best pratice
 
Continuous delivery its not about the technology, its about the people. @pipe...
Continuous delivery its not about the technology, its about the people. @pipe...Continuous delivery its not about the technology, its about the people. @pipe...
Continuous delivery its not about the technology, its about the people. @pipe...
 
Pair programming demystified
Pair programming demystifiedPair programming demystified
Pair programming demystified
 
Extreme & pair programming Slides ppt
Extreme & pair programming Slides pptExtreme & pair programming Slides ppt
Extreme & pair programming Slides ppt
 
Python and test
Python and testPython and test
Python and test
 
Common mistakes in software testing and how to overcome?
Common mistakes in software testing and how to overcome?Common mistakes in software testing and how to overcome?
Common mistakes in software testing and how to overcome?
 
Introduction to Test Driven Development
Introduction to Test Driven DevelopmentIntroduction to Test Driven Development
Introduction to Test Driven Development
 
Teaching Kids Programming
Teaching Kids ProgrammingTeaching Kids Programming
Teaching Kids Programming
 
Top 10 Qualities of a QA Tester
Top 10 Qualities of a QA TesterTop 10 Qualities of a QA Tester
Top 10 Qualities of a QA Tester
 

Similar a Testing: the more you do it, the more you'll like it

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
 

Similar a Testing: the more you do it, the more you'll like it (20)

AAA Automated Testing
AAA Automated TestingAAA Automated Testing
AAA Automated Testing
 
Test-Driven Development In Action
Test-Driven Development In ActionTest-Driven Development In Action
Test-Driven Development In Action
 
Automated tests
Automated testsAutomated tests
Automated tests
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
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
 
Markus Clermont - Surviving in an Agile Environment - Google - SoftTest Ireland
Markus Clermont - Surviving in an Agile Environment - Google - SoftTest IrelandMarkus Clermont - Surviving in an Agile Environment - Google - SoftTest Ireland
Markus Clermont - Surviving in an Agile Environment - Google - SoftTest Ireland
 
Software presentation
Software presentationSoftware presentation
Software presentation
 
Agile Testing 20021015
Agile Testing 20021015Agile Testing 20021015
Agile Testing 20021015
 
Myths and reality about software testing
Myths and reality about software testingMyths and reality about software testing
Myths and reality about software testing
 
Test Driven Development - Overview and Adoption
Test Driven Development - Overview and AdoptionTest Driven Development - Overview and Adoption
Test Driven Development - Overview and Adoption
 
A journey to_be_a_software_craftsman
A journey to_be_a_software_craftsmanA journey to_be_a_software_craftsman
A journey to_be_a_software_craftsman
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
Outside-in Testing in Vue with Cypress
Outside-in Testing in Vue with CypressOutside-in Testing in Vue with Cypress
Outside-in Testing in Vue with Cypress
 
How to run an Enterprise PHP Shop
How to run an Enterprise PHP ShopHow to run an Enterprise PHP Shop
How to run an Enterprise PHP Shop
 
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
 
Testing Sap: Modern Methodology
Testing Sap: Modern MethodologyTesting Sap: Modern Methodology
Testing Sap: Modern Methodology
 
Automatic for the People
Automatic for the PeopleAutomatic for the People
Automatic for the People
 
Introduction to test programming
Introduction to test programmingIntroduction to test programming
Introduction to test programming
 
Future of QA
Future of QAFuture of QA
Future of QA
 
Futureofqa
FutureofqaFutureofqa
Futureofqa
 

Más de Jeffrey McGuire

From 0 to MVP in 40 minutes: decoupled Drupal for startups
From 0 to MVP in 40 minutes: decoupled Drupal for startupsFrom 0 to MVP in 40 minutes: decoupled Drupal for startups
From 0 to MVP in 40 minutes: decoupled Drupal for startups
Jeffrey McGuire
 

Más de Jeffrey McGuire (19)

A technology does not a business model make.
A technology does not a business model make.A technology does not a business model make.
A technology does not a business model make.
 
How and why we use Drupal - a business owner's perspective
How and why we use Drupal - a business owner's perspectiveHow and why we use Drupal - a business owner's perspective
How and why we use Drupal - a business owner's perspective
 
Drupal 8 as a Drop-In Content Engine - SymfonyLive Berlin 2015
Drupal 8 as a Drop-In Content Engine - SymfonyLive Berlin 2015Drupal 8 as a Drop-In Content Engine - SymfonyLive Berlin 2015
Drupal 8 as a Drop-In Content Engine - SymfonyLive Berlin 2015
 
Idealism as code - What successful open source looks like
Idealism as code - What successful open source looks likeIdealism as code - What successful open source looks like
Idealism as code - What successful open source looks like
 
From 0 to MVP in 40 minutes: decoupled Drupal for startups
From 0 to MVP in 40 minutes: decoupled Drupal for startupsFrom 0 to MVP in 40 minutes: decoupled Drupal for startups
From 0 to MVP in 40 minutes: decoupled Drupal for startups
 
Why Drupal 8? Why now? APR/MAY 2015
Why Drupal 8? Why now? APR/MAY 2015Why Drupal 8? Why now? APR/MAY 2015
Why Drupal 8? Why now? APR/MAY 2015
 
Why Drupal 8? Why now? FEB/MAR 2015
Why Drupal 8? Why now? FEB/MAR 2015Why Drupal 8? Why now? FEB/MAR 2015
Why Drupal 8? Why now? FEB/MAR 2015
 
Development based on Drupal's Fundamental Particles - Brad Czerniak for jam's...
Development based on Drupal's Fundamental Particles - Brad Czerniak for jam's...Development based on Drupal's Fundamental Particles - Brad Czerniak for jam's...
Development based on Drupal's Fundamental Particles - Brad Czerniak for jam's...
 
Succeeding at Digital Government the Open Source Way
Succeeding at Digital Government the Open Source WaySucceeding at Digital Government the Open Source Way
Succeeding at Digital Government the Open Source Way
 
Government ICT 2.0 London 2014 – Open Source Drupal Empowering Government
Government ICT 2.0 London 2014 – Open Source Drupal Empowering GovernmentGovernment ICT 2.0 London 2014 – Open Source Drupal Empowering Government
Government ICT 2.0 London 2014 – Open Source Drupal Empowering Government
 
DrupalGov Canberra 2014 Keynote: Code for a better world: Open Source Drupal ...
DrupalGov Canberra 2014 Keynote: Code for a better world: Open Source Drupal ...DrupalGov Canberra 2014 Keynote: Code for a better world: Open Source Drupal ...
DrupalGov Canberra 2014 Keynote: Code for a better world: Open Source Drupal ...
 
For the love of the content editors – jam's Drupal Camp session by Pamela Barone
For the love of the content editors – jam's Drupal Camp session by Pamela BaroneFor the love of the content editors – jam's Drupal Camp session by Pamela Barone
For the love of the content editors – jam's Drupal Camp session by Pamela Barone
 
A whole new world for multilingual sites in Drupal 8 - jam's Drupal Camp session
A whole new world for multilingual sites in Drupal 8 - jam's Drupal Camp sessionA whole new world for multilingual sites in Drupal 8 - jam's Drupal Camp session
A whole new world for multilingual sites in Drupal 8 - jam's Drupal Camp session
 
Open source delivers great digital experiences
Open source delivers great digital experiencesOpen source delivers great digital experiences
Open source delivers great digital experiences
 
Open Source Value: Beyond ROI
Open Source Value: Beyond ROIOpen Source Value: Beyond ROI
Open Source Value: Beyond ROI
 
Stop selling Drupal, start selling solutions to business problems.
Stop selling Drupal, start selling solutions to business problems. Stop selling Drupal, start selling solutions to business problems.
Stop selling Drupal, start selling solutions to business problems.
 
The real value of open source: ROI and beyond
The real value of open source: ROI and beyondThe real value of open source: ROI and beyond
The real value of open source: ROI and beyond
 
Drupal for e_commerce-005_dugk_220911
Drupal for e_commerce-005_dugk_220911Drupal for e_commerce-005_dugk_220911
Drupal for e_commerce-005_dugk_220911
 
LobsterCon Paris 09
LobsterCon Paris 09LobsterCon Paris 09
LobsterCon Paris 09
 

Último

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
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)

MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
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
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
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
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
"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 ...
 
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...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
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
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 

Testing: the more you do it, the more you'll like it

  • 1. Testen: Je mehr Du es tust, desto mehr wirst Du es lieben “I can’t believe we’re still talking about this!”
  • 2. Testen: Je mehr Du es liebst, desto mehr wirst Du es tun “I can’t believe we’re still talking about this!”
  • 3.
  • 4. Sebastian Bergmann @s_bergmann sebastian@thephp.cc 27 years programming experience 19 years PHP experience Co-Founder of thePHP.cc
  • 5. Jeffrey A. "jam" McGuire Evangelist, DevRel Acquia dev.acquia.com/podcast @horncologne jam@acquia.com horncologne@gmail.com
  • 7.
  • 8. Introduction Why testing? What’s the problem? Benefits of testing. Addressing roadblocks and objections to testing. Result! Outline
  • 9. Why testing? “The software team not only has to ensure that it makes a positive contribution to the business goals; it must also ensure that it makes as few negative contributions … as possible.” - Andresen.
  • 10. Benefits of testing (business cases) “Testing solves many problems, the least of which is being sure the code does what it is supposed to do.”
  • 11. Benefits of testing (business cases) “Testing solves many problems, the least of which is being sure the code does what it is supposed to do.”
  • 12. The Phoenix Project: A Novel About IT, DevOps, and Helping Your Business Win Gene Kim, Kevin Behr, George Spafford https://en.wikipedia.org/wiki/ The_Phoenix_Project_(novel)
  • 13. The Four Types of Work 1. Business project 2. IT (Infrastructure/Internal) project 3. Changes (Operational/Maintenance) 4. Unplanned work
  • 14. TDD & the Four Types of Work TDD helps focus on delivering features/value through business and IT projects. TDD makes changes (Operational/ Maintenance) faster, more secure TDD reduces unplanned work
  • 17. I find your lack of tests disturbing.
  • 19. http://dl.acm.org/citation.cfm?id=952753 SAC '03 Proceedings of the 2003 ACM symposium on Applied computing Pages 1135-1139 ACM New York, NY, USA ©2003 ISBN:1-58113-624-2 1
  • 20. http://dl.acm.org/citation.cfm?id=1159787 ISESE '06 Proceedings of the 2006 ACM/IEEE international symposium on Empirical software engineering, Pages 356-363 ACM New York, NY, USA ©2006 ISBN:1-59593-218-6 2
  • 21. http://dl.acm.org/citation.cfm?id=1070834 IEEE Transactions on Software Engineering Volume 31 Issue 3, March 2005 Page 226-237 3
  • 22. http://dl.acm.org/citation.cfm?id=1802420 ISSRE'09 Proceedings of the 20th IEEE international conference on software reliability engineering, Pages 81-89 IEEE Press Piscataway, NJ, USA ©2009 ISBN: 978-1-4244-5375-7 4
  • 23. http://dl.acm.org/citation.cfm?id=776892 ICSE '03 Proceedings of the 25th International Conference on Software Engineering, Pages 564-569, IEEE Computer Society Washington, DC, USA ©2003 ISBN:0-7695-1877-X 5
  • 24. Pro 1. 18% more functional tests passed 2. More than 2X increase in code quality,
 tests served as “auto documentation” 3. more tests == more productivity
 more productivity == better quality 4. 20.9% decrease in defects,
 decrease in defects found by customers
 5. 50% reduction in defect rate,
 the test suite “will improve quality over lifetime of the software system”, “quality contract” between team members 6. TDD ROI … Show me the money! Con 1. 16% more development time 2. 15% more development time
 3. -
 4. 30% more development time
 non-iterative testing (improvement possible) 5. (“minimal development productivity impact”)
 
 6. -
 
 Summary
  • 25. http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.7.4232 About the Return on Investment of Test-Driven Development (2003) Matthias M. Müller , Frank Padberg International Workshop on Economics-Driven Software Engineering Research EDSER-5 6
  • 26. Conventional TDD Development Quality Assurance Development Investment Life Cycle Benefit Net Return Müller / Radberg - TDD Benefit/Cost Ratio Calculation
  • 27. Photo by CEphoto, Uwe Aranas
  • 28. “In most cases, a client will not state how long a comparable previous system functioned … Request this information and use it in relation to test-driven development.” - Andresen. Photo by CEphoto, Uwe Aranas
  • 29.
  • 30. Developers! This book is your friend! https://leanpub.com/ SellingTestDrivenProjects
  • 31. Boehm - Relative cost of a bug-fix 0 40 80 120 160 150X 50X 20X 10X5X1X Requirements Design Code Developer Tests Acceptance Tests Operations
  • 32. Developers! This book is your friend! https://leanpub.com/ SellingTestDrivenProjects
  • 33. Delivering the project is only the beginning of delivering value. “Many software teams present quality assurance as a separate item in their offer … This gives clients the impression that it is an element that can be eliminated.” - Andresen.
  • 36. Objections & Questions 1. What can developers get out testing? 2. How does testing save time and frustration? 3. But I’m writing the software twice! That’s twice as much work! 4. What’s the most important tip you can give about testing?
  • 37. Objections & Questions 1. What can developers get out testing? 2. How does testing save time and frustration? 3. But I’m writing the software twice! That’s twice as much work! 4. What’s the most important tip you can give about testing?
  • 41. “Die Hauptaufgabe eines Entwicklers ist nicht das Schreiben von Code, sondern das Verstehen eines Problems. Das Formulieren von Tests, also der Zielvorgaben, hilft, ein Problem Schritt für Schritt zu durchdringen. Die Tests treiben die Entwicklung also nicht als Selbstzweck, sondern tun dies, indem sie die notwendigen Denkprozesse anstoßen.” https://thephp.cc/neuigkeiten/2017/02/testen-haelt-mich-von-der-arbeit-ab
  • 44. class AuctionTest extends PHPUnitFrameworkTestCase { private $auction; protected function setUp() { $this->auction = new Auction( new User( new Name('Tess Tester'), new Email('tester@example.com') ), new Description('...'), new DateTimeImmutable('2017-04-07'), new DateTimeImmutable('2017-04-15'), EUR::fromCents(100) ); } // ... }
  • 45. class AuctionTest extends PHPUnitFrameworkTestCase { // ... public function testUserCannotBidOnOwnAuction() { $this->expectException( CannotBidOnOwnAuctionException::class ); $this->auction->bid( new Bid( new DateTimeImmutable(‘2017-04-08'), $this->auction->getUser(), EUR::fromCents(100) ) ); } }
  • 46. $ phpunit --testdox AuctionTest PHPUnit 6.0.13 by Sebastian Bergmann and contributors. Runtime: PHP 7.1.2 with Xdebug 2.5.1 Configuration: /home/sb/example/phpunit.xml Auction [x] Has description [x] Has start date [x] Has end date [x] Has initial price [x] User can bid on auction created by another user [x] User cannot bid on own auction [x] User cannot bid on auction that has not yet started [x] User cannot bid on auction that has already ended
  • 48. Introduction Why testing? What’s the problem? Benefits of testing. Addressing roadblocks and objections to testing. Result! Recap
  • 49. Photo Credits https://creativecommons.org/licenses/by-nc-sa/2.0/: Sebastian Bergmann https://www.flickr.com/photos/stuartherbert/ 6231499431 Locomotive spec https://www.flickr.com/photos/ 12567713@N00/281324130 Steam engine https://www.flickr.com/photos/lofink/445470024 Train maintenance https://www.flickr.com/photos/kheelcenter/ 5279863818/ Motorcycle rider https://www.flickr.com/photos/conner395/8339912312 https://creativecommons.org/licenses/by-nc-sa/2.0/: Köln/Bonn Flughafen night https://www.flickr.com/photos/top10-flickr/ 8676295874/ Köln/Bonn Flughafen day https://www.flickr.com/photos/ dirkvorderstrasse/10583451894/ Flughafen Köln/Bonn ceiling https://www.flickr.com/photos/ fridgemonkey/4262843982/ ————— Köln Musical Dome photo by CEphoto, Uwe Aranas https:// commons.wikimedia.org/wiki/File:Cologne_Germany_Musical- Dome-01.jpg
  • 50. Developers! This book is your friend! https://leanpub.com/ SellingTestDrivenProjects
  • 52. http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.7.4232 About the Return on Investment of Test-Driven Development (2003) Matthias M. Müller , Frank Padberg International Workshop on Economics-Driven Software Engineering Research EDSER-5 6
  • 53. Thank you! Questions? Sebastian Bergmann @s_bergmann sebastian@thephp.cc Jeffrey A. "jam" McGuire @horncologne jam@acquia.com horncologne@gmail.com