SlideShare a Scribd company logo
1 of 73
Download to read offline
Tes t Driven Development with
            YUI Tes t
             Nicholas C . Zakas
  P rincipal Front E nd E ngineer, Yahoo!
Who's this g uy?
• P rincipal Front E nd E ngineer, Yahoo!
  Front P age
• YUI C ontributor
• Author
Tes t Driven Development
         Design
        Features



 Run               Write
Tests              Tests



         Write
         Code
Why Tes t Driven Development?
 •   No such thing as a small change
 •   S pecifically identifies tasks
 •   You understand your code the best
 •   Upfront investment pays off later
 •   Q A resources are limited
 •   P eace of mind
Tes t Driven Development
         Design
        Features



 Run               Write
Tests              Tests



         Write
         Code
The R equirements
• Usually, requirements are functional
• Translate into interfaces (objects and
  methods)
• D escribe what each method should do in
  terms of inputs and outputs




                                  Design
                                 Features
The R equirements
• Need: When a username is entered,
  ignore spaces at the beginning and end
  of text
• Translation: I need a trim function
• Trim function:
  – R emove leading white space from the given
    string and return result
  – R emove trailing white space from the given
    string and return result
                                      Design
                                     Features
Tes t Driven Development
         Design
        Features



 Run               Write
Tests              Tests



         Write
         Code
Unit Tes ts
• Test a small, isolated part of code (unit)
  – Unit = method
• Test inputs and outputs
  – O ne set at a time
• Test: “G iven this input, I expect this
  output.”



                                       Write
                                       Tests
Unit Tes ting C omplaints
•   R amp-up time
•   Unfamiliar syntax/ concepts
•   Test harness setup is hard
•   Writing tests takes too long
•   C an't figure out what broke when a test
    fails


                                      Write
                                      Tests
YUI Tes t
• Unit testing framework for JavaS cript
• B uilt on top of YUI
• “D ogfooded” by YUI
  – S ee “tests” directory in download
• E xtensive documentation:
  http:/ developer.yahoo.com/ yuitest/
        /                    yui/


                                         Write
                                         Tests
YUI Tes t
                               Cheatsheet

  Narrative      Functional
documentation    examples




                                  API
                              documentation


                                    Write
                                    Tests
G oals of YUI Tes t
•   E asy to write your first test
•   S imple, logical syntax
•   Works the way JavaS cript works
•   G et up and running fast
•   Useful failure messages out of the box
•   Works with any code, not just YUI
    – P rototype, jQ uery, D ojo, etc., welcome!

                                            Write
                                            Tests
G etting S tarted with YUI Tes t
•   C reate an HTM L page
•   Include required JavaS cript/ S S files
                                 C
•   Include JavaS cript to test
•   Write one or more tests
•   Include boilerplate JavaS cript
•   O pen page in browser


                                       Write
                                       Tests
Writing Tes ts with YUI Tes t




                        Write
                        Tests
Writing Tes ts with YUI Tes t




                        Write
                        Tests
Writing Tes ts with YUI Tes t:
          E xample
• Trim function:
  – R emove leading white space from the given
    string and return result
  – R emove trailing white space from the given
    string and return result




                                       Write
                                       Tests
Writing Tes ts with YUI Tes t:
         E xample




                         Write
                         Tests
Writing Tes ts with YUI Tes t:
         E xample




                         Write
                         Tests
Failing is g ood!
Tes t Driven Development
         Design
        Features



 Run               Write
Tests              Tests



         Write
         Code
Implementing the Feature
•   S tart with first failed test
•   Write code to make that test pass
•   M ove on to second failed test
•   Write code to make that test pass
•   E tc.



                                        Write
                                        Code
Implementing the Feature:
       E xample




                     Write
                     Code
Tes t Driven Development
         Design
        Features



 Run               Write
Tests              Tests



         Write
         Code
Tes ting the Feature:
       E xample




                    Run
                    Tests
Tes t Driven Development
         Design
        Features



 Run                Write
Tests        Fail   Tests



         Write
         Code
Implementing the Feature:
       E xample




                     Write
                     Code
Tes t Driven Development
         Design
        Features



 Run                Write
Tests        Fail   Tests



         Write
         Code
Tes ting the Feature:
       E xample




                    Run
                    Tests
Tes t Driven Development
           Design
          Features
Pass



   Run                Write
  Tests        Fail   Tests



           Write
           Code
Tes t Driven Development
           Design
          Features
Pass



   Run                Write
  Tests        Fail   Tests



           Write
           Code
Tes t Driven Development
          Bug Reported
Pass



   Run                   Write
  Tests          Fail    Tests



             Write
             Code
S omething Went Wrong -
            How?
• Incomplete test coverage
• Incomplete feature definition
• Unintended use of feature




                                  Bug Reported
S omething Went Wrong -
            What?
“When I entered a username that had both
  leading and trailing white space, the
  application received a string that had no
  leading white space but still had trailing
  white space.”




                                 Bug Reported
S omething Went Wrong -
            What?
• Trim function:
  – R emove leading white space from the given
    string and return result
  – R emove trailing white space from the given
    string and return result
  – If the given string has both leading and
    trailing white space, remove both and return
    result

                                    Bug Reported
Tes t Driven Development
          Bug Reported
Pass



   Run                   Write
  Tests          Fail    Tests



             Write
             Code
Updating Tes ts : E xample




                       Write
                       Tests
Updating Tes ts : E xample




                       Write
                       Tests
Tes t Driven Development
          Bug Reported
Pass



   Run                   Write
  Tests          Fail    Tests



             Write
             Code
Fixing the Feature: E xample




                       Write
                       Code
Tes t Driven Development
          Bug Reported
Pass



   Run                   Write
  Tests          Fail    Tests



             Write
             Code
Tes ting the Fix: E xample




                       Run
                       Tests
Tes t Driven Development
          Bug Reported
Pass



   Run                   Write
  Tests          Fail    Tests



             Write
             Code
Tes t Driven Development
          Design
          Feature
Pass



   Run               Write
  Tests       Fail   Tests



           Write
           Code
TDD C halleng es on the Web
The B rows er E nvironment
• JavaS cript tied to page using events
• E xecution may be:
  – S ynchronous
  – Asynchronous
• D ifferent browsers behave differently
YUI Tes t Helps
• S imple event simulation across all A-
  grade browsers
  – And some others!
• Asynchronous code testing
• D ifferent browsers...still behave
  differently
  – (S orry)
E vent S imulation with YUI
           Tes t
E vent S imulation with YUI
           Tes t
E vent S imulation Example
E vent S imulation Us es
• Test reusable widgets (YUI does this)
• Functional tests (a la S elenium)
• Fun!
As ynchronous Tes ts
• Two ways to accomplish:
  – C all wait(func, delay)
  – C all wait(timeout) and then resume(func)
As ynchronous Tes ts
As ynchronous Tes ts
As ynchronous Tes ting
E xample
WARNING!
Asynchronous testing should not be
 used for testing Ajax responses.
Other YUI Tes t Features
Tes t S uites
Tes t S uites
Hooking into Tes tR unner
• TestR unner is completely event-driven
• E ach event provides the results to that
  point
• TestLogger is just a base visualization
• D esign your own visualization
Tes tR unner E vents
•   pass
•   ignore
•   fail
•   begin
•   complete
•   testcasebegin
•   testcasecomplete
•   testsuitebegin
•   testsuitecomplete
Tes tR unner E vents
Tes t R eporting
R ecommendations
R amping up
• For every JavaS cript file, have a
  corresponding test file (even if empty)
  – file.js and file_tests.js
• S tart writing tests for bugs
• Write tests from the start for new
  features
  – E ach object has a test suite
  – E ach method has a test case
• Automate running of tests
C oming in YUI Tes t 3.0
•   M ock objects
•   M ore simulated events
•   B etter error detection
•   New visualizations
S ummary
Tes t Driven Development
          Design
          Feature
Pass



   Run               Write
  Tests       Fail   Tests



           Write
           Code
http://developer.yahoo.com/yui/yuitest/
Ques tions ?
E tcetera
• M y blog:    www.nczonline.net
• M y email:   nzakas@ yahoo-inc.com
Happy tes ting !
C reative C ommons Imag es
                     Us edlords utch/74873411/
• http:/www.flickr.com/
        /              photos/
• http:/flickr.com/
        /          photos/zeer-product-
  reviews/  2446364000/
• http:/flickr.com/
        /          photos/kristopherm/ 2230424556/
• http:/flickr.com/
        /          photos/adriana-lukas/846398363/
• http:/flickr.com/
        /          photos/quas/  313957/
• http:/flickr.com/
        /          photos/ 27061495/
                          mc/
• http:/flickr.com/
        /          photos/oberazzi/ 318947873/
• http:/flickr.com/
        /          photos/cristic/359572656/

More Related Content

What's hot

Introduction to Javascript
Introduction to JavascriptIntroduction to Javascript
Introduction to JavascriptAmit Tyagi
 
Java script final presentation
Java script final presentationJava script final presentation
Java script final presentationAdhoura Academy
 
Introduction to web programming with JavaScript
Introduction to web programming with JavaScriptIntroduction to web programming with JavaScript
Introduction to web programming with JavaScriptT11 Sessions
 
Refactor your way forward
Refactor your way forwardRefactor your way forward
Refactor your way forwardJorge Ortiz
 
Javascript omg!
Javascript omg!Javascript omg!
Javascript omg!bwullems
 
JavaScript For CSharp Developer
JavaScript For CSharp DeveloperJavaScript For CSharp Developer
JavaScript For CSharp DeveloperSarvesh Kushwaha
 
JavaScript - Chapter 5 - Operators
 JavaScript - Chapter 5 - Operators JavaScript - Chapter 5 - Operators
JavaScript - Chapter 5 - OperatorsWebStackAcademy
 
Paris Web - Javascript as a programming language
Paris Web - Javascript as a programming languageParis Web - Javascript as a programming language
Paris Web - Javascript as a programming languageMarco Cedaro
 
JavaScript Tutorial For Beginners | JavaScript Training | JavaScript Programm...
JavaScript Tutorial For Beginners | JavaScript Training | JavaScript Programm...JavaScript Tutorial For Beginners | JavaScript Training | JavaScript Programm...
JavaScript Tutorial For Beginners | JavaScript Training | JavaScript Programm...Edureka!
 
How Testability Inspires AngularJS Design / Ran Mizrahi
How Testability Inspires AngularJS Design / Ran MizrahiHow Testability Inspires AngularJS Design / Ran Mizrahi
How Testability Inspires AngularJS Design / Ran MizrahiRan Mizrahi
 
A Deeper look into Javascript Basics
A Deeper look into Javascript BasicsA Deeper look into Javascript Basics
A Deeper look into Javascript BasicsMindfire Solutions
 

What's hot (20)

Java script ppt
Java script pptJava script ppt
Java script ppt
 
Introduction to Javascript
Introduction to JavascriptIntroduction to Javascript
Introduction to Javascript
 
Java script
Java scriptJava script
Java script
 
Java script final presentation
Java script final presentationJava script final presentation
Java script final presentation
 
Java script
Java scriptJava script
Java script
 
Introduction to web programming with JavaScript
Introduction to web programming with JavaScriptIntroduction to web programming with JavaScript
Introduction to web programming with JavaScript
 
Refactor your way forward
Refactor your way forwardRefactor your way forward
Refactor your way forward
 
Javascript omg!
Javascript omg!Javascript omg!
Javascript omg!
 
JavaScript For CSharp Developer
JavaScript For CSharp DeveloperJavaScript For CSharp Developer
JavaScript For CSharp Developer
 
Java script
Java scriptJava script
Java script
 
JavaScript - Chapter 5 - Operators
 JavaScript - Chapter 5 - Operators JavaScript - Chapter 5 - Operators
JavaScript - Chapter 5 - Operators
 
Paris Web - Javascript as a programming language
Paris Web - Javascript as a programming languageParis Web - Javascript as a programming language
Paris Web - Javascript as a programming language
 
JavaScript Tutorial For Beginners | JavaScript Training | JavaScript Programm...
JavaScript Tutorial For Beginners | JavaScript Training | JavaScript Programm...JavaScript Tutorial For Beginners | JavaScript Training | JavaScript Programm...
JavaScript Tutorial For Beginners | JavaScript Training | JavaScript Programm...
 
Design attern in php
Design attern in phpDesign attern in php
Design attern in php
 
How Testability Inspires AngularJS Design / Ran Mizrahi
How Testability Inspires AngularJS Design / Ran MizrahiHow Testability Inspires AngularJS Design / Ran Mizrahi
How Testability Inspires AngularJS Design / Ran Mizrahi
 
Workin On The Rails Road
Workin On The Rails RoadWorkin On The Rails Road
Workin On The Rails Road
 
Basics of JavaScript
Basics of JavaScriptBasics of JavaScript
Basics of JavaScript
 
Java script
Java scriptJava script
Java script
 
A Deeper look into Javascript Basics
A Deeper look into Javascript BasicsA Deeper look into Javascript Basics
A Deeper look into Javascript Basics
 
Java script
Java scriptJava script
Java script
 

Viewers also liked

Progressive Enhancement 2.0 (jQuery Conference SF Bay Area 2011)
Progressive Enhancement 2.0 (jQuery Conference SF Bay Area 2011)Progressive Enhancement 2.0 (jQuery Conference SF Bay Area 2011)
Progressive Enhancement 2.0 (jQuery Conference SF Bay Area 2011)Nicholas Zakas
 
Nicholas' Performance Talk at Google
Nicholas' Performance Talk at GoogleNicholas' Performance Talk at Google
Nicholas' Performance Talk at GoogleNicholas Zakas
 
JavaScript Variable Performance
JavaScript Variable PerformanceJavaScript Variable Performance
JavaScript Variable PerformanceNicholas Zakas
 
High Performance JavaScript (Amazon DevCon 2011)
High Performance JavaScript (Amazon DevCon 2011)High Performance JavaScript (Amazon DevCon 2011)
High Performance JavaScript (Amazon DevCon 2011)Nicholas Zakas
 
Mobile Web Speed Bumps
Mobile Web Speed BumpsMobile Web Speed Bumps
Mobile Web Speed BumpsNicholas Zakas
 
Progressive Enhancement 2.0 (Conference Agnostic)
Progressive Enhancement 2.0 (Conference Agnostic)Progressive Enhancement 2.0 (Conference Agnostic)
Progressive Enhancement 2.0 (Conference Agnostic)Nicholas Zakas
 
Evaluasi pendidikan tentang test standar dan buatan
Evaluasi pendidikan tentang test standar dan buatanEvaluasi pendidikan tentang test standar dan buatan
Evaluasi pendidikan tentang test standar dan buatanUHN
 
Enterprise JavaScript Error Handling (Ajax Experience 2008)
Enterprise JavaScript Error Handling (Ajax Experience 2008)Enterprise JavaScript Error Handling (Ajax Experience 2008)
Enterprise JavaScript Error Handling (Ajax Experience 2008)Nicholas Zakas
 
High Performance JavaScript 2011
High Performance JavaScript 2011High Performance JavaScript 2011
High Performance JavaScript 2011Nicholas Zakas
 
The Engines of Software Development: Testing and Test Driven Development
The Engines of Software Development: Testing and Test Driven DevelopmentThe Engines of Software Development: Testing and Test Driven Development
The Engines of Software Development: Testing and Test Driven DevelopmentLemi Orhan Ergin
 
Speed Up Your JavaScript
Speed Up Your JavaScriptSpeed Up Your JavaScript
Speed Up Your JavaScriptNicholas Zakas
 
Maintainable JavaScript 2012
Maintainable JavaScript 2012Maintainable JavaScript 2012
Maintainable JavaScript 2012Nicholas Zakas
 
Writing Efficient JavaScript
Writing Efficient JavaScriptWriting Efficient JavaScript
Writing Efficient JavaScriptNicholas Zakas
 

Viewers also liked (14)

Progressive Enhancement 2.0 (jQuery Conference SF Bay Area 2011)
Progressive Enhancement 2.0 (jQuery Conference SF Bay Area 2011)Progressive Enhancement 2.0 (jQuery Conference SF Bay Area 2011)
Progressive Enhancement 2.0 (jQuery Conference SF Bay Area 2011)
 
Nicholas' Performance Talk at Google
Nicholas' Performance Talk at GoogleNicholas' Performance Talk at Google
Nicholas' Performance Talk at Google
 
JavaScript Variable Performance
JavaScript Variable PerformanceJavaScript Variable Performance
JavaScript Variable Performance
 
Responsive interfaces
Responsive interfacesResponsive interfaces
Responsive interfaces
 
High Performance JavaScript (Amazon DevCon 2011)
High Performance JavaScript (Amazon DevCon 2011)High Performance JavaScript (Amazon DevCon 2011)
High Performance JavaScript (Amazon DevCon 2011)
 
Mobile Web Speed Bumps
Mobile Web Speed BumpsMobile Web Speed Bumps
Mobile Web Speed Bumps
 
Progressive Enhancement 2.0 (Conference Agnostic)
Progressive Enhancement 2.0 (Conference Agnostic)Progressive Enhancement 2.0 (Conference Agnostic)
Progressive Enhancement 2.0 (Conference Agnostic)
 
Evaluasi pendidikan tentang test standar dan buatan
Evaluasi pendidikan tentang test standar dan buatanEvaluasi pendidikan tentang test standar dan buatan
Evaluasi pendidikan tentang test standar dan buatan
 
Enterprise JavaScript Error Handling (Ajax Experience 2008)
Enterprise JavaScript Error Handling (Ajax Experience 2008)Enterprise JavaScript Error Handling (Ajax Experience 2008)
Enterprise JavaScript Error Handling (Ajax Experience 2008)
 
High Performance JavaScript 2011
High Performance JavaScript 2011High Performance JavaScript 2011
High Performance JavaScript 2011
 
The Engines of Software Development: Testing and Test Driven Development
The Engines of Software Development: Testing and Test Driven DevelopmentThe Engines of Software Development: Testing and Test Driven Development
The Engines of Software Development: Testing and Test Driven Development
 
Speed Up Your JavaScript
Speed Up Your JavaScriptSpeed Up Your JavaScript
Speed Up Your JavaScript
 
Maintainable JavaScript 2012
Maintainable JavaScript 2012Maintainable JavaScript 2012
Maintainable JavaScript 2012
 
Writing Efficient JavaScript
Writing Efficient JavaScriptWriting Efficient JavaScript
Writing Efficient JavaScript
 

Similar to Test Driven Development With YUI Test (Ajax Experience 2008)

Better Perl Practices
Better Perl PracticesBetter Perl Practices
Better Perl PracticesJay Shirley
 
Presentations Unusual Java Bugs And Detecting Them Using Foss Tools
Presentations Unusual Java Bugs And Detecting Them Using Foss ToolsPresentations Unusual Java Bugs And Detecting Them Using Foss Tools
Presentations Unusual Java Bugs And Detecting Them Using Foss ToolsGanesh Samarthyam
 
Unit Test Your Database
Unit Test Your DatabaseUnit Test Your Database
Unit Test Your DatabaseDavid Wheeler
 
Javascript Framework Roundup FYB
Javascript Framework Roundup FYBJavascript Framework Roundup FYB
Javascript Framework Roundup FYBnukeevry1
 
Session #3: "It Works on My Machine!" Closing the Loop Between Development & ...
Session #3: "It Works on My Machine!" Closing the Loop Between Development & ...Session #3: "It Works on My Machine!" Closing the Loop Between Development & ...
Session #3: "It Works on My Machine!" Closing the Loop Between Development & ...Steve Lange
 
Efficient JavaScript Development
Efficient JavaScript DevelopmentEfficient JavaScript Development
Efficient JavaScript Developmentwolframkriesing
 
javabasics_ programming development chapter01
javabasics_ programming development chapter01javabasics_ programming development chapter01
javabasics_ programming development chapter01Udeshg90
 
Exploring No Mans Land with Keyword-Driven Testing
Exploring No Mans Land with Keyword-Driven TestingExploring No Mans Land with Keyword-Driven Testing
Exploring No Mans Land with Keyword-Driven TestingMartinGijsen
 
Just Java2007 - Daniel Wildt - Tools For Java Test Automation
Just Java2007 - Daniel Wildt - Tools For Java Test AutomationJust Java2007 - Daniel Wildt - Tools For Java Test Automation
Just Java2007 - Daniel Wildt - Tools For Java Test AutomationDaniel Wildt
 
Test-Driven Development (TDD)
Test-Driven Development (TDD)Test-Driven Development (TDD)
Test-Driven Development (TDD)Brian Rasmussen
 
PHX Session #1: Development Best Practices And How Microsoft Helps
PHX Session #1: Development  Best  Practices And  How  Microsoft  HelpsPHX Session #1: Development  Best  Practices And  How  Microsoft  Helps
PHX Session #1: Development Best Practices And How Microsoft HelpsSteve Lange
 
Pivotal Labs Open View Presentation Quality Assurance And Developer Testing
Pivotal Labs Open View Presentation Quality Assurance And Developer TestingPivotal Labs Open View Presentation Quality Assurance And Developer Testing
Pivotal Labs Open View Presentation Quality Assurance And Developer Testingguestc8adce
 
A tutorial on EMF-IncQuery
A tutorial on EMF-IncQueryA tutorial on EMF-IncQuery
A tutorial on EMF-IncQueryIstvan Rath
 
Testing Sap: Modern Methodology
Testing Sap: Modern MethodologyTesting Sap: Modern Methodology
Testing Sap: Modern MethodologyEthan Jewett
 
Test automation expert days
Test automation   expert daysTest automation   expert days
Test automation expert daysOren Rubin
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven DevelopmentZendCon
 
Scripting Recipes for Testers
Scripting Recipes for TestersScripting Recipes for Testers
Scripting Recipes for TestersAdam Goucher
 

Similar to Test Driven Development With YUI Test (Ajax Experience 2008) (20)

Better Perl Practices
Better Perl PracticesBetter Perl Practices
Better Perl Practices
 
Presentations Unusual Java Bugs And Detecting Them Using Foss Tools
Presentations Unusual Java Bugs And Detecting Them Using Foss ToolsPresentations Unusual Java Bugs And Detecting Them Using Foss Tools
Presentations Unusual Java Bugs And Detecting Them Using Foss Tools
 
Unit Test Your Database
Unit Test Your DatabaseUnit Test Your Database
Unit Test Your Database
 
Javascript Framework Roundup FYB
Javascript Framework Roundup FYBJavascript Framework Roundup FYB
Javascript Framework Roundup FYB
 
Test
TestTest
Test
 
Session #3: "It Works on My Machine!" Closing the Loop Between Development & ...
Session #3: "It Works on My Machine!" Closing the Loop Between Development & ...Session #3: "It Works on My Machine!" Closing the Loop Between Development & ...
Session #3: "It Works on My Machine!" Closing the Loop Between Development & ...
 
Front-End UnitTesting
Front-End UnitTestingFront-End UnitTesting
Front-End UnitTesting
 
Efficient JavaScript Development
Efficient JavaScript DevelopmentEfficient JavaScript Development
Efficient JavaScript Development
 
javabasics_ programming development chapter01
javabasics_ programming development chapter01javabasics_ programming development chapter01
javabasics_ programming development chapter01
 
Exploring No Mans Land with Keyword-Driven Testing
Exploring No Mans Land with Keyword-Driven TestingExploring No Mans Land with Keyword-Driven Testing
Exploring No Mans Land with Keyword-Driven Testing
 
Just Java2007 - Daniel Wildt - Tools For Java Test Automation
Just Java2007 - Daniel Wildt - Tools For Java Test AutomationJust Java2007 - Daniel Wildt - Tools For Java Test Automation
Just Java2007 - Daniel Wildt - Tools For Java Test Automation
 
Test-Driven Development (TDD)
Test-Driven Development (TDD)Test-Driven Development (TDD)
Test-Driven Development (TDD)
 
PHX Session #1: Development Best Practices And How Microsoft Helps
PHX Session #1: Development  Best  Practices And  How  Microsoft  HelpsPHX Session #1: Development  Best  Practices And  How  Microsoft  Helps
PHX Session #1: Development Best Practices And How Microsoft Helps
 
Pivotal Labs Open View Presentation Quality Assurance And Developer Testing
Pivotal Labs Open View Presentation Quality Assurance And Developer TestingPivotal Labs Open View Presentation Quality Assurance And Developer Testing
Pivotal Labs Open View Presentation Quality Assurance And Developer Testing
 
The Power of Refactoring
The Power of RefactoringThe Power of Refactoring
The Power of Refactoring
 
A tutorial on EMF-IncQuery
A tutorial on EMF-IncQueryA tutorial on EMF-IncQuery
A tutorial on EMF-IncQuery
 
Testing Sap: Modern Methodology
Testing Sap: Modern MethodologyTesting Sap: Modern Methodology
Testing Sap: Modern Methodology
 
Test automation expert days
Test automation   expert daysTest automation   expert days
Test automation expert days
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
Scripting Recipes for Testers
Scripting Recipes for TestersScripting Recipes for Testers
Scripting Recipes for Testers
 

More from Nicholas Zakas

Browser Wars Episode 1: The Phantom Menace
Browser Wars Episode 1: The Phantom MenaceBrowser Wars Episode 1: The Phantom Menace
Browser Wars Episode 1: The Phantom MenaceNicholas Zakas
 
Enough with the JavaScript already!
Enough with the JavaScript already!Enough with the JavaScript already!
Enough with the JavaScript already!Nicholas Zakas
 
JavaScript APIs you’ve never heard of (and some you have)
JavaScript APIs you’ve never heard of (and some you have)JavaScript APIs you’ve never heard of (and some you have)
JavaScript APIs you’ve never heard of (and some you have)Nicholas Zakas
 
JavaScript Timers, Power Consumption, and Performance
JavaScript Timers, Power Consumption, and PerformanceJavaScript Timers, Power Consumption, and Performance
JavaScript Timers, Power Consumption, and PerformanceNicholas Zakas
 
Scalable JavaScript Application Architecture 2012
Scalable JavaScript Application Architecture 2012Scalable JavaScript Application Architecture 2012
Scalable JavaScript Application Architecture 2012Nicholas Zakas
 
High Performance JavaScript (CapitolJS 2011)
High Performance JavaScript (CapitolJS 2011)High Performance JavaScript (CapitolJS 2011)
High Performance JavaScript (CapitolJS 2011)Nicholas Zakas
 
Maintainable JavaScript 2011
Maintainable JavaScript 2011Maintainable JavaScript 2011
Maintainable JavaScript 2011Nicholas Zakas
 
YUI Test The Next Generation (YUIConf 2010)
YUI Test The Next Generation (YUIConf 2010)YUI Test The Next Generation (YUIConf 2010)
YUI Test The Next Generation (YUIConf 2010)Nicholas Zakas
 
High Performance JavaScript (YUIConf 2010)
High Performance JavaScript (YUIConf 2010)High Performance JavaScript (YUIConf 2010)
High Performance JavaScript (YUIConf 2010)Nicholas Zakas
 
High Performance JavaScript - Fronteers 2010
High Performance JavaScript - Fronteers 2010High Performance JavaScript - Fronteers 2010
High Performance JavaScript - Fronteers 2010Nicholas Zakas
 
High Performance JavaScript - WebDirections USA 2010
High Performance JavaScript - WebDirections USA 2010High Performance JavaScript - WebDirections USA 2010
High Performance JavaScript - WebDirections USA 2010Nicholas Zakas
 
Performance on the Yahoo! Homepage
Performance on the Yahoo! HomepagePerformance on the Yahoo! Homepage
Performance on the Yahoo! HomepageNicholas Zakas
 
High Performance JavaScript - jQuery Conference SF Bay Area 2010
High Performance JavaScript - jQuery Conference SF Bay Area 2010High Performance JavaScript - jQuery Conference SF Bay Area 2010
High Performance JavaScript - jQuery Conference SF Bay Area 2010Nicholas Zakas
 
Scalable JavaScript Application Architecture
Scalable JavaScript Application ArchitectureScalable JavaScript Application Architecture
Scalable JavaScript Application ArchitectureNicholas Zakas
 
Extreme JavaScript Compression With YUI Compressor
Extreme JavaScript Compression With YUI CompressorExtreme JavaScript Compression With YUI Compressor
Extreme JavaScript Compression With YUI CompressorNicholas Zakas
 
The New Yahoo! Homepage and YUI 3
The New Yahoo! Homepage and YUI 3The New Yahoo! Homepage and YUI 3
The New Yahoo! Homepage and YUI 3Nicholas Zakas
 

More from Nicholas Zakas (17)

Browser Wars Episode 1: The Phantom Menace
Browser Wars Episode 1: The Phantom MenaceBrowser Wars Episode 1: The Phantom Menace
Browser Wars Episode 1: The Phantom Menace
 
Enough with the JavaScript already!
Enough with the JavaScript already!Enough with the JavaScript already!
Enough with the JavaScript already!
 
The Pointerless Web
The Pointerless WebThe Pointerless Web
The Pointerless Web
 
JavaScript APIs you’ve never heard of (and some you have)
JavaScript APIs you’ve never heard of (and some you have)JavaScript APIs you’ve never heard of (and some you have)
JavaScript APIs you’ve never heard of (and some you have)
 
JavaScript Timers, Power Consumption, and Performance
JavaScript Timers, Power Consumption, and PerformanceJavaScript Timers, Power Consumption, and Performance
JavaScript Timers, Power Consumption, and Performance
 
Scalable JavaScript Application Architecture 2012
Scalable JavaScript Application Architecture 2012Scalable JavaScript Application Architecture 2012
Scalable JavaScript Application Architecture 2012
 
High Performance JavaScript (CapitolJS 2011)
High Performance JavaScript (CapitolJS 2011)High Performance JavaScript (CapitolJS 2011)
High Performance JavaScript (CapitolJS 2011)
 
Maintainable JavaScript 2011
Maintainable JavaScript 2011Maintainable JavaScript 2011
Maintainable JavaScript 2011
 
YUI Test The Next Generation (YUIConf 2010)
YUI Test The Next Generation (YUIConf 2010)YUI Test The Next Generation (YUIConf 2010)
YUI Test The Next Generation (YUIConf 2010)
 
High Performance JavaScript (YUIConf 2010)
High Performance JavaScript (YUIConf 2010)High Performance JavaScript (YUIConf 2010)
High Performance JavaScript (YUIConf 2010)
 
High Performance JavaScript - Fronteers 2010
High Performance JavaScript - Fronteers 2010High Performance JavaScript - Fronteers 2010
High Performance JavaScript - Fronteers 2010
 
High Performance JavaScript - WebDirections USA 2010
High Performance JavaScript - WebDirections USA 2010High Performance JavaScript - WebDirections USA 2010
High Performance JavaScript - WebDirections USA 2010
 
Performance on the Yahoo! Homepage
Performance on the Yahoo! HomepagePerformance on the Yahoo! Homepage
Performance on the Yahoo! Homepage
 
High Performance JavaScript - jQuery Conference SF Bay Area 2010
High Performance JavaScript - jQuery Conference SF Bay Area 2010High Performance JavaScript - jQuery Conference SF Bay Area 2010
High Performance JavaScript - jQuery Conference SF Bay Area 2010
 
Scalable JavaScript Application Architecture
Scalable JavaScript Application ArchitectureScalable JavaScript Application Architecture
Scalable JavaScript Application Architecture
 
Extreme JavaScript Compression With YUI Compressor
Extreme JavaScript Compression With YUI CompressorExtreme JavaScript Compression With YUI Compressor
Extreme JavaScript Compression With YUI Compressor
 
The New Yahoo! Homepage and YUI 3
The New Yahoo! Homepage and YUI 3The New Yahoo! Homepage and YUI 3
The New Yahoo! Homepage and YUI 3
 

Recently uploaded

Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditSkynet Technologies
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 

Recently uploaded (20)

Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance Audit
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 

Test Driven Development With YUI Test (Ajax Experience 2008)

  • 1. Tes t Driven Development with YUI Tes t Nicholas C . Zakas P rincipal Front E nd E ngineer, Yahoo!
  • 2. Who's this g uy? • P rincipal Front E nd E ngineer, Yahoo! Front P age • YUI C ontributor • Author
  • 3. Tes t Driven Development Design Features Run Write Tests Tests Write Code
  • 4. Why Tes t Driven Development? • No such thing as a small change • S pecifically identifies tasks • You understand your code the best • Upfront investment pays off later • Q A resources are limited • P eace of mind
  • 5. Tes t Driven Development Design Features Run Write Tests Tests Write Code
  • 6. The R equirements • Usually, requirements are functional • Translate into interfaces (objects and methods) • D escribe what each method should do in terms of inputs and outputs Design Features
  • 7. The R equirements • Need: When a username is entered, ignore spaces at the beginning and end of text • Translation: I need a trim function • Trim function: – R emove leading white space from the given string and return result – R emove trailing white space from the given string and return result Design Features
  • 8. Tes t Driven Development Design Features Run Write Tests Tests Write Code
  • 9. Unit Tes ts • Test a small, isolated part of code (unit) – Unit = method • Test inputs and outputs – O ne set at a time • Test: “G iven this input, I expect this output.” Write Tests
  • 10. Unit Tes ting C omplaints • R amp-up time • Unfamiliar syntax/ concepts • Test harness setup is hard • Writing tests takes too long • C an't figure out what broke when a test fails Write Tests
  • 11. YUI Tes t • Unit testing framework for JavaS cript • B uilt on top of YUI • “D ogfooded” by YUI – S ee “tests” directory in download • E xtensive documentation: http:/ developer.yahoo.com/ yuitest/ / yui/ Write Tests
  • 12. YUI Tes t Cheatsheet Narrative Functional documentation examples API documentation Write Tests
  • 13. G oals of YUI Tes t • E asy to write your first test • S imple, logical syntax • Works the way JavaS cript works • G et up and running fast • Useful failure messages out of the box • Works with any code, not just YUI – P rototype, jQ uery, D ojo, etc., welcome! Write Tests
  • 14. G etting S tarted with YUI Tes t • C reate an HTM L page • Include required JavaS cript/ S S files C • Include JavaS cript to test • Write one or more tests • Include boilerplate JavaS cript • O pen page in browser Write Tests
  • 15. Writing Tes ts with YUI Tes t Write Tests
  • 16. Writing Tes ts with YUI Tes t Write Tests
  • 17. Writing Tes ts with YUI Tes t: E xample • Trim function: – R emove leading white space from the given string and return result – R emove trailing white space from the given string and return result Write Tests
  • 18. Writing Tes ts with YUI Tes t: E xample Write Tests
  • 19. Writing Tes ts with YUI Tes t: E xample Write Tests
  • 20. Failing is g ood!
  • 21. Tes t Driven Development Design Features Run Write Tests Tests Write Code
  • 22. Implementing the Feature • S tart with first failed test • Write code to make that test pass • M ove on to second failed test • Write code to make that test pass • E tc. Write Code
  • 23. Implementing the Feature: E xample Write Code
  • 24. Tes t Driven Development Design Features Run Write Tests Tests Write Code
  • 25. Tes ting the Feature: E xample Run Tests
  • 26. Tes t Driven Development Design Features Run Write Tests Fail Tests Write Code
  • 27. Implementing the Feature: E xample Write Code
  • 28. Tes t Driven Development Design Features Run Write Tests Fail Tests Write Code
  • 29. Tes ting the Feature: E xample Run Tests
  • 30. Tes t Driven Development Design Features Pass Run Write Tests Fail Tests Write Code
  • 31. Tes t Driven Development Design Features Pass Run Write Tests Fail Tests Write Code
  • 32. Tes t Driven Development Bug Reported Pass Run Write Tests Fail Tests Write Code
  • 33. S omething Went Wrong - How? • Incomplete test coverage • Incomplete feature definition • Unintended use of feature Bug Reported
  • 34. S omething Went Wrong - What? “When I entered a username that had both leading and trailing white space, the application received a string that had no leading white space but still had trailing white space.” Bug Reported
  • 35. S omething Went Wrong - What? • Trim function: – R emove leading white space from the given string and return result – R emove trailing white space from the given string and return result – If the given string has both leading and trailing white space, remove both and return result Bug Reported
  • 36. Tes t Driven Development Bug Reported Pass Run Write Tests Fail Tests Write Code
  • 37. Updating Tes ts : E xample Write Tests
  • 38. Updating Tes ts : E xample Write Tests
  • 39. Tes t Driven Development Bug Reported Pass Run Write Tests Fail Tests Write Code
  • 40. Fixing the Feature: E xample Write Code
  • 41. Tes t Driven Development Bug Reported Pass Run Write Tests Fail Tests Write Code
  • 42. Tes ting the Fix: E xample Run Tests
  • 43. Tes t Driven Development Bug Reported Pass Run Write Tests Fail Tests Write Code
  • 44. Tes t Driven Development Design Feature Pass Run Write Tests Fail Tests Write Code
  • 45. TDD C halleng es on the Web
  • 46. The B rows er E nvironment • JavaS cript tied to page using events • E xecution may be: – S ynchronous – Asynchronous • D ifferent browsers behave differently
  • 47. YUI Tes t Helps • S imple event simulation across all A- grade browsers – And some others! • Asynchronous code testing • D ifferent browsers...still behave differently – (S orry)
  • 48. E vent S imulation with YUI Tes t
  • 49. E vent S imulation with YUI Tes t
  • 50. E vent S imulation Example
  • 51. E vent S imulation Us es • Test reusable widgets (YUI does this) • Functional tests (a la S elenium) • Fun!
  • 52. As ynchronous Tes ts • Two ways to accomplish: – C all wait(func, delay) – C all wait(timeout) and then resume(func)
  • 55. As ynchronous Tes ting E xample
  • 56. WARNING! Asynchronous testing should not be used for testing Ajax responses.
  • 57. Other YUI Tes t Features
  • 58. Tes t S uites
  • 59. Tes t S uites
  • 60. Hooking into Tes tR unner • TestR unner is completely event-driven • E ach event provides the results to that point • TestLogger is just a base visualization • D esign your own visualization
  • 61. Tes tR unner E vents • pass • ignore • fail • begin • complete • testcasebegin • testcasecomplete • testsuitebegin • testsuitecomplete
  • 62. Tes tR unner E vents
  • 63. Tes t R eporting
  • 65. R amping up • For every JavaS cript file, have a corresponding test file (even if empty) – file.js and file_tests.js • S tart writing tests for bugs • Write tests from the start for new features – E ach object has a test suite – E ach method has a test case • Automate running of tests
  • 66. C oming in YUI Tes t 3.0 • M ock objects • M ore simulated events • B etter error detection • New visualizations
  • 68. Tes t Driven Development Design Feature Pass Run Write Tests Fail Tests Write Code
  • 71. E tcetera • M y blog: www.nczonline.net • M y email: nzakas@ yahoo-inc.com
  • 73. C reative C ommons Imag es Us edlords utch/74873411/ • http:/www.flickr.com/ / photos/ • http:/flickr.com/ / photos/zeer-product- reviews/ 2446364000/ • http:/flickr.com/ / photos/kristopherm/ 2230424556/ • http:/flickr.com/ / photos/adriana-lukas/846398363/ • http:/flickr.com/ / photos/quas/ 313957/ • http:/flickr.com/ / photos/ 27061495/ mc/ • http:/flickr.com/ / photos/oberazzi/ 318947873/ • http:/flickr.com/ / photos/cristic/359572656/