SlideShare a Scribd company logo
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.
Ad

More Related Content

What's hot (19)

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
Daniel 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 capybara
Andolasoft Inc
 
Where Node.JS Meets iOS
Where Node.JS Meets iOSWhere Node.JS Meets iOS
Where Node.JS Meets iOS
Sam 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 Symfony
Ignacio 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
 
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!
South Tyrol Free Software Conference
 
Hosting Your Own OTA Update Service
Hosting Your Own OTA Update ServiceHosting Your Own OTA Update Service
Hosting Your Own OTA Update Service
Quinlan 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 points
ShuheiHonma
 
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's
Ortus Solutions, Corp
 
Rethinking Angular Architecture & Performance
Rethinking Angular Architecture & PerformanceRethinking Angular Architecture & Performance
Rethinking Angular Architecture & Performance
Mark Pieszak
 
Meet the Forge Runtime
Meet the Forge RuntimeMeet the Forge Runtime
Meet the Forge Runtime
Atlassian
 
Sed & awk the dynamic duo
Sed & awk   the dynamic duoSed & awk   the dynamic duo
Sed & awk the dynamic duo
Joshua 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 Etsy
Mike Brittain
 
Enabling Microservices @Orbitz - Velocity Conf 2015
Enabling Microservices @Orbitz - Velocity Conf 2015Enabling Microservices @Orbitz - Velocity Conf 2015
Enabling Microservices @Orbitz - Velocity Conf 2015
Steve 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 TaaS
Anand 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 Framework
Atlassian
 
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
Daniel 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 capybara
Andolasoft Inc
 
Where Node.JS Meets iOS
Where Node.JS Meets iOSWhere Node.JS Meets iOS
Where Node.JS Meets iOS
Sam 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 Symfony
Ignacio 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 Service
Quinlan 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 points
ShuheiHonma
 
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's
Ortus Solutions, Corp
 
Rethinking Angular Architecture & Performance
Rethinking Angular Architecture & PerformanceRethinking Angular Architecture & Performance
Rethinking Angular Architecture & Performance
Mark Pieszak
 
Meet the Forge Runtime
Meet the Forge RuntimeMeet the Forge Runtime
Meet the Forge Runtime
Atlassian
 
Sed & awk the dynamic duo
Sed & awk   the dynamic duoSed & awk   the dynamic duo
Sed & awk the dynamic duo
Joshua 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 Etsy
Mike Brittain
 
Enabling Microservices @Orbitz - Velocity Conf 2015
Enabling Microservices @Orbitz - Velocity Conf 2015Enabling Microservices @Orbitz - Velocity Conf 2015
Enabling Microservices @Orbitz - Velocity Conf 2015
Steve 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 TaaS
Anand 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 Framework
Atlassian
 

Viewers also liked (19)

اوتار الدائره 9
اوتار الدائره 9اوتار الدائره 9
اوتار الدائره 9
fatima harazneh
 
Effectively Testing Services - Burlington Ruby Conf
Effectively Testing Services - Burlington Ruby ConfEffectively Testing Services - Burlington Ruby Conf
Effectively Testing Services - Burlington Ruby Conf
neal_kemp
 
Mutation Testing - Ruby Edition
Mutation Testing - Ruby EditionMutation Testing - Ruby Edition
Mutation Testing - Ruby Edition
Chris Sinjakli
 
Automated testing - back to the roots
Automated testing - back to the rootsAutomated testing - back to the roots
Automated testing - back to the roots
Markko 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 Workshop
Eddie Lau
 
I'm watir
I'm watirI'm watir
I'm watir
yidiyu
 
Metaprogramming ruby
Metaprogramming rubyMetaprogramming ruby
Metaprogramming ruby
Jiang Yan-Ting
 
Trading Clearing Systems Test Automation
Trading Clearing Systems Test AutomationTrading Clearing Systems Test Automation
Trading Clearing Systems Test Automation
Iosif Itkin
 
7 data entry
7 data entry7 data entry
7 data entry
Michael Dain
 
Web Development with Sinatra
Web Development with SinatraWeb Development with Sinatra
Web Development with Sinatra
Bob Nadler, Jr.
 
Mobile app testing
Mobile app testingMobile app testing
Mobile app testing
sanpalan
 
Microsoft Azure Mobile Services
Microsoft Azure Mobile ServicesMicrosoft Azure Mobile Services
Microsoft Azure Mobile Services
Olga Lavrentieva
 
Metaprogramming With Ruby
Metaprogramming With RubyMetaprogramming With Ruby
Metaprogramming With Ruby
Farooq Ali
 
Test automation in project management
Test automation in project managementTest automation in project management
Test automation in project management
ambreprasad77
 
Action Controller Overview, Season 2
Action Controller Overview, Season 2Action Controller Overview, Season 2
Action Controller Overview, Season 2
RORLAB
 
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
 
اوتار الدائره 9
اوتار الدائره 9اوتار الدائره 9
اوتار الدائره 9
fatima harazneh
 
Effectively Testing Services - Burlington Ruby Conf
Effectively Testing Services - Burlington Ruby ConfEffectively Testing Services - Burlington Ruby Conf
Effectively Testing Services - Burlington Ruby Conf
neal_kemp
 
Mutation Testing - Ruby Edition
Mutation Testing - Ruby EditionMutation Testing - Ruby Edition
Mutation Testing - Ruby Edition
Chris Sinjakli
 
Automated testing - back to the roots
Automated testing - back to the rootsAutomated testing - back to the roots
Automated testing - back to the roots
Markko 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 Workshop
Eddie Lau
 
I'm watir
I'm watirI'm watir
I'm watir
yidiyu
 
Trading Clearing Systems Test Automation
Trading Clearing Systems Test AutomationTrading Clearing Systems Test Automation
Trading Clearing Systems Test Automation
Iosif Itkin
 
Web Development with Sinatra
Web Development with SinatraWeb Development with Sinatra
Web Development with Sinatra
Bob Nadler, Jr.
 
Mobile app testing
Mobile app testingMobile app testing
Mobile app testing
sanpalan
 
Microsoft Azure Mobile Services
Microsoft Azure Mobile ServicesMicrosoft Azure Mobile Services
Microsoft Azure Mobile Services
Olga Lavrentieva
 
Metaprogramming With Ruby
Metaprogramming With RubyMetaprogramming With Ruby
Metaprogramming With Ruby
Farooq Ali
 
Test automation in project management
Test automation in project managementTest automation in project management
Test automation in project management
ambreprasad77
 
Action Controller Overview, Season 2
Action Controller Overview, Season 2Action Controller Overview, Season 2
Action Controller Overview, Season 2
RORLAB
 
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
 
Ad

Similar to Effective Testing with Ruby (20)

Socket applications
Socket applicationsSocket applications
Socket applications
Joã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::Synchrony
Kyle Drake
 
Titanium Alloy Tutorial
Titanium Alloy TutorialTitanium Alloy Tutorial
Titanium Alloy Tutorial
Fokke Zandbergen
 
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.pptx
Stefan Oprea
 
Cucumber Presentation Kiev Meet Up
Cucumber Presentation Kiev Meet UpCucumber Presentation Kiev Meet Up
Cucumber Presentation Kiev Meet Up
dimakovalenko
 
Selenium and Cucumber Selenium Conf 2011
Selenium and Cucumber Selenium Conf 2011Selenium and Cucumber Selenium Conf 2011
Selenium and Cucumber Selenium Conf 2011
dimakovalenko
 
About Clack
About ClackAbout Clack
About Clack
fukamachi
 
[GEMINI EXTERNAL DECK] Introduction to Gemini.pptx
[GEMINI EXTERNAL DECK] Introduction to Gemini.pptx[GEMINI EXTERNAL DECK] Introduction to Gemini.pptx
[GEMINI EXTERNAL DECK] Introduction to Gemini.pptx
AhmedElbaloug
 
Stress Test as a Culture
Stress Test as a CultureStress Test as a Culture
Stress Test as a Culture
João Moura
 
WebPerformance: Why and How? – Stefan Wintermeyer
WebPerformance: Why and How? – Stefan WintermeyerWebPerformance: Why and How? – Stefan Wintermeyer
WebPerformance: Why and How? – Stefan Wintermeyer
Elixir 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 #vssatpn
Lorenzo 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 Django
Udi Bauman
 
API Design Workflows
API Design WorkflowsAPI Design Workflows
API Design Workflows
Jakub Nesetril
 
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 Lazuli
Rebecca Eloise Hogg
 
System insight without Interference
System insight without InterferenceSystem insight without Interference
System insight without Interference
Tony Tam
 
Sustainable Agile Development
Sustainable Agile DevelopmentSustainable Agile Development
Sustainable Agile Development
Gabriele Lana
 
Socket applications
Socket applicationsSocket applications
Socket applications
Joã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::Synchrony
Kyle 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.pptx
Stefan Oprea
 
Cucumber Presentation Kiev Meet Up
Cucumber Presentation Kiev Meet UpCucumber Presentation Kiev Meet Up
Cucumber Presentation Kiev Meet Up
dimakovalenko
 
Selenium and Cucumber Selenium Conf 2011
Selenium and Cucumber Selenium Conf 2011Selenium and Cucumber Selenium Conf 2011
Selenium and Cucumber Selenium Conf 2011
dimakovalenko
 
[GEMINI EXTERNAL DECK] Introduction to Gemini.pptx
[GEMINI EXTERNAL DECK] Introduction to Gemini.pptx[GEMINI EXTERNAL DECK] Introduction to Gemini.pptx
[GEMINI EXTERNAL DECK] Introduction to Gemini.pptx
AhmedElbaloug
 
Stress Test as a Culture
Stress Test as a CultureStress Test as a Culture
Stress Test as a Culture
João Moura
 
WebPerformance: Why and How? – Stefan Wintermeyer
WebPerformance: Why and How? – Stefan WintermeyerWebPerformance: Why and How? – Stefan Wintermeyer
WebPerformance: Why and How? – Stefan Wintermeyer
Elixir 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 #vssatpn
Lorenzo 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 Django
Udi 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 Lazuli
Rebecca Eloise Hogg
 
System insight without Interference
System insight without InterferenceSystem insight without Interference
System insight without Interference
Tony Tam
 
Sustainable Agile Development
Sustainable Agile DevelopmentSustainable Agile Development
Sustainable Agile Development
Gabriele Lana
 
Ad

Recently uploaded (20)

Everything You Need to Know About Agentforce? (Put AI Agents to Work)
Everything You Need to Know About Agentforce? (Put AI Agents to Work)Everything You Need to Know About Agentforce? (Put AI Agents to Work)
Everything You Need to Know About Agentforce? (Put AI Agents to Work)
Cyntexa
 
RTP Over QUIC: An Interesting Opportunity Or Wasted Time?
RTP Over QUIC: An Interesting Opportunity Or Wasted Time?RTP Over QUIC: An Interesting Opportunity Or Wasted Time?
RTP Over QUIC: An Interesting Opportunity Or Wasted Time?
Lorenzo Miniero
 
AI Agents at Work: UiPath, Maestro & the Future of Documents
AI Agents at Work: UiPath, Maestro & the Future of DocumentsAI Agents at Work: UiPath, Maestro & the Future of Documents
AI Agents at Work: UiPath, Maestro & the Future of Documents
UiPathCommunity
 
Smart Investments Leveraging Agentic AI for Real Estate Success.pptx
Smart Investments Leveraging Agentic AI for Real Estate Success.pptxSmart Investments Leveraging Agentic AI for Real Estate Success.pptx
Smart Investments Leveraging Agentic AI for Real Estate Success.pptx
Seasia Infotech
 
Mastering Testing in the Modern F&B Landscape
Mastering Testing in the Modern F&B LandscapeMastering Testing in the Modern F&B Landscape
Mastering Testing in the Modern F&B Landscape
marketing943205
 
Cybersecurity Threat Vectors and Mitigation
Cybersecurity Threat Vectors and MitigationCybersecurity Threat Vectors and Mitigation
Cybersecurity Threat Vectors and Mitigation
VICTOR MAESTRE RAMIREZ
 
Config 2025 presentation recap covering both days
Config 2025 presentation recap covering both daysConfig 2025 presentation recap covering both days
Config 2025 presentation recap covering both days
TrishAntoni1
 
fennec fox optimization algorithm for optimal solution
fennec fox optimization algorithm for optimal solutionfennec fox optimization algorithm for optimal solution
fennec fox optimization algorithm for optimal solution
shallal2
 
Q1 2025 Dropbox Earnings and Investor Presentation
Q1 2025 Dropbox Earnings and Investor PresentationQ1 2025 Dropbox Earnings and Investor Presentation
Q1 2025 Dropbox Earnings and Investor Presentation
Dropbox
 
Unlocking Generative AI in your Web Apps
Unlocking Generative AI in your Web AppsUnlocking Generative AI in your Web Apps
Unlocking Generative AI in your Web Apps
Maximiliano Firtman
 
Artificial_Intelligence_in_Everyday_Life.pptx
Artificial_Intelligence_in_Everyday_Life.pptxArtificial_Intelligence_in_Everyday_Life.pptx
Artificial_Intelligence_in_Everyday_Life.pptx
03ANMOLCHAURASIYA
 
AsyncAPI v3 : Streamlining Event-Driven API Design
AsyncAPI v3 : Streamlining Event-Driven API DesignAsyncAPI v3 : Streamlining Event-Driven API Design
AsyncAPI v3 : Streamlining Event-Driven API Design
leonid54
 
Com fer un pla de gestió de dades amb l'eiNa DMP (en anglès)
Com fer un pla de gestió de dades amb l'eiNa DMP (en anglès)Com fer un pla de gestió de dades amb l'eiNa DMP (en anglès)
Com fer un pla de gestió de dades amb l'eiNa DMP (en anglès)
CSUC - Consorci de Serveis Universitaris de Catalunya
 
Slack like a pro: strategies for 10x engineering teams
Slack like a pro: strategies for 10x engineering teamsSlack like a pro: strategies for 10x engineering teams
Slack like a pro: strategies for 10x engineering teams
Nacho Cougil
 
Top 5 Benefits of Using Molybdenum Rods in Industrial Applications.pptx
Top 5 Benefits of Using Molybdenum Rods in Industrial Applications.pptxTop 5 Benefits of Using Molybdenum Rods in Industrial Applications.pptx
Top 5 Benefits of Using Molybdenum Rods in Industrial Applications.pptx
mkubeusa
 
DevOpsDays SLC - Platform Engineers are Product Managers.pptx
DevOpsDays SLC - Platform Engineers are Product Managers.pptxDevOpsDays SLC - Platform Engineers are Product Managers.pptx
DevOpsDays SLC - Platform Engineers are Product Managers.pptx
Justin Reock
 
AI x Accessibility UXPA by Stew Smith and Olivier Vroom
AI x Accessibility UXPA by Stew Smith and Olivier VroomAI x Accessibility UXPA by Stew Smith and Olivier Vroom
AI x Accessibility UXPA by Stew Smith and Olivier Vroom
UXPA Boston
 
IT484 Cyber Forensics_Information Technology
IT484 Cyber Forensics_Information TechnologyIT484 Cyber Forensics_Information Technology
IT484 Cyber Forensics_Information Technology
SHEHABALYAMANI
 
GDG Cloud Southlake #42: Suresh Mathew: Autonomous Resource Optimization: How...
GDG Cloud Southlake #42: Suresh Mathew: Autonomous Resource Optimization: How...GDG Cloud Southlake #42: Suresh Mathew: Autonomous Resource Optimization: How...
GDG Cloud Southlake #42: Suresh Mathew: Autonomous Resource Optimization: How...
James Anderson
 
Agentic Automation - Delhi UiPath Community Meetup
Agentic Automation - Delhi UiPath Community MeetupAgentic Automation - Delhi UiPath Community Meetup
Agentic Automation - Delhi UiPath Community Meetup
Manoj Batra (1600 + Connections)
 
Everything You Need to Know About Agentforce? (Put AI Agents to Work)
Everything You Need to Know About Agentforce? (Put AI Agents to Work)Everything You Need to Know About Agentforce? (Put AI Agents to Work)
Everything You Need to Know About Agentforce? (Put AI Agents to Work)
Cyntexa
 
RTP Over QUIC: An Interesting Opportunity Or Wasted Time?
RTP Over QUIC: An Interesting Opportunity Or Wasted Time?RTP Over QUIC: An Interesting Opportunity Or Wasted Time?
RTP Over QUIC: An Interesting Opportunity Or Wasted Time?
Lorenzo Miniero
 
AI Agents at Work: UiPath, Maestro & the Future of Documents
AI Agents at Work: UiPath, Maestro & the Future of DocumentsAI Agents at Work: UiPath, Maestro & the Future of Documents
AI Agents at Work: UiPath, Maestro & the Future of Documents
UiPathCommunity
 
Smart Investments Leveraging Agentic AI for Real Estate Success.pptx
Smart Investments Leveraging Agentic AI for Real Estate Success.pptxSmart Investments Leveraging Agentic AI for Real Estate Success.pptx
Smart Investments Leveraging Agentic AI for Real Estate Success.pptx
Seasia Infotech
 
Mastering Testing in the Modern F&B Landscape
Mastering Testing in the Modern F&B LandscapeMastering Testing in the Modern F&B Landscape
Mastering Testing in the Modern F&B Landscape
marketing943205
 
Cybersecurity Threat Vectors and Mitigation
Cybersecurity Threat Vectors and MitigationCybersecurity Threat Vectors and Mitigation
Cybersecurity Threat Vectors and Mitigation
VICTOR MAESTRE RAMIREZ
 
Config 2025 presentation recap covering both days
Config 2025 presentation recap covering both daysConfig 2025 presentation recap covering both days
Config 2025 presentation recap covering both days
TrishAntoni1
 
fennec fox optimization algorithm for optimal solution
fennec fox optimization algorithm for optimal solutionfennec fox optimization algorithm for optimal solution
fennec fox optimization algorithm for optimal solution
shallal2
 
Q1 2025 Dropbox Earnings and Investor Presentation
Q1 2025 Dropbox Earnings and Investor PresentationQ1 2025 Dropbox Earnings and Investor Presentation
Q1 2025 Dropbox Earnings and Investor Presentation
Dropbox
 
Unlocking Generative AI in your Web Apps
Unlocking Generative AI in your Web AppsUnlocking Generative AI in your Web Apps
Unlocking Generative AI in your Web Apps
Maximiliano Firtman
 
Artificial_Intelligence_in_Everyday_Life.pptx
Artificial_Intelligence_in_Everyday_Life.pptxArtificial_Intelligence_in_Everyday_Life.pptx
Artificial_Intelligence_in_Everyday_Life.pptx
03ANMOLCHAURASIYA
 
AsyncAPI v3 : Streamlining Event-Driven API Design
AsyncAPI v3 : Streamlining Event-Driven API DesignAsyncAPI v3 : Streamlining Event-Driven API Design
AsyncAPI v3 : Streamlining Event-Driven API Design
leonid54
 
Slack like a pro: strategies for 10x engineering teams
Slack like a pro: strategies for 10x engineering teamsSlack like a pro: strategies for 10x engineering teams
Slack like a pro: strategies for 10x engineering teams
Nacho Cougil
 
Top 5 Benefits of Using Molybdenum Rods in Industrial Applications.pptx
Top 5 Benefits of Using Molybdenum Rods in Industrial Applications.pptxTop 5 Benefits of Using Molybdenum Rods in Industrial Applications.pptx
Top 5 Benefits of Using Molybdenum Rods in Industrial Applications.pptx
mkubeusa
 
DevOpsDays SLC - Platform Engineers are Product Managers.pptx
DevOpsDays SLC - Platform Engineers are Product Managers.pptxDevOpsDays SLC - Platform Engineers are Product Managers.pptx
DevOpsDays SLC - Platform Engineers are Product Managers.pptx
Justin Reock
 
AI x Accessibility UXPA by Stew Smith and Olivier Vroom
AI x Accessibility UXPA by Stew Smith and Olivier VroomAI x Accessibility UXPA by Stew Smith and Olivier Vroom
AI x Accessibility UXPA by Stew Smith and Olivier Vroom
UXPA Boston
 
IT484 Cyber Forensics_Information Technology
IT484 Cyber Forensics_Information TechnologyIT484 Cyber Forensics_Information Technology
IT484 Cyber Forensics_Information Technology
SHEHABALYAMANI
 
GDG Cloud Southlake #42: Suresh Mathew: Autonomous Resource Optimization: How...
GDG Cloud Southlake #42: Suresh Mathew: Autonomous Resource Optimization: How...GDG Cloud Southlake #42: Suresh Mathew: Autonomous Resource Optimization: How...
GDG Cloud Southlake #42: Suresh Mathew: Autonomous Resource Optimization: How...
James Anderson
 

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

  翻译: