Soumettre la recherche
Mettre en ligne
Unit Testing Done Right
•
1 j'aime
•
1,214 vues
B
Brian Fenton
Suivre
Talk about unit testing and how it evolved over time, and how to do it well
Lire moins
Lire la suite
Logiciels
Signaler
Partager
Signaler
Partager
1 sur 39
Télécharger maintenant
Télécharger pour lire hors ligne
Recommandé
Best practices unit testing
Best practices unit testing
Tricode (part of Dept)
Unit Testing Best Practices
Unit Testing Best Practices
Tomaš Maconko
Unit Testing Concepts and Best Practices
Unit Testing Concepts and Best Practices
Derek Smith
Roy Osherove on Unit Testing Good Practices and Horrible Mistakes
Roy Osherove on Unit Testing Good Practices and Horrible Mistakes
Roy Osherove
Unit testing
Unit testing
Murugesan Nataraj
Unit Testing Guidelines
Unit Testing Guidelines
Joel Hooks
Unit testing best practices with JUnit
Unit testing best practices with JUnit
inTwentyEight Minutes
Unit testing - the hard parts
Unit testing - the hard parts
Shaun Abram
Recommandé
Best practices unit testing
Best practices unit testing
Tricode (part of Dept)
Unit Testing Best Practices
Unit Testing Best Practices
Tomaš Maconko
Unit Testing Concepts and Best Practices
Unit Testing Concepts and Best Practices
Derek Smith
Roy Osherove on Unit Testing Good Practices and Horrible Mistakes
Roy Osherove on Unit Testing Good Practices and Horrible Mistakes
Roy Osherove
Unit testing
Unit testing
Murugesan Nataraj
Unit Testing Guidelines
Unit Testing Guidelines
Joel Hooks
Unit testing best practices with JUnit
Unit testing best practices with JUnit
inTwentyEight Minutes
Unit testing - the hard parts
Unit testing - the hard parts
Shaun Abram
Unit Testing Fundamentals
Unit Testing Fundamentals
Richard Paul
Workshop unit test
Workshop unit test
Francesco Garavaglia
Clean Unit Test Patterns
Clean Unit Test Patterns
Frank Appel
Unit Testing
Unit Testing
Sergey Podolsky
Unit Tests And Automated Testing
Unit Tests And Automated Testing
Lee Englestone
Unit Testing 101
Unit Testing 101
Dave Bouwman
An Introduction to Unit Testing
An Introduction to Unit Testing
Joe Tremblay
Automated Unit Testing
Automated Unit Testing
Mike Lively
Understanding Unit Testing
Understanding Unit Testing
ikhwanhayat
Unit Testing
Unit Testing
Scott Leberknight
Embrace Unit Testing
Embrace Unit Testing
alessiopace
Unit Testing And Mocking
Unit Testing And Mocking
Joe Wilson
Java Unit Test and Coverage Introduction
Java Unit Test and Coverage Introduction
Alex Su
Unit Testing
Unit Testing
François Camus
Test driven development in .Net - 2010 + Eclipse
Test driven development in .Net - 2010 + Eclipse
UTC Fire & Security
Software Quality via Unit Testing
Software Quality via Unit Testing
Shaun Abram
Unit Testing
Unit Testing
Avinash Kadam
.Net Unit Testing with Visual Studio 2010
.Net Unit Testing with Visual Studio 2010
kgayda
Unit testing
Unit testing
Slideshare
Unit Test + Functional Programming = Love
Unit Test + Functional Programming = Love
Alvaro Videla
What's with All This Talk About Coverage?
What's with All This Talk About Coverage?
DVClub
Presentation slides: "How to get 100% code coverage"
Presentation slides: "How to get 100% code coverage"
Rapita Systems Ltd
Contenu connexe
Tendances
Unit Testing Fundamentals
Unit Testing Fundamentals
Richard Paul
Workshop unit test
Workshop unit test
Francesco Garavaglia
Clean Unit Test Patterns
Clean Unit Test Patterns
Frank Appel
Unit Testing
Unit Testing
Sergey Podolsky
Unit Tests And Automated Testing
Unit Tests And Automated Testing
Lee Englestone
Unit Testing 101
Unit Testing 101
Dave Bouwman
An Introduction to Unit Testing
An Introduction to Unit Testing
Joe Tremblay
Automated Unit Testing
Automated Unit Testing
Mike Lively
Understanding Unit Testing
Understanding Unit Testing
ikhwanhayat
Unit Testing
Unit Testing
Scott Leberknight
Embrace Unit Testing
Embrace Unit Testing
alessiopace
Unit Testing And Mocking
Unit Testing And Mocking
Joe Wilson
Java Unit Test and Coverage Introduction
Java Unit Test and Coverage Introduction
Alex Su
Unit Testing
Unit Testing
François Camus
Test driven development in .Net - 2010 + Eclipse
Test driven development in .Net - 2010 + Eclipse
UTC Fire & Security
Software Quality via Unit Testing
Software Quality via Unit Testing
Shaun Abram
Unit Testing
Unit Testing
Avinash Kadam
.Net Unit Testing with Visual Studio 2010
.Net Unit Testing with Visual Studio 2010
kgayda
Unit testing
Unit testing
Slideshare
Unit Test + Functional Programming = Love
Unit Test + Functional Programming = Love
Alvaro Videla
Tendances
(20)
Unit Testing Fundamentals
Unit Testing Fundamentals
Workshop unit test
Workshop unit test
Clean Unit Test Patterns
Clean Unit Test Patterns
Unit Testing
Unit Testing
Unit Tests And Automated Testing
Unit Tests And Automated Testing
Unit Testing 101
Unit Testing 101
An Introduction to Unit Testing
An Introduction to Unit Testing
Automated Unit Testing
Automated Unit Testing
Understanding Unit Testing
Understanding Unit Testing
Unit Testing
Unit Testing
Embrace Unit Testing
Embrace Unit Testing
Unit Testing And Mocking
Unit Testing And Mocking
Java Unit Test and Coverage Introduction
Java Unit Test and Coverage Introduction
Unit Testing
Unit Testing
Test driven development in .Net - 2010 + Eclipse
Test driven development in .Net - 2010 + Eclipse
Software Quality via Unit Testing
Software Quality via Unit Testing
Unit Testing
Unit Testing
.Net Unit Testing with Visual Studio 2010
.Net Unit Testing with Visual Studio 2010
Unit testing
Unit testing
Unit Test + Functional Programming = Love
Unit Test + Functional Programming = Love
En vedette
What's with All This Talk About Coverage?
What's with All This Talk About Coverage?
DVClub
Presentation slides: "How to get 100% code coverage"
Presentation slides: "How to get 100% code coverage"
Rapita Systems Ltd
Code Coverage and Test Suite Effectiveness: Empirical Study with Real Bugs in...
Code Coverage and Test Suite Effectiveness: Empirical Study with Real Bugs in...
Pavneet Singh Kochhar
Comparing model coverage and code coverage in Model Driven testing: an explor...
Comparing model coverage and code coverage in Model Driven testing: an explor...
REvERSE University of Naples Federico II
Functional Coverage Development Tips - Mentor Graphics
Functional Coverage Development Tips - Mentor Graphics
eInfochips (An Arrow Company)
Tools and techniques of code coverage testing
Tools and techniques of code coverage testing
IAEME Publication
Pragmatic Code Coverage
Pragmatic Code Coverage
Alexandre (Shura) Iline
IoT 개발자를 위한 Embedded C에서 Test Coverage를 추출해보자
IoT 개발자를 위한 Embedded C에서 Test Coverage를 추출해보자
Taeyeop Kim
Code Coverage in Theory and in practice form the DO178B perspective
Code Coverage in Theory and in practice form the DO178B perspective
Engineering Software Lab
Session 7 code_functional_coverage
Session 7 code_functional_coverage
Nirav Desai
Code coverage analysis in testing
Code coverage analysis in testing
Ni
Code coverage
Code coverage
Vijayan Reddy
Code Coverage
Code Coverage
Ernani Omar Cruz
Code coverage
Code coverage
Return on Intelligence
Test Strategy
Test Strategy
Zbyszek Mockun
En vedette
(15)
What's with All This Talk About Coverage?
What's with All This Talk About Coverage?
Presentation slides: "How to get 100% code coverage"
Presentation slides: "How to get 100% code coverage"
Code Coverage and Test Suite Effectiveness: Empirical Study with Real Bugs in...
Code Coverage and Test Suite Effectiveness: Empirical Study with Real Bugs in...
Comparing model coverage and code coverage in Model Driven testing: an explor...
Comparing model coverage and code coverage in Model Driven testing: an explor...
Functional Coverage Development Tips - Mentor Graphics
Functional Coverage Development Tips - Mentor Graphics
Tools and techniques of code coverage testing
Tools and techniques of code coverage testing
Pragmatic Code Coverage
Pragmatic Code Coverage
IoT 개발자를 위한 Embedded C에서 Test Coverage를 추출해보자
IoT 개발자를 위한 Embedded C에서 Test Coverage를 추출해보자
Code Coverage in Theory and in practice form the DO178B perspective
Code Coverage in Theory and in practice form the DO178B perspective
Session 7 code_functional_coverage
Session 7 code_functional_coverage
Code coverage analysis in testing
Code coverage analysis in testing
Code coverage
Code coverage
Code Coverage
Code Coverage
Code coverage
Code coverage
Test Strategy
Test Strategy
Similaire à Unit Testing Done Right
Finding Needles in Haystacks
Finding Needles in Haystacks
snyff
Developer testing 101: Become a Testing Fanatic
Developer testing 101: Become a Testing Fanatic
LB Denker
Testing the Untestable
Testing the Untestable
Mark Baker
Escaping Test Hell - Our Journey - XPDays Ukraine 2013
Escaping Test Hell - Our Journey - XPDays Ukraine 2013
Wojciech Seliga
Test in action – week 1
Test in action – week 1
Yi-Huan Chan
An Overview of automated testing (1)
An Overview of automated testing (1)
Rodrigo Lopes
How to use selenium successfully
How to use selenium successfully
TEST Huddle
WTF TDD?
WTF TDD?
jeremyw
Building unit tests correctly
Building unit tests correctly
Dror Helper
Enhanced Web Service Testing: A Better Mock Structure
Enhanced Web Service Testing: A Better Mock Structure
CRMScienceKirk
Machine learning in PHP
Machine learning in PHP
Damien Seguy
Breaking Dependencies To Allow Unit Testing - Steve Smith | FalafelCON 2014
Breaking Dependencies To Allow Unit Testing - Steve Smith | FalafelCON 2014
FalafelSoftware
Breaking Dependencies to Allow Unit Testing
Breaking Dependencies to Allow Unit Testing
Steven Smith
Escaping Test Hell - ACCU 2014
Escaping Test Hell - ACCU 2014
Wojciech Seliga
Testing Ext JS and Sencha Touch
Testing Ext JS and Sencha Touch
Mats Bryntse
Understanding TDD - theory, practice, techniques and tips.
Understanding TDD - theory, practice, techniques and tips.
Malinda Kapuruge
Developer testing 201: When to Mock and When to Integrate
Developer testing 201: When to Mock and When to Integrate
LB Denker
Unit Testing in SharePoint 2010
Unit Testing in SharePoint 2010
Chris Weldon
Machine learning in php singapore
Machine learning in php singapore
Damien Seguy
Behat bdd training (php) course slides pdf
Behat bdd training (php) course slides pdf
seleniumbootcamp
Similaire à Unit Testing Done Right
(20)
Finding Needles in Haystacks
Finding Needles in Haystacks
Developer testing 101: Become a Testing Fanatic
Developer testing 101: Become a Testing Fanatic
Testing the Untestable
Testing the Untestable
Escaping Test Hell - Our Journey - XPDays Ukraine 2013
Escaping Test Hell - Our Journey - XPDays Ukraine 2013
Test in action – week 1
Test in action – week 1
An Overview of automated testing (1)
An Overview of automated testing (1)
How to use selenium successfully
How to use selenium successfully
WTF TDD?
WTF TDD?
Building unit tests correctly
Building unit tests correctly
Enhanced Web Service Testing: A Better Mock Structure
Enhanced Web Service Testing: A Better Mock Structure
Machine learning in PHP
Machine learning in PHP
Breaking Dependencies To Allow Unit Testing - Steve Smith | FalafelCON 2014
Breaking Dependencies To Allow Unit Testing - Steve Smith | FalafelCON 2014
Breaking Dependencies to Allow Unit Testing
Breaking Dependencies to Allow Unit Testing
Escaping Test Hell - ACCU 2014
Escaping Test Hell - ACCU 2014
Testing Ext JS and Sencha Touch
Testing Ext JS and Sencha Touch
Understanding TDD - theory, practice, techniques and tips.
Understanding TDD - theory, practice, techniques and tips.
Developer testing 201: When to Mock and When to Integrate
Developer testing 201: When to Mock and When to Integrate
Unit Testing in SharePoint 2010
Unit Testing in SharePoint 2010
Machine learning in php singapore
Machine learning in php singapore
Behat bdd training (php) course slides pdf
Behat bdd training (php) course slides pdf
Dernier
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Delhi Whatsup 9873940964 Enjoy Unlimited Pleasure
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
kellynguyen01
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
SolGuruz
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and Backend
Arshad QA
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
shikhaohhpro
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
OnePlan Solutions
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
bodapatigopi8531
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Alberto González Trastoy
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Steffen Staab
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
Delhi Call girls
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
harshavardhanraghave
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
kalichargn70th171
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
AxelRicardoTrocheRiq
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽❤️🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽❤️🧑🏻 89...
gurkirankumar98700
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
kalichargn70th171
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
anilsa9823
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
ComplianceQuest1
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
ThousandEyes
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Call Girls In Delhi Whatsup 9873940964 Enjoy Unlimited Pleasure
Dernier
(20)
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and Backend
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽❤️🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽❤️🧑🏻 89...
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Unit Testing Done Right
1.
Unit testing done
right
2.
whoami • Brian Fenton •
Bigcommerce • @brianfenton • Mostly PHP and APIs
3.
What is a
unit test? • Small • Fast • Tests a single unit <- Here there be dragons
4.
Unit?
5.
It depends…
6.
“A single piece
of a class’s public-facing functionality”
7.
History lesson
8.
Goals of unit
testing over time • Find bugs • Find regressions • Improve design
9.
Philosophies • Traditional testing •
TDD • XP • BDD
10.
Behavior vs. Methods
11.
https://twitter.com/sarahmei/status/633895726993440768
12.
How did we
get here?
13.
Code coverage
14.
"When a measure
becomes a target, it ceases to be a good measure.” - Goodhart’s Law
15.
Different kinds of
coverage • Line • Function/Method • Class/Trait
16.
Gresham’s Law /ht @noahsussman
17.
Coverage tricks • if
(false) this_function_call_is_covered(); • // @codeCoverageIgnore • multiple checks on the same line
18.
Line coverage can
only prove code wasn’t executed
19.
Opcodes
20.
Example for ($i =
0; $i > 10; $i++) { if ($i % 2 === 0) { echo "Even: "; } else { echo "Odd: "; } echo $i, "n"; }
21.
More kinds of
coverage • Opcode • Branch • Path
22.
23.
Testing your privates •
Don’t! • Extract functionality to a collaborator or don’t test it
24.
25.
Don’t test your implementation
26.
Flaky tests
27.
Flaky tests • Randomness •
Time/environment • Network/services
28.
Randomness • Can the
randomness come from outside? • Do you need to know the exact value? • Can you just verify “randomness”?
29.
Namespace trick namespace MyNamespace;
function random() { return mt_rand(); }
30.
Namespace trick namespace MyNamespace
{ function random() { return 7; } } namespace MyTests; … function testRandomNumberGenerator() { $this-‐>assertSame(7, random()); }
31.
Environment • Time • Shell
vars/ini settings/config values • Filesystem
32.
Network/Services
33.
Good unit tests •
Single reason to fail • Clearly named • testGuestCanRegisterWithValidInformation • testProcessData
34.
Good unit tests •
Easy to read • Clean • Arrange, Act, Assert
35.
Good unit tests •
Fast • No side effects
36.
Listening to your
tests
37.
Test smells • Too
many mocks • Lots of setup required • Can’t test w/o database/network/etc… • Can’t inject mocks where needed
38.
Test smells • Mocks
returning mocks • Flaky results • Unrelated code changes breaking tests • Testing the implementation
39.
Questions? https://joind.in/14721
Télécharger maintenant