SlideShare a Scribd company logo
1 of 26
Effective Testing
  with Ruby



    (c)2012 YourGolf Online Inc. All Rights Reserved.
Self Introduction
✴Name: Akira Sosa
✴I m working at YourGolf Online Inc.
✴I m responsible for development
Currently
✴Providing No.1 smart phone application
 for golfers
✴The number of downloads is over
 1,000,000!!
In the future
✴We are planing to launch SNS platform
 for golfers all around the world.
We had an issue
Our environment changes more and
more quickly.

However, we have to continue
providing our value to the world.
YourGolf Development
     AGILE!!




     (c)2012 YourGolf Online Inc. All Rights Reserved.
Why Testing?
                  In Agile Development



• We are testing
    repeatedly.

•    Small team without
    specialist.




                     (c)2012 YourGolf Online Inc. All Rights Reserved.
Why Testing?
                   In Agile Development

                                                                 Analyst
• We are testing                                 Tester                  Developer
    repeatedly.

•    Small team without
    specialist.                                           Analyst
                                                      Tester Developer



                     (c)2012 YourGolf Online Inc. All Rights Reserved.
Why Ruby?
• Ruby community is high-quality and
  active community.

• So, there are a lot of useful testing
  libraries and tools.




             (c)2012 YourGolf Online Inc. All Rights Reserved.
Top Languages on github




     (c)2012 YourGolf Online Inc. All Rights Reserved.
Top Languages on github




     (c)2012 YourGolf Online Inc. All Rights Reserved.
Why Ruby?
• Ruby community is high-quality and active
  community.

• So, there are a lot of useful testing
  libraries and tools.




            (c)2012 YourGolf Online Inc. All Rights Reserved.
Libraries and Tools
• Rspec
• Timecop
• Factory Girl
• Capybara, Capybara-webkit
• VCR


         (c)2012 YourGolf Online Inc. All Rights Reserved.
Timecop
•   It provides "time travel" and "time freezing"
    capabilities, making it dead simple to test time-
    dependent code.




               (c)2012 YourGolf Online Inc. All Rights Reserved.
Timecop
•   It provides "time travel" and "time freezing"
    capabilities, making it dead simple to test time-
    dependent code.


    $ sudo date 021423002005




                (c)2012 YourGolf Online Inc. All Rights Reserved.
Timecop
•   It provides "time travel" and "time freezing"
    capabilities, making it dead simple to test time-
    dependent code.


    $ sudo date 021423002005




                                He should use Timecop!




                (c)2012 YourGolf Online Inc. All Rights Reserved.
Timecop
describe "API rate limit" do
  context "when accessed more than 100 times" do
    before do
      @rate_limit = Factory.create(:rate_limit, count: 101)
    end

    it "will be not available" do
      @rate_limit.exceeded?.should be_true
    end

    it "can be reseted after 1 hour" do
      Timecop.travel(Time.now + 1.hours + 1.minutes)
      @rate_limit.exceeded?.should be_false
    end
  end
end




                  (c)2012 YourGolf Online Inc. All Rights Reserved.
Timecop
describe "API rate limit" do
  context "when accessed more than 100 times" do
    before do
      @rate_limit = Factory.create(:rate_limit, count: 101)
    end

    it "will be not available" do
      @rate_limit.exceeded?.should be_true
    end

    it "can be reseted after 1 hour" do
      Timecop.travel(Time.now + 1.hours + 1.minutes)
      @rate_limit.exceeded?.should be_false
    end
  end
end




                  (c)2012 YourGolf Online Inc. All Rights Reserved.
Timecop
describe "API rate limit" do
  context "when accessed more than 100 times" do
    before do
      @rate_limit = Factory.create(:rate_limit, count: 101)
    end

    it "will be not available" do
      @rate_limit.exceeded?.should be_true
    end

    it "can be reseted after 1 hour" do
      Timecop.travel(Time.now + 1.hours + 1.minutes)
      @rate_limit.exceeded?.should be_false
    end
  end
end




                  (c)2012 YourGolf Online Inc. All Rights Reserved.
Timecop
describe "API rate limit" do
  context "when accessed more than 100 times" do
    before do
      @rate_limit = Factory.create(:rate_limit, count: 101)
    end

    it "will be not available" do
      @rate_limit.exceeded?.should be_true
    end

    it "can be reseted after 1 hour" do
      Timecop.travel(Time.now + 1.hours + 1.minutes)
      @rate_limit.exceeded?.should be_false
    end
  end
end




                  (c)2012 YourGolf Online Inc. All Rights Reserved.
Factory Girl
• Factory Girl is a fixtures replacement
  with a straightforward definition syntax.

                                   I m tired of fixture files.
                                       Help me, please!


                               Factory Girl can help him.




           (c)2012 YourGolf Online Inc. All Rights Reserved.
Factory Definition
FactoryGirl.define do
  factory :user do
    sequence(:email) {|n| "email#{n}@factory.com" }
    factory :admin { admin true }
  end                                   generates unique email

  factory :post do
    title "My Post"
    association :user
  end
end

Client Code
describe User do
  it "can love each other" do            no need to care for the
    jack = FactoryGirl.create(:user)          uniqueness
    rose = FactoryGirl.create(:user)
    jack.girl_friend = rose
    jack.loves?(rose).should be_true
  end
end
Factory Definition
FactoryGirl.define do
  factory :user do
    sequence(:email) {|n| "email#{n}@factory.com" }
    factory :admin { admin true }
  end

  factory :post do
    title "My Post"
                            association
    association :user
  end
end

Client Code
describe Post do            can define the association easily
  it "belongs to user" do
    post = FactoryGirl.create(:post)
    post.user.should be
  end
end
Capybara, Capybara-
            webkit
  •   It helps us creating acceptance test code.

  •   It simulates how a real user would interact with your app.

describe "the signup process", type: :request do
  before :each do
    FactoryGirl.create(email: 'user@example.com', password: 'secret')
  end

  it "signs me in" do
    within("#session") do
      fill_in 'Login', with: 'user@example.com'
      fill_in 'Password', with: 'secret'
    end
    click_link 'Sign in'
  end
end


                    (c)2012 YourGolf Online Inc. All Rights Reserved.
VCR
 • It records your test suite's HTTP
    interactions and replay them during
    future test runs for fast, deterministic,
    accurate tests.

describe "VCR example group metadata", :vcr do
  it 'records an http request' do
    make_http_request.should == 'Hello'
  end
end




                 (c)2012 YourGolf Online Inc. All Rights Reserved.
Cam on nhieu!




   (c)2012 YourGolf Online Inc. All Rights Reserved.

More Related Content

What's hot

Behaviour driven infrastructure
Behaviour driven infrastructureBehaviour driven infrastructure
Behaviour driven infrastructureLindsay Holmwood
 
Crossing the Bridge: Connecting Rails and your Front-end Framework
Crossing the Bridge: Connecting Rails and your Front-end FrameworkCrossing the Bridge: Connecting Rails and your Front-end Framework
Crossing the Bridge: Connecting Rails and your Front-end FrameworkDaniel Spector
 
API 101 - Understanding APIs.
API 101 - Understanding APIs.API 101 - Understanding APIs.
API 101 - Understanding APIs.Kirsten Hunter
 
Ruby on rails integration testing with minitest and capybara
Ruby on rails integration testing with minitest and capybaraRuby on rails integration testing with minitest and capybara
Ruby on rails integration testing with minitest and capybaraAndolasoft Inc
 
Where Node.JS Meets iOS
Where Node.JS Meets iOSWhere Node.JS Meets iOS
Where Node.JS Meets iOSSam Rijs
 
Server side rendering with React and Symfony
Server side rendering with React and SymfonyServer side rendering with React and Symfony
Server side rendering with React and SymfonyIgnacio Martín
 
Serverless in production, an experience report (FullStack 2018)
Serverless in production, an experience report (FullStack 2018)Serverless in production, an experience report (FullStack 2018)
Serverless in production, an experience report (FullStack 2018)Yan Cui
 
Hosting Your Own OTA Update Service
Hosting Your Own OTA Update ServiceHosting Your Own OTA Update Service
Hosting Your Own OTA Update ServiceQuinlan Jung
 
Introduction of AWS IoT's great points
Introduction of AWS IoT's great pointsIntroduction of AWS IoT's great points
Introduction of AWS IoT's great pointsShuheiHonma
 
Serverless in Production, an experience report (AWS UG South Wales)
Serverless in Production, an experience report (AWS UG South Wales)Serverless in Production, an experience report (AWS UG South Wales)
Serverless in Production, an experience report (AWS UG South Wales)Yan Cui
 
Into The Box | Alexa and ColdBox Api's
Into The Box | Alexa and ColdBox Api'sInto The Box | Alexa and ColdBox Api's
Into The Box | Alexa and ColdBox Api'sOrtus Solutions, Corp
 
Rethinking Angular Architecture & Performance
Rethinking Angular Architecture & PerformanceRethinking Angular Architecture & Performance
Rethinking Angular Architecture & PerformanceMark Pieszak
 
Meet the Forge Runtime
Meet the Forge RuntimeMeet the Forge Runtime
Meet the Forge RuntimeAtlassian
 
Sed & awk the dynamic duo
Sed & awk   the dynamic duoSed & awk   the dynamic duo
Sed & awk the dynamic duoJoshua Thijssen
 
Web Performance Culture and Tools at Etsy
Web Performance Culture and Tools at EtsyWeb Performance Culture and Tools at Etsy
Web Performance Culture and Tools at EtsyMike Brittain
 
Enabling Microservices @Orbitz - Velocity Conf 2015
Enabling Microservices @Orbitz - Velocity Conf 2015Enabling Microservices @Orbitz - Velocity Conf 2015
Enabling Microservices @Orbitz - Velocity Conf 2015Steve Hoffman
 
Automate across Platform, OS, Technologies with TaaS
Automate across Platform, OS, Technologies with TaaSAutomate across Platform, OS, Technologies with TaaS
Automate across Platform, OS, Technologies with TaaSAnand Bagmar
 
Automation and Developer Infrastructure — Empowering Engineers to Move from I...
Automation and Developer Infrastructure — Empowering Engineers to Move from I...Automation and Developer Infrastructure — Empowering Engineers to Move from I...
Automation and Developer Infrastructure — Empowering Engineers to Move from I...indeedeng
 
Technical Deep Dive Into Atlassian's New Apps Performance Testing Framework
Technical Deep Dive Into Atlassian's New Apps Performance Testing FrameworkTechnical Deep Dive Into Atlassian's New Apps Performance Testing Framework
Technical Deep Dive Into Atlassian's New Apps Performance Testing FrameworkAtlassian
 

What's hot (20)

Behaviour driven infrastructure
Behaviour driven infrastructureBehaviour driven infrastructure
Behaviour driven infrastructure
 
Crossing the Bridge: Connecting Rails and your Front-end Framework
Crossing the Bridge: Connecting Rails and your Front-end FrameworkCrossing the Bridge: Connecting Rails and your Front-end Framework
Crossing the Bridge: Connecting Rails and your Front-end Framework
 
API 101 - Understanding APIs.
API 101 - Understanding APIs.API 101 - Understanding APIs.
API 101 - Understanding APIs.
 
Ruby on rails integration testing with minitest and capybara
Ruby on rails integration testing with minitest and capybaraRuby on rails integration testing with minitest and capybara
Ruby on rails integration testing with minitest and capybara
 
Where Node.JS Meets iOS
Where Node.JS Meets iOSWhere Node.JS Meets iOS
Where Node.JS Meets iOS
 
Server side rendering with React and Symfony
Server side rendering with React and SymfonyServer side rendering with React and Symfony
Server side rendering with React and Symfony
 
Serverless in production, an experience report (FullStack 2018)
Serverless in production, an experience report (FullStack 2018)Serverless in production, an experience report (FullStack 2018)
Serverless in production, an experience report (FullStack 2018)
 
SFScon18 - Juri Strumpflohner - End-to-end testing done right!
SFScon18 - Juri Strumpflohner - End-to-end testing done right!SFScon18 - Juri Strumpflohner - End-to-end testing done right!
SFScon18 - Juri Strumpflohner - End-to-end testing done right!
 
Hosting Your Own OTA Update Service
Hosting Your Own OTA Update ServiceHosting Your Own OTA Update Service
Hosting Your Own OTA Update Service
 
Introduction of AWS IoT's great points
Introduction of AWS IoT's great pointsIntroduction of AWS IoT's great points
Introduction of AWS IoT's great points
 
Serverless in Production, an experience report (AWS UG South Wales)
Serverless in Production, an experience report (AWS UG South Wales)Serverless in Production, an experience report (AWS UG South Wales)
Serverless in Production, an experience report (AWS UG South Wales)
 
Into The Box | Alexa and ColdBox Api's
Into The Box | Alexa and ColdBox Api'sInto The Box | Alexa and ColdBox Api's
Into The Box | Alexa and ColdBox Api's
 
Rethinking Angular Architecture & Performance
Rethinking Angular Architecture & PerformanceRethinking Angular Architecture & Performance
Rethinking Angular Architecture & Performance
 
Meet the Forge Runtime
Meet the Forge RuntimeMeet the Forge Runtime
Meet the Forge Runtime
 
Sed & awk the dynamic duo
Sed & awk   the dynamic duoSed & awk   the dynamic duo
Sed & awk the dynamic duo
 
Web Performance Culture and Tools at Etsy
Web Performance Culture and Tools at EtsyWeb Performance Culture and Tools at Etsy
Web Performance Culture and Tools at Etsy
 
Enabling Microservices @Orbitz - Velocity Conf 2015
Enabling Microservices @Orbitz - Velocity Conf 2015Enabling Microservices @Orbitz - Velocity Conf 2015
Enabling Microservices @Orbitz - Velocity Conf 2015
 
Automate across Platform, OS, Technologies with TaaS
Automate across Platform, OS, Technologies with TaaSAutomate across Platform, OS, Technologies with TaaS
Automate across Platform, OS, Technologies with TaaS
 
Automation and Developer Infrastructure — Empowering Engineers to Move from I...
Automation and Developer Infrastructure — Empowering Engineers to Move from I...Automation and Developer Infrastructure — Empowering Engineers to Move from I...
Automation and Developer Infrastructure — Empowering Engineers to Move from I...
 
Technical Deep Dive Into Atlassian's New Apps Performance Testing Framework
Technical Deep Dive Into Atlassian's New Apps Performance Testing FrameworkTechnical Deep Dive Into Atlassian's New Apps Performance Testing Framework
Technical Deep Dive Into Atlassian's New Apps Performance Testing Framework
 

Viewers also liked

اوتار الدائره 9
اوتار الدائره 9اوتار الدائره 9
اوتار الدائره 9fatima harazneh
 
Effectively Testing Services - Burlington Ruby Conf
Effectively Testing Services - Burlington Ruby ConfEffectively Testing Services - Burlington Ruby Conf
Effectively Testing Services - Burlington Ruby Confneal_kemp
 
Mutation Testing - Ruby Edition
Mutation Testing - Ruby EditionMutation Testing - Ruby Edition
Mutation Testing - Ruby EditionChris Sinjakli
 
Automated testing - back to the roots
Automated testing - back to the rootsAutomated testing - back to the roots
Automated testing - back to the rootsMarkko Paas
 
Women Who Code - RSpec JSON API Workshop
Women Who Code - RSpec JSON API WorkshopWomen Who Code - RSpec JSON API Workshop
Women Who Code - RSpec JSON API WorkshopEddie Lau
 
I'm watir
I'm watirI'm watir
I'm watiryidiyu
 
Trading Clearing Systems Test Automation
Trading Clearing Systems Test AutomationTrading Clearing Systems Test Automation
Trading Clearing Systems Test AutomationIosif Itkin
 
Web Development with Sinatra
Web Development with SinatraWeb Development with Sinatra
Web Development with SinatraBob Nadler, Jr.
 
Mobile app testing
Mobile app testingMobile app testing
Mobile app testingsanpalan
 
Microsoft Azure Mobile Services
Microsoft Azure Mobile ServicesMicrosoft Azure Mobile Services
Microsoft Azure Mobile ServicesOlga Lavrentieva
 
Metaprogramming With Ruby
Metaprogramming With RubyMetaprogramming With Ruby
Metaprogramming With RubyFarooq Ali
 
Test automation in project management
Test automation in project managementTest automation in project management
Test automation in project managementambreprasad77
 
Action Controller Overview, Season 2
Action Controller Overview, Season 2Action Controller Overview, Season 2
Action Controller Overview, Season 2RORLAB
 
20141024 AgileDC 2014 Conf How much testing is enough for software that can c...
20141024 AgileDC 2014 Conf How much testing is enough for software that can c...20141024 AgileDC 2014 Conf How much testing is enough for software that can c...
20141024 AgileDC 2014 Conf How much testing is enough for software that can c...Craeg Strong
 
How to accurately estimate the size and effort of your software testing (1)
How to accurately estimate the size and effort of your software testing (1)How to accurately estimate the size and effort of your software testing (1)
How to accurately estimate the size and effort of your software testing (1)QASymphony
 
Automated Testing with Selenium and Bamboo - Atlassian Summit 2010 - Lightnin...
Automated Testing with Selenium and Bamboo - Atlassian Summit 2010 - Lightnin...Automated Testing with Selenium and Bamboo - Atlassian Summit 2010 - Lightnin...
Automated Testing with Selenium and Bamboo - Atlassian Summit 2010 - Lightnin...Atlassian
 
«Ruby integration testing tools»
«Ruby integration testing tools»«Ruby integration testing tools»
«Ruby integration testing tools»Olga Lavrentieva
 

Viewers also liked (19)

اوتار الدائره 9
اوتار الدائره 9اوتار الدائره 9
اوتار الدائره 9
 
Effectively Testing Services - Burlington Ruby Conf
Effectively Testing Services - Burlington Ruby ConfEffectively Testing Services - Burlington Ruby Conf
Effectively Testing Services - Burlington Ruby Conf
 
Mutation Testing - Ruby Edition
Mutation Testing - Ruby EditionMutation Testing - Ruby Edition
Mutation Testing - Ruby Edition
 
Automated testing - back to the roots
Automated testing - back to the rootsAutomated testing - back to the roots
Automated testing - back to the roots
 
Women Who Code - RSpec JSON API Workshop
Women Who Code - RSpec JSON API WorkshopWomen Who Code - RSpec JSON API Workshop
Women Who Code - RSpec JSON API Workshop
 
I'm watir
I'm watirI'm watir
I'm watir
 
Metaprogramming ruby
Metaprogramming rubyMetaprogramming ruby
Metaprogramming ruby
 
Trading Clearing Systems Test Automation
Trading Clearing Systems Test AutomationTrading Clearing Systems Test Automation
Trading Clearing Systems Test Automation
 
7 data entry
7 data entry7 data entry
7 data entry
 
Web Development with Sinatra
Web Development with SinatraWeb Development with Sinatra
Web Development with Sinatra
 
Mobile app testing
Mobile app testingMobile app testing
Mobile app testing
 
Microsoft Azure Mobile Services
Microsoft Azure Mobile ServicesMicrosoft Azure Mobile Services
Microsoft Azure Mobile Services
 
Metaprogramming With Ruby
Metaprogramming With RubyMetaprogramming With Ruby
Metaprogramming With Ruby
 
Test automation in project management
Test automation in project managementTest automation in project management
Test automation in project management
 
Action Controller Overview, Season 2
Action Controller Overview, Season 2Action Controller Overview, Season 2
Action Controller Overview, Season 2
 
20141024 AgileDC 2014 Conf How much testing is enough for software that can c...
20141024 AgileDC 2014 Conf How much testing is enough for software that can c...20141024 AgileDC 2014 Conf How much testing is enough for software that can c...
20141024 AgileDC 2014 Conf How much testing is enough for software that can c...
 
How to accurately estimate the size and effort of your software testing (1)
How to accurately estimate the size and effort of your software testing (1)How to accurately estimate the size and effort of your software testing (1)
How to accurately estimate the size and effort of your software testing (1)
 
Automated Testing with Selenium and Bamboo - Atlassian Summit 2010 - Lightnin...
Automated Testing with Selenium and Bamboo - Atlassian Summit 2010 - Lightnin...Automated Testing with Selenium and Bamboo - Atlassian Summit 2010 - Lightnin...
Automated Testing with Selenium and Bamboo - Atlassian Summit 2010 - Lightnin...
 
«Ruby integration testing tools»
«Ruby integration testing tools»«Ruby integration testing tools»
«Ruby integration testing tools»
 

Similar to Effective Testing with Ruby

Socket applications
Socket applicationsSocket applications
Socket applicationsJoão Moura
 
Fast, concurrent ruby web applications with EventMachine and EM::Synchrony
Fast, concurrent ruby web applications with EventMachine and EM::SynchronyFast, concurrent ruby web applications with EventMachine and EM::Synchrony
Fast, concurrent ruby web applications with EventMachine and EM::SynchronyKyle Drake
 
Why we are still writing?
Why we are still writing?Why we are still writing?
Why we are still writing?Alexander Osin
 
Web technologies-course 12.pptx
Web technologies-course 12.pptxWeb technologies-course 12.pptx
Web technologies-course 12.pptxStefan Oprea
 
Cucumber Presentation Kiev Meet Up
Cucumber Presentation Kiev Meet UpCucumber Presentation Kiev Meet Up
Cucumber Presentation Kiev Meet Updimakovalenko
 
Selenium and Cucumber Selenium Conf 2011
Selenium and Cucumber Selenium Conf 2011Selenium and Cucumber Selenium Conf 2011
Selenium and Cucumber Selenium Conf 2011dimakovalenko
 
Stress Test as a Culture
Stress Test as a CultureStress Test as a Culture
Stress Test as a CultureJoão Moura
 
WebPerformance: Why and How? – Stefan Wintermeyer
WebPerformance: Why and How? – Stefan WintermeyerWebPerformance: Why and How? – Stefan Wintermeyer
WebPerformance: Why and How? – Stefan WintermeyerElixir Club
 
Sync Workitems between multiple Team Projects #vssatpn
Sync Workitems between multiple Team Projects #vssatpnSync Workitems between multiple Team Projects #vssatpn
Sync Workitems between multiple Team Projects #vssatpnLorenzo Barbieri
 
Deep crawl the chaotic landscape of JavaScript
Deep crawl the chaotic landscape of JavaScript Deep crawl the chaotic landscape of JavaScript
Deep crawl the chaotic landscape of JavaScript Onely
 
Azure DevOps Realtime Work Item Sync: the good, the bad, the ugly!
Azure DevOps Realtime Work Item Sync: the good, the bad, the ugly!Azure DevOps Realtime Work Item Sync: the good, the bad, the ugly!
Azure DevOps Realtime Work Item Sync: the good, the bad, the ugly!Lorenzo Barbieri
 
Intro To Django
Intro To DjangoIntro To Django
Intro To DjangoUdi Bauman
 
Rails Presentation (Anton Dmitriyev)
Rails Presentation (Anton Dmitriyev)Rails Presentation (Anton Dmitriyev)
Rails Presentation (Anton Dmitriyev)True-Vision
 
Getting Started with Test Automation: Introduction to Cucumber with Lapis Lazuli
Getting Started with Test Automation: Introduction to Cucumber with Lapis LazuliGetting Started with Test Automation: Introduction to Cucumber with Lapis Lazuli
Getting Started with Test Automation: Introduction to Cucumber with Lapis LazuliRebecca Eloise Hogg
 
System insight without Interference
System insight without InterferenceSystem insight without Interference
System insight without InterferenceTony Tam
 
Sustainable Agile Development
Sustainable Agile DevelopmentSustainable Agile Development
Sustainable Agile DevelopmentGabriele Lana
 
Azure and web sites hackaton deck
Azure and web sites hackaton deckAzure and web sites hackaton deck
Azure and web sites hackaton deckAlexey Bokov
 

Similar to Effective Testing with Ruby (20)

Socket applications
Socket applicationsSocket applications
Socket applications
 
Fast, concurrent ruby web applications with EventMachine and EM::Synchrony
Fast, concurrent ruby web applications with EventMachine and EM::SynchronyFast, concurrent ruby web applications with EventMachine and EM::Synchrony
Fast, concurrent ruby web applications with EventMachine and EM::Synchrony
 
Titanium Alloy Tutorial
Titanium Alloy TutorialTitanium Alloy Tutorial
Titanium Alloy Tutorial
 
Why we are still writing?
Why we are still writing?Why we are still writing?
Why we are still writing?
 
Web technologies-course 12.pptx
Web technologies-course 12.pptxWeb technologies-course 12.pptx
Web technologies-course 12.pptx
 
Cucumber Presentation Kiev Meet Up
Cucumber Presentation Kiev Meet UpCucumber Presentation Kiev Meet Up
Cucumber Presentation Kiev Meet Up
 
Selenium and Cucumber Selenium Conf 2011
Selenium and Cucumber Selenium Conf 2011Selenium and Cucumber Selenium Conf 2011
Selenium and Cucumber Selenium Conf 2011
 
About Clack
About ClackAbout Clack
About Clack
 
Stress Test as a Culture
Stress Test as a CultureStress Test as a Culture
Stress Test as a Culture
 
WebPerformance: Why and How? – Stefan Wintermeyer
WebPerformance: Why and How? – Stefan WintermeyerWebPerformance: Why and How? – Stefan Wintermeyer
WebPerformance: Why and How? – Stefan Wintermeyer
 
Sync Workitems between multiple Team Projects #vssatpn
Sync Workitems between multiple Team Projects #vssatpnSync Workitems between multiple Team Projects #vssatpn
Sync Workitems between multiple Team Projects #vssatpn
 
Deep crawl the chaotic landscape of JavaScript
Deep crawl the chaotic landscape of JavaScript Deep crawl the chaotic landscape of JavaScript
Deep crawl the chaotic landscape of JavaScript
 
Azure DevOps Realtime Work Item Sync: the good, the bad, the ugly!
Azure DevOps Realtime Work Item Sync: the good, the bad, the ugly!Azure DevOps Realtime Work Item Sync: the good, the bad, the ugly!
Azure DevOps Realtime Work Item Sync: the good, the bad, the ugly!
 
Intro To Django
Intro To DjangoIntro To Django
Intro To Django
 
API Design Workflows
API Design WorkflowsAPI Design Workflows
API Design Workflows
 
Rails Presentation (Anton Dmitriyev)
Rails Presentation (Anton Dmitriyev)Rails Presentation (Anton Dmitriyev)
Rails Presentation (Anton Dmitriyev)
 
Getting Started with Test Automation: Introduction to Cucumber with Lapis Lazuli
Getting Started with Test Automation: Introduction to Cucumber with Lapis LazuliGetting Started with Test Automation: Introduction to Cucumber with Lapis Lazuli
Getting Started with Test Automation: Introduction to Cucumber with Lapis Lazuli
 
System insight without Interference
System insight without InterferenceSystem insight without Interference
System insight without Interference
 
Sustainable Agile Development
Sustainable Agile DevelopmentSustainable Agile Development
Sustainable Agile Development
 
Azure and web sites hackaton deck
Azure and web sites hackaton deckAzure and web sites hackaton deck
Azure and web sites hackaton deck
 

Recently uploaded

Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
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 WorkerThousandEyes
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 

Recently uploaded (20)

Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
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
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 

Effective Testing with Ruby

  • 1. Effective Testing with Ruby (c)2012 YourGolf Online Inc. All Rights Reserved.
  • 2. Self Introduction ✴Name: Akira Sosa ✴I m working at YourGolf Online Inc. ✴I m responsible for development
  • 3. Currently ✴Providing No.1 smart phone application for golfers ✴The number of downloads is over 1,000,000!!
  • 4. In the future ✴We are planing to launch SNS platform for golfers all around the world.
  • 5. We had an issue Our environment changes more and more quickly. However, we have to continue providing our value to the world.
  • 6. YourGolf Development AGILE!! (c)2012 YourGolf Online Inc. All Rights Reserved.
  • 7. Why Testing? In Agile Development • We are testing repeatedly. • Small team without specialist. (c)2012 YourGolf Online Inc. All Rights Reserved.
  • 8. Why Testing? In Agile Development Analyst • We are testing Tester Developer repeatedly. • Small team without specialist. Analyst Tester Developer (c)2012 YourGolf Online Inc. All Rights Reserved.
  • 9. Why Ruby? • Ruby community is high-quality and active community. • So, there are a lot of useful testing libraries and tools. (c)2012 YourGolf Online Inc. All Rights Reserved.
  • 10. Top Languages on github (c)2012 YourGolf Online Inc. All Rights Reserved.
  • 11. Top Languages on github (c)2012 YourGolf Online Inc. All Rights Reserved.
  • 12. Why Ruby? • Ruby community is high-quality and active community. • So, there are a lot of useful testing libraries and tools. (c)2012 YourGolf Online Inc. All Rights Reserved.
  • 13. Libraries and Tools • Rspec • Timecop • Factory Girl • Capybara, Capybara-webkit • VCR (c)2012 YourGolf Online Inc. All Rights Reserved.
  • 14. Timecop • It provides "time travel" and "time freezing" capabilities, making it dead simple to test time- dependent code. (c)2012 YourGolf Online Inc. All Rights Reserved.
  • 15. Timecop • It provides "time travel" and "time freezing" capabilities, making it dead simple to test time- dependent code. $ sudo date 021423002005 (c)2012 YourGolf Online Inc. All Rights Reserved.
  • 16. Timecop • It provides "time travel" and "time freezing" capabilities, making it dead simple to test time- dependent code. $ sudo date 021423002005 He should use Timecop! (c)2012 YourGolf Online Inc. All Rights Reserved.
  • 17. Timecop describe "API rate limit" do context "when accessed more than 100 times" do before do @rate_limit = Factory.create(:rate_limit, count: 101) end it "will be not available" do @rate_limit.exceeded?.should be_true end it "can be reseted after 1 hour" do Timecop.travel(Time.now + 1.hours + 1.minutes) @rate_limit.exceeded?.should be_false end end end (c)2012 YourGolf Online Inc. All Rights Reserved.
  • 18. Timecop describe "API rate limit" do context "when accessed more than 100 times" do before do @rate_limit = Factory.create(:rate_limit, count: 101) end it "will be not available" do @rate_limit.exceeded?.should be_true end it "can be reseted after 1 hour" do Timecop.travel(Time.now + 1.hours + 1.minutes) @rate_limit.exceeded?.should be_false end end end (c)2012 YourGolf Online Inc. All Rights Reserved.
  • 19. Timecop describe "API rate limit" do context "when accessed more than 100 times" do before do @rate_limit = Factory.create(:rate_limit, count: 101) end it "will be not available" do @rate_limit.exceeded?.should be_true end it "can be reseted after 1 hour" do Timecop.travel(Time.now + 1.hours + 1.minutes) @rate_limit.exceeded?.should be_false end end end (c)2012 YourGolf Online Inc. All Rights Reserved.
  • 20. Timecop describe "API rate limit" do context "when accessed more than 100 times" do before do @rate_limit = Factory.create(:rate_limit, count: 101) end it "will be not available" do @rate_limit.exceeded?.should be_true end it "can be reseted after 1 hour" do Timecop.travel(Time.now + 1.hours + 1.minutes) @rate_limit.exceeded?.should be_false end end end (c)2012 YourGolf Online Inc. All Rights Reserved.
  • 21. Factory Girl • Factory Girl is a fixtures replacement with a straightforward definition syntax. I m tired of fixture files. Help me, please! Factory Girl can help him. (c)2012 YourGolf Online Inc. All Rights Reserved.
  • 22. Factory Definition FactoryGirl.define do factory :user do sequence(:email) {|n| "email#{n}@factory.com" } factory :admin { admin true } end generates unique email factory :post do title "My Post" association :user end end Client Code describe User do it "can love each other" do no need to care for the jack = FactoryGirl.create(:user) uniqueness rose = FactoryGirl.create(:user) jack.girl_friend = rose jack.loves?(rose).should be_true end end
  • 23. Factory Definition FactoryGirl.define do factory :user do sequence(:email) {|n| "email#{n}@factory.com" } factory :admin { admin true } end factory :post do title "My Post" association association :user end end Client Code describe Post do can define the association easily it "belongs to user" do post = FactoryGirl.create(:post) post.user.should be end end
  • 24. Capybara, Capybara- webkit • It helps us creating acceptance test code. • It simulates how a real user would interact with your app. describe "the signup process", type: :request do before :each do FactoryGirl.create(email: 'user@example.com', password: 'secret') end it "signs me in" do within("#session") do fill_in 'Login', with: 'user@example.com' fill_in 'Password', with: 'secret' end click_link 'Sign in' end end (c)2012 YourGolf Online Inc. All Rights Reserved.
  • 25. VCR • It records your test suite's HTTP interactions and replay them during future test runs for fast, deterministic, accurate tests. describe "VCR example group metadata", :vcr do it 'records an http request' do make_http_request.should == 'Hello' end end (c)2012 YourGolf Online Inc. All Rights Reserved.
  • 26. Cam on nhieu! (c)2012 YourGolf Online Inc. All Rights Reserved.

Editor's Notes

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n