SlideShare una empresa de Scribd logo
1 de 15
Descargar para leer sin conexión
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

Más contenido relacionado

Destacado (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
 

Más de Silicon Straits

Más 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
 

Último

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
 
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
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Último (20)

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
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
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...
 
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
 
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
 
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
 
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
 
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
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
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
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 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 ...
 
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
 
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...
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 

Beatiful tests