SlideShare une entreprise Scribd logo
1  sur  15
Télécharger pour lire hors ligne
Beautiful Tests
Tests that are beautiful for their simplicity

Monday, October 21, 13
Binary Search

Monday, October 21, 13
The bug:
int mid = (low + high) / 2;
Solution:
int mid = low + ((high - low) / 2);
Show off:
int mid = (low + high) >>> 1;

Monday, October 21, 13
My initial testing
strategy
Start with smoke tests.
Add some boundary value tests
Continue with various thorough and
exhaustive types of tests
Finally, add some performance tests

Monday, October 21, 13
Smoking Allowed (and
Encouraged)
These are designed to make sure that the
code does the right thing when used in the
most basic manner

Monday, October 21, 13
Smoking Allowed (and
Encouraged)
“confidence maintenance”

Monday, October 21, 13
Pushing the Boundaries
Boundary testing is designed to explore and
validate what happens when the code has to
deal with extremes and corner cases

Monday, October 21, 13
Pushing the Boundaries

very large array ????
Monday, October 21, 13
Pushing the Boundaries

Monday, October 21, 13
Pushing the Boundaries

Monday, October 21, 13
Random Acts of Testing
A way to generate a large and diverse set of
inputs
A set of generalized assertions that will
work on any input

Monday, October 21, 13
Random Acts of Testing

Monday, October 21, 13
Performance Anxiety

Monday, October 21, 13
Conclusion
Unit Tests allows you to make big changes to
code quickly
Your tests give you confidence that you've
done enough for now and can stop tweaking
and move on to the next thing
Good unit tests can help document and
define what something is supposed to do
Unit Tests help you really understand the
design of the code you are working on
Monday, October 21, 13
Monday, October 21, 13

Contenu connexe

En vedette (13)

Final WQWBIA Package
Final WQWBIA PackageFinal WQWBIA Package
Final WQWBIA Package
 
13 Sonya Ecton Resume
13 Sonya Ecton Resume13 Sonya Ecton Resume
13 Sonya Ecton Resume
 
2. grey head company profile
2. grey head   company profile2. grey head   company profile
2. grey head company profile
 
Timothy_Kane_Samples
Timothy_Kane_SamplesTimothy_Kane_Samples
Timothy_Kane_Samples
 
Financial mgt
Financial mgtFinancial mgt
Financial mgt
 
Gerencia industrial Presentación
Gerencia industrial Presentación Gerencia industrial Presentación
Gerencia industrial Presentación
 
Fuimos al teatro
Fuimos al teatroFuimos al teatro
Fuimos al teatro
 
Memória 3º evento apicultura agreste 9.4.15
Memória 3º evento apicultura agreste 9.4.15Memória 3º evento apicultura agreste 9.4.15
Memória 3º evento apicultura agreste 9.4.15
 
Certificate_5
Certificate_5Certificate_5
Certificate_5
 
LeadershipDevelopment
LeadershipDevelopmentLeadershipDevelopment
LeadershipDevelopment
 
Resources+Illustrated+Capability+Statement
Resources+Illustrated+Capability+StatementResources+Illustrated+Capability+Statement
Resources+Illustrated+Capability+Statement
 
Begginer Microsoft excel xp certificate
Begginer Microsoft excel xp certificateBegginer Microsoft excel xp certificate
Begginer Microsoft excel xp certificate
 
El celular
El  celularEl  celular
El celular
 

Plus de Silicon Straits

Plus de Silicon Straits (20)

[THE PIRATES’ 3-year anniversary] Jonas' story
[THE PIRATES’ 3-year anniversary] Jonas' story[THE PIRATES’ 3-year anniversary] Jonas' story
[THE PIRATES’ 3-year anniversary] Jonas' story
 
Focus - Quang Trung
Focus - Quang TrungFocus - Quang Trung
Focus - Quang Trung
 
“One man” development process model
“One man” development process model“One man” development process model
“One man” development process model
 
Silicon Straits Origin
Silicon Straits OriginSilicon Straits Origin
Silicon Straits Origin
 
Kotlin Overview
Kotlin OverviewKotlin Overview
Kotlin Overview
 
What we use to build Android apps at Silicon Straits
What we use to build Android apps at Silicon StraitsWhat we use to build Android apps at Silicon Straits
What we use to build Android apps at Silicon Straits
 
Silicon Straits Internship Program Review - Season 1
Silicon Straits Internship Program Review - Season 1Silicon Straits Internship Program Review - Season 1
Silicon Straits Internship Program Review - Season 1
 
[SIP 2015] Hardware Proposal: Ads view counter for AdsBox
[SIP 2015] Hardware Proposal: Ads view counter for AdsBox[SIP 2015] Hardware Proposal: Ads view counter for AdsBox
[SIP 2015] Hardware Proposal: Ads view counter for AdsBox
 
[SIP 2015] Design Proposal: Design and animated prototype
[SIP 2015] Design Proposal: Design and animated prototype[SIP 2015] Design Proposal: Design and animated prototype
[SIP 2015] Design Proposal: Design and animated prototype
 
[SIP 2015] iOS Proposal: VIPER
[SIP 2015] iOS Proposal: VIPER[SIP 2015] iOS Proposal: VIPER
[SIP 2015] iOS Proposal: VIPER
 
[SIP 2015] QA Intern: Test Automation
[SIP 2015] QA Intern: Test Automation[SIP 2015] QA Intern: Test Automation
[SIP 2015] QA Intern: Test Automation
 
[SIP 2015] Back-end Proposal: Chat System using Socket.io
[SIP 2015] Back-end Proposal: Chat System using Socket.io[SIP 2015] Back-end Proposal: Chat System using Socket.io
[SIP 2015] Back-end Proposal: Chat System using Socket.io
 
[SIP 2015] Marketing Proposal: Making edit flow more informative and simpler
[SIP 2015] Marketing Proposal: Making edit flow more informative and simpler[SIP 2015] Marketing Proposal: Making edit flow more informative and simpler
[SIP 2015] Marketing Proposal: Making edit flow more informative and simpler
 
[Ebook] UI Document - Tú Bùi
[Ebook] UI Document - Tú Bùi[Ebook] UI Document - Tú Bùi
[Ebook] UI Document - Tú Bùi
 
[Sharing T3] Tình hình chiến sự Siêu anh hùng - Tú Bùi
[Sharing T3] Tình hình chiến sự Siêu anh hùng - Tú Bùi[Sharing T3] Tình hình chiến sự Siêu anh hùng - Tú Bùi
[Sharing T3] Tình hình chiến sự Siêu anh hùng - Tú Bùi
 
[Sharing T1] How to take good photos - Anh Minh
[Sharing T1] How to take good photos - Anh Minh[Sharing T1] How to take good photos - Anh Minh
[Sharing T1] How to take good photos - Anh Minh
 
[Sharing T12] Tín dụng - Bí quyết tay trắng làm nên nợ nần - Minh Hòa
[Sharing T12] Tín dụng - Bí quyết tay trắng làm nên nợ nần - Minh Hòa[Sharing T12] Tín dụng - Bí quyết tay trắng làm nên nợ nần - Minh Hòa
[Sharing T12] Tín dụng - Bí quyết tay trắng làm nên nợ nần - Minh Hòa
 
[Sharing T12] Một số câu chuyện về Âm lịch và Dương lịch - Xuân Quang
[Sharing T12] Một số câu chuyện về Âm lịch và Dương lịch - Xuân Quang[Sharing T12] Một số câu chuyện về Âm lịch và Dương lịch - Xuân Quang
[Sharing T12] Một số câu chuyện về Âm lịch và Dương lịch - Xuân Quang
 
[2014 SSS Infographic] 2014, SSS có gì đặc biệt?
[2014 SSS Infographic] 2014, SSS có gì đặc biệt?[2014 SSS Infographic] 2014, SSS có gì đặc biệt?
[2014 SSS Infographic] 2014, SSS có gì đặc biệt?
 
[Sharing T11] Hussar - The winged cavalry - Cường Đoàn
[Sharing T11] Hussar - The winged cavalry - Cường Đoàn[Sharing T11] Hussar - The winged cavalry - Cường Đoàn
[Sharing T11] Hussar - The winged cavalry - Cường Đoàn
 

Dernier

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 

Dernier (20)

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
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...
 
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
 
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
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
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
 
"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 ...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
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...
 
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 ...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
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
 
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
 
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
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 

Beatiful tests