SlideShare a Scribd company logo
BDD for Rails Legacy
      Code
About Me

   Lu Wei Jen
       Rails Developer
   http://blog.weijen.net
   http://www.facebook.com/
    weijenlu
   Twitter: weijenlu

10
BDD for Rails Legacy Code
BDD for Rails Legacy Code
10
Legacy Code
Agenda
•
•      BDD

• BDD
• Legacy Code
• Legacy Code
•
•
•
•
Changes Changes Changes

Changes

          Changes

                          Changes
BDD for Rails Legacy Code
BDD for Rails Legacy Code
BDD

• Behavior Driven Development
•
•
BDD Tools for Rails

• Cucumber
• Webrat
• RSpec
Cucumber

•
•
•
Cucumber
Cucumber
Cucumber

    Mock Object
Webrat
•
•
    •
    •   form

    •
Webrat:


• visit "http://rubyconf.tw"
• click_link "        "
Webrat:                Form

• file_in " ", :with => "weijen"
• check "      "

• select "     ", :from => "   "

• click_button
Webrat:

•   response.should contain("            ")



•   response.should have_selector("img.photo")
RSpec
•
•
•
•
•
•
    •


•
• Waybill model         #set_customer

• Waybills_controller     #create
Model
Model
BDD for Rails Legacy Code
Mock Object

•
•
•
•
Mock Object

• my_mock = mock(name)
• my_mock = mock(name, stubs)
• my_mock = mock_model(name, stubs)
•   my_mock.stub!(:msg).with(args).and_return(value)
Message Expectation


•   my_mock.should_receive(:msg).with(args).and_r
    eturn(value)
Mock
BDD for Rails Legacy Code
BDD for Rails Legacy Code
Controller
Controller
Cucumber
•
BDD for Rails Legacy Code
BDD for Rails Legacy Code
BDD for Rails Legacy Code
BDD for Rails Legacy Code
BDD for Rails Legacy Code
BDD for Rails Legacy Code
BDD for Rails Legacy Code
•   +
BDD for Rails Legacy Code
BDD for Rails Legacy Code
BDD for Rails Legacy Code
BDD for Rails Legacy Code
BDD for Rails Legacy Code
• No Silver Bullet
•
•
Q &A

More Related Content

PPTX
Angular js training in pune course content By Advanto Software
PDF
The way to be a developer "What I Need"
PDF
2017年のteratailでやらかした話をしたい 20171213 _#9 _teratail_meetup
KEY
Prototypejs
PDF
Bindings dojo
KEY
Impression of Rails 3
PDF
Mobile applications in a new way with React Native
KEY
Db tips & tricks django meetup
Angular js training in pune course content By Advanto Software
The way to be a developer "What I Need"
2017年のteratailでやらかした話をしたい 20171213 _#9 _teratail_meetup
Prototypejs
Bindings dojo
Impression of Rails 3
Mobile applications in a new way with React Native
Db tips & tricks django meetup

Viewers also liked (20)

PDF
Jvm-bdd-quality-driven
PDF
20141024 AgileDC 2014 Conf How much testing is enough for software that can c...
PPTX
DOES14 - Jonny Wooldridge - The Cambridge Satchel Company - 10 Enterprise Tip...
PPT
Introducing bdd elements to unit testing.pptx
PPTX
Agile Tour Pune 2015:Test automation using BDD - Anita Pol and Sachin Salvekar
PDF
Bdd for legacy system
PDF
ATAAS 2016 - Amol pradhan - Bridging the gap between business and technology ...
PDF
Impact Map Your Project
PDF
Object-Oriented BDD w/ Cucumber by Matt van Horn
PDF
10 things about BDD, Cucumber and SpecFlow - Long Version 2016
ODP
Mock Aren't Stub 讀後心得
PDF
BDD com Cucumber
PDF
BDD and Test Automation in Evalutionary Product Suite
PDF
Impact Maps/Story Maps - liefern was wirklich zählt
PDF
Upcoming events 2017
PDF
Scaffolding a legacy app with BDD scenarios using SpecFlow/Cucumber (BDD Lond...
PDF
Moving away from legacy code (AgileCymru)
PDF
Help! My Legacy Application is Unmaintainable!
PDF
Impact Mapping with Innovation Games (R)
PDF
Cross mobile testautomation mit Xamarin & SpecFlow
Jvm-bdd-quality-driven
20141024 AgileDC 2014 Conf How much testing is enough for software that can c...
DOES14 - Jonny Wooldridge - The Cambridge Satchel Company - 10 Enterprise Tip...
Introducing bdd elements to unit testing.pptx
Agile Tour Pune 2015:Test automation using BDD - Anita Pol and Sachin Salvekar
Bdd for legacy system
ATAAS 2016 - Amol pradhan - Bridging the gap between business and technology ...
Impact Map Your Project
Object-Oriented BDD w/ Cucumber by Matt van Horn
10 things about BDD, Cucumber and SpecFlow - Long Version 2016
Mock Aren't Stub 讀後心得
BDD com Cucumber
BDD and Test Automation in Evalutionary Product Suite
Impact Maps/Story Maps - liefern was wirklich zählt
Upcoming events 2017
Scaffolding a legacy app with BDD scenarios using SpecFlow/Cucumber (BDD Lond...
Moving away from legacy code (AgileCymru)
Help! My Legacy Application is Unmaintainable!
Impact Mapping with Innovation Games (R)
Cross mobile testautomation mit Xamarin & SpecFlow
Ad

Similar to BDD for Rails Legacy Code (20)

PPTX
Bayt training
PDF
플렉스팀 프론트엔드 기술 스택의 이해: `lint`, `build`, `run`
PPTX
Single Page Application Development with backbone.js and Simple.Web
KEY
Rapid development with Rails
PDF
下吧开发总结
PDF
新版阿尔法城背后的前端MVC实践
PDF
【前端Mvc】mvc behind-alphatown
KEY
大規模環境でRailsと4年間付き合ってきて@ クックパッド * 食べログ合同勉強会
PPTX
Flutter 4
PDF
Forge - DevCon 2016: Free your BIM data
PDF
Introduction to Browser DOM
PDF
Padrino - the Godfather of Sinatra
PPT
The things we found in your website
PDF
RSpec on Rails Tutorial
PDF
Getting the most out of Radiant
PDF
9 Months Web Development Diploma Course in North Delhi
PDF
Intro to CSS3
PDF
從零開始的爬蟲之旅 Crawler from zero
PDF
貢獻開源專案 (Contribute to open source project)
PDF
Angular SEO
Bayt training
플렉스팀 프론트엔드 기술 스택의 이해: `lint`, `build`, `run`
Single Page Application Development with backbone.js and Simple.Web
Rapid development with Rails
下吧开发总结
新版阿尔法城背后的前端MVC实践
【前端Mvc】mvc behind-alphatown
大規模環境でRailsと4年間付き合ってきて@ クックパッド * 食べログ合同勉強会
Flutter 4
Forge - DevCon 2016: Free your BIM data
Introduction to Browser DOM
Padrino - the Godfather of Sinatra
The things we found in your website
RSpec on Rails Tutorial
Getting the most out of Radiant
9 Months Web Development Diploma Course in North Delhi
Intro to CSS3
從零開始的爬蟲之旅 Crawler from zero
貢獻開源專案 (Contribute to open source project)
Angular SEO
Ad

Recently uploaded (20)

PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
cuic standard and advanced reporting.pdf
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
Cloud computing and distributed systems.
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PPTX
Big Data Technologies - Introduction.pptx
PPT
Teaching material agriculture food technology
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Encapsulation_ Review paper, used for researhc scholars
NewMind AI Monthly Chronicles - July 2025
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Per capita expenditure prediction using model stacking based on satellite ima...
cuic standard and advanced reporting.pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
Advanced methodologies resolving dimensionality complications for autism neur...
Dropbox Q2 2025 Financial Results & Investor Presentation
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Cloud computing and distributed systems.
Spectral efficient network and resource selection model in 5G networks
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Big Data Technologies - Introduction.pptx
Teaching material agriculture food technology
20250228 LYD VKU AI Blended-Learning.pptx
Diabetes mellitus diagnosis method based random forest with bat algorithm
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication

BDD for Rails Legacy Code