SlideShare a Scribd company logo
1 of 16
Ruby
Week 7
Mid-Term Review


• Not Done Grading
• Overall looks pretty good
• Questions??
TESTING Agenda

• Behavior Driven Development with Cucumber
• Fun with MiniTest
• TestUnit and Cucumber with Jeweler and Travis
• Why Testing? With Nell!
Behavior Driven
        Development

• User Stories
• Business Value
• Communication
• Shared Tools
Behavior Specs


• Title
• Narrative
• Acceptance Criteria / Scenarios / Outcomes
• gem install cucumber
• cucumber --help
Features

• Human Read/Writable description of behavior
• Business Users write the features, Programmers
  develop the features to spec
• https://github.com/cucumber/cucumber/wiki/
  Feature-Introduction
Given-When-Then

• Describing your feature
• Preconditions
• Something happens
• Expected outcome
Step Definitions


• REGEXP!!
• Translation between the human narrative and the
  code
• This type of sentence, matches to this type of code
Demo!

• I want a Celsius to Fahrenheit converter
• I tell my story
• I copy the generated regex
• I write my tests
• TDD!
Example!

• New Feature!
• I’m in London and I can’t share bar stories without
  being able to convert Fahrenheit to Celsius
• Write the Steps
• Make Them Pass!
MiniTest


• Built into Ruby 1.9!
• SeattleRB! (meets Tuesday nights   )
• Light, Fast, FUN!
Example

• Make a ruby file
• Add some tests
• Make them pass
• All Ruby!
Test Unit


• Jeweler!
• Simple testing framework
• Used lots of places!
Cucumber with
    Jeweler and Travis
• EXAMPLE!
• Add cucumber to Gemfile
• Run bundler
• Add feature, steps, and support (env.rb)
• Add to travis.yml file
Homework


• Read Chapter 23 and 24 DuckTyping and
  MetaProgramming
• Make the cucumber features pass

More Related Content

What's hot

eZ Publish 5: from zero to automated deployment (and no regressions!) in one ...
eZ Publish 5: from zero to automated deployment (and no regressions!) in one ...eZ Publish 5: from zero to automated deployment (and no regressions!) in one ...
eZ Publish 5: from zero to automated deployment (and no regressions!) in one ...Gaetano Giunta
 
Symfony vs. Message Brokers
Symfony  vs.  Message BrokersSymfony  vs.  Message Brokers
Symfony vs. Message BrokersGaetano Giunta
 
"GitHub com for lazy in cloud project management" by Sergejs Matancevs from S...
"GitHub com for lazy in cloud project management" by Sergejs Matancevs from S..."GitHub com for lazy in cloud project management" by Sergejs Matancevs from S...
"GitHub com for lazy in cloud project management" by Sergejs Matancevs from S...DevClub_lv
 
VersaPay's Tools for Happyfficient Developers
VersaPay's Tools for Happyfficient DevelopersVersaPay's Tools for Happyfficient Developers
VersaPay's Tools for Happyfficient DevelopersPhilippe Creux
 
Git and Code Organization for Managing Your Puppet Code - PuppetConf 2014
Git and Code Organization for Managing Your Puppet Code - PuppetConf 2014Git and Code Organization for Managing Your Puppet Code - PuppetConf 2014
Git and Code Organization for Managing Your Puppet Code - PuppetConf 2014Puppet
 
How Immutable Can You Get - Anton Weiss, OTomato - DevOpsDays Tel Aviv 2015
How Immutable Can You Get - Anton Weiss, OTomato - DevOpsDays Tel Aviv 2015How Immutable Can You Get - Anton Weiss, OTomato - DevOpsDays Tel Aviv 2015
How Immutable Can You Get - Anton Weiss, OTomato - DevOpsDays Tel Aviv 2015DevOpsDays Tel Aviv
 
WTF TDD?
WTF TDD?WTF TDD?
WTF TDD?jeremyw
 
Why use Go for web development?
Why use Go for web development?Why use Go for web development?
Why use Go for web development?Weng Wei
 
Coding for the cloud - development of modern web applications
Coding for the cloud - development of modern web applicationsCoding for the cloud - development of modern web applications
Coding for the cloud - development of modern web applicationsWekoslav Stefanovski
 
Automating JavaScript testing with Jasmine and Perl
Automating JavaScript testing with Jasmine and PerlAutomating JavaScript testing with Jasmine and Perl
Automating JavaScript testing with Jasmine and Perlnohuhu
 
Why I will never write JavaScript ever again*
Why I will never write JavaScript ever again*Why I will never write JavaScript ever again*
Why I will never write JavaScript ever again*The Wolff
 
Through Meteor to the stars - Developing full-stack SPA's with meteor.js
Through Meteor to the stars - Developing full-stack SPA's with meteor.jsThrough Meteor to the stars - Developing full-stack SPA's with meteor.js
Through Meteor to the stars - Developing full-stack SPA's with meteor.jsWekoslav Stefanovski
 
An Example-Driven API Tester
An Example-Driven API TesterAn Example-Driven API Tester
An Example-Driven API TesterLi Lin
 
Designing a Docker Stack for Symfony apps: lessons learned
Designing a Docker Stack  for Symfony apps: lessons learnedDesigning a Docker Stack  for Symfony apps: lessons learned
Designing a Docker Stack for Symfony apps: lessons learnedGaetano Giunta
 
Akka.NET: Concurrency Without the Pain (Intro to the Actor Model)
Akka.NET: Concurrency Without the Pain (Intro to the Actor Model)Akka.NET: Concurrency Without the Pain (Intro to the Actor Model)
Akka.NET: Concurrency Without the Pain (Intro to the Actor Model)petabridge
 
Ruby Midwest 2010 jRuby by Charles Nutter
Ruby Midwest 2010 jRuby by Charles NutterRuby Midwest 2010 jRuby by Charles Nutter
Ruby Midwest 2010 jRuby by Charles NutterSteven Chau
 

What's hot (20)

eZ Publish 5: from zero to automated deployment (and no regressions!) in one ...
eZ Publish 5: from zero to automated deployment (and no regressions!) in one ...eZ Publish 5: from zero to automated deployment (and no regressions!) in one ...
eZ Publish 5: from zero to automated deployment (and no regressions!) in one ...
 
Symfony vs. Message Brokers
Symfony  vs.  Message BrokersSymfony  vs.  Message Brokers
Symfony vs. Message Brokers
 
Style Is Cool
Style Is CoolStyle Is Cool
Style Is Cool
 
"GitHub com for lazy in cloud project management" by Sergejs Matancevs from S...
"GitHub com for lazy in cloud project management" by Sergejs Matancevs from S..."GitHub com for lazy in cloud project management" by Sergejs Matancevs from S...
"GitHub com for lazy in cloud project management" by Sergejs Matancevs from S...
 
Git - A soft introduction
Git - A soft introductionGit - A soft introduction
Git - A soft introduction
 
VersaPay's Tools for Happyfficient Developers
VersaPay's Tools for Happyfficient DevelopersVersaPay's Tools for Happyfficient Developers
VersaPay's Tools for Happyfficient Developers
 
Git and Code Organization for Managing Your Puppet Code - PuppetConf 2014
Git and Code Organization for Managing Your Puppet Code - PuppetConf 2014Git and Code Organization for Managing Your Puppet Code - PuppetConf 2014
Git and Code Organization for Managing Your Puppet Code - PuppetConf 2014
 
How Immutable Can You Get - Anton Weiss, OTomato - DevOpsDays Tel Aviv 2015
How Immutable Can You Get - Anton Weiss, OTomato - DevOpsDays Tel Aviv 2015How Immutable Can You Get - Anton Weiss, OTomato - DevOpsDays Tel Aviv 2015
How Immutable Can You Get - Anton Weiss, OTomato - DevOpsDays Tel Aviv 2015
 
WTF TDD?
WTF TDD?WTF TDD?
WTF TDD?
 
Why use Go for web development?
Why use Go for web development?Why use Go for web development?
Why use Go for web development?
 
Coding for the cloud - development of modern web applications
Coding for the cloud - development of modern web applicationsCoding for the cloud - development of modern web applications
Coding for the cloud - development of modern web applications
 
Automating JavaScript testing with Jasmine and Perl
Automating JavaScript testing with Jasmine and PerlAutomating JavaScript testing with Jasmine and Perl
Automating JavaScript testing with Jasmine and Perl
 
Why I will never write JavaScript ever again*
Why I will never write JavaScript ever again*Why I will never write JavaScript ever again*
Why I will never write JavaScript ever again*
 
Through Meteor to the stars - Developing full-stack SPA's with meteor.js
Through Meteor to the stars - Developing full-stack SPA's with meteor.jsThrough Meteor to the stars - Developing full-stack SPA's with meteor.js
Through Meteor to the stars - Developing full-stack SPA's with meteor.js
 
An Example-Driven API Tester
An Example-Driven API TesterAn Example-Driven API Tester
An Example-Driven API Tester
 
Designing a Docker Stack for Symfony apps: lessons learned
Designing a Docker Stack  for Symfony apps: lessons learnedDesigning a Docker Stack  for Symfony apps: lessons learned
Designing a Docker Stack for Symfony apps: lessons learned
 
Week10
Week10Week10
Week10
 
Akka.NET: Concurrency Without the Pain (Intro to the Actor Model)
Akka.NET: Concurrency Without the Pain (Intro to the Actor Model)Akka.NET: Concurrency Without the Pain (Intro to the Actor Model)
Akka.NET: Concurrency Without the Pain (Intro to the Actor Model)
 
Cucumber
CucumberCucumber
Cucumber
 
Ruby Midwest 2010 jRuby by Charles Nutter
Ruby Midwest 2010 jRuby by Charles NutterRuby Midwest 2010 jRuby by Charles Nutter
Ruby Midwest 2010 jRuby by Charles Nutter
 

Viewers also liked

Viewers also liked (6)

Week9
Week9Week9
Week9
 
Week4
Week4Week4
Week4
 
Week5
Week5Week5
Week5
 
Week6
Week6Week6
Week6
 
Week3
Week3Week3
Week3
 
Nginx caching
Nginx cachingNginx caching
Nginx caching
 

Similar to Week7

Becoming a more productive Rails Developer
Becoming a more productive Rails DeveloperBecoming a more productive Rails Developer
Becoming a more productive Rails DeveloperJohn McCaffrey
 
Introduction to Test Driven Development
Introduction to Test Driven DevelopmentIntroduction to Test Driven Development
Introduction to Test Driven DevelopmentSarah Dutkiewicz
 
Becoming a more Productive Rails Developer
Becoming a more Productive Rails DeveloperBecoming a more Productive Rails Developer
Becoming a more Productive Rails DeveloperJohn McCaffrey
 
Aki Salmi - Refactoring legacy code: a true story @ I T.A.K.E. Unconference 2...
Aki Salmi - Refactoring legacy code: a true story @ I T.A.K.E. Unconference 2...Aki Salmi - Refactoring legacy code: a true story @ I T.A.K.E. Unconference 2...
Aki Salmi - Refactoring legacy code: a true story @ I T.A.K.E. Unconference 2...Mozaic Works
 
The Five Stages of Chef Grief: My First 6 months with Chef, and Getting Aroun...
The Five Stages of Chef Grief: My First 6 months with Chef, and Getting Aroun...The Five Stages of Chef Grief: My First 6 months with Chef, and Getting Aroun...
The Five Stages of Chef Grief: My First 6 months with Chef, and Getting Aroun...DevOpsDays Austin 2014
 
Introduction to Testing and TDD
Introduction to Testing and TDDIntroduction to Testing and TDD
Introduction to Testing and TDDSarah Dutkiewicz
 
Exploring Ruby on Rails and PostgreSQL
Exploring Ruby on Rails and PostgreSQLExploring Ruby on Rails and PostgreSQL
Exploring Ruby on Rails and PostgreSQLBarry Jones
 
6 reasons Jubilee could be a Rubyist's new best friend
6 reasons Jubilee could be a Rubyist's new best friend6 reasons Jubilee could be a Rubyist's new best friend
6 reasons Jubilee could be a Rubyist's new best friendForrest Chang
 
Build software like a bag of marbles, not a castle of LEGO®
Build software like a bag of marbles, not a castle of LEGO®Build software like a bag of marbles, not a castle of LEGO®
Build software like a bag of marbles, not a castle of LEGO®Hannes Lowette
 
Automated Testing with Cucumber, PhantomJS and Selenium
Automated Testing with Cucumber, PhantomJS and SeleniumAutomated Testing with Cucumber, PhantomJS and Selenium
Automated Testing with Cucumber, PhantomJS and SeleniumDev9Com
 
Clojurescript slides
Clojurescript slidesClojurescript slides
Clojurescript slideselliando dias
 
Thucydides - a brief review
Thucydides - a brief reviewThucydides - a brief review
Thucydides - a brief reviewCristian COȚOI
 
SPSNJ 2014: EmberJS & SharePoint
SPSNJ 2014: EmberJS & SharePointSPSNJ 2014: EmberJS & SharePoint
SPSNJ 2014: EmberJS & SharePointGreg Hurlman
 
Erlang factory SF 2011 "Erlang and the big switch in social games"
Erlang factory SF 2011 "Erlang and the big switch in social games"Erlang factory SF 2011 "Erlang and the big switch in social games"
Erlang factory SF 2011 "Erlang and the big switch in social games"Paolo Negri
 
Erlang, the big switch in social games
Erlang, the big switch in social gamesErlang, the big switch in social games
Erlang, the big switch in social gamesWooga
 
Docker for everything
Docker for everythingDocker for everything
Docker for everythingTim Haak
 

Similar to Week7 (20)

Cucumber, Cuke4Duke, and Groovy
Cucumber, Cuke4Duke, and GroovyCucumber, Cuke4Duke, and Groovy
Cucumber, Cuke4Duke, and Groovy
 
Becoming a more productive Rails Developer
Becoming a more productive Rails DeveloperBecoming a more productive Rails Developer
Becoming a more productive Rails Developer
 
Introduction to Test Driven Development
Introduction to Test Driven DevelopmentIntroduction to Test Driven Development
Introduction to Test Driven Development
 
Becoming a more Productive Rails Developer
Becoming a more Productive Rails DeveloperBecoming a more Productive Rails Developer
Becoming a more Productive Rails Developer
 
Cucumber in Practice(en)
Cucumber in Practice(en)Cucumber in Practice(en)
Cucumber in Practice(en)
 
Aki Salmi - Refactoring legacy code: a true story @ I T.A.K.E. Unconference 2...
Aki Salmi - Refactoring legacy code: a true story @ I T.A.K.E. Unconference 2...Aki Salmi - Refactoring legacy code: a true story @ I T.A.K.E. Unconference 2...
Aki Salmi - Refactoring legacy code: a true story @ I T.A.K.E. Unconference 2...
 
The Five Stages of Chef Grief: My First 6 months with Chef, and Getting Aroun...
The Five Stages of Chef Grief: My First 6 months with Chef, and Getting Aroun...The Five Stages of Chef Grief: My First 6 months with Chef, and Getting Aroun...
The Five Stages of Chef Grief: My First 6 months with Chef, and Getting Aroun...
 
Introduction to Testing and TDD
Introduction to Testing and TDDIntroduction to Testing and TDD
Introduction to Testing and TDD
 
Exploring Ruby on Rails and PostgreSQL
Exploring Ruby on Rails and PostgreSQLExploring Ruby on Rails and PostgreSQL
Exploring Ruby on Rails and PostgreSQL
 
6 reasons Jubilee could be a Rubyist's new best friend
6 reasons Jubilee could be a Rubyist's new best friend6 reasons Jubilee could be a Rubyist's new best friend
6 reasons Jubilee could be a Rubyist's new best friend
 
Build software like a bag of marbles, not a castle of LEGO®
Build software like a bag of marbles, not a castle of LEGO®Build software like a bag of marbles, not a castle of LEGO®
Build software like a bag of marbles, not a castle of LEGO®
 
JRuby: The Hard Parts
JRuby: The Hard PartsJRuby: The Hard Parts
JRuby: The Hard Parts
 
Dev-Friendly Ops
Dev-Friendly OpsDev-Friendly Ops
Dev-Friendly Ops
 
Automated Testing with Cucumber, PhantomJS and Selenium
Automated Testing with Cucumber, PhantomJS and SeleniumAutomated Testing with Cucumber, PhantomJS and Selenium
Automated Testing with Cucumber, PhantomJS and Selenium
 
Clojurescript slides
Clojurescript slidesClojurescript slides
Clojurescript slides
 
Thucydides - a brief review
Thucydides - a brief reviewThucydides - a brief review
Thucydides - a brief review
 
SPSNJ 2014: EmberJS & SharePoint
SPSNJ 2014: EmberJS & SharePointSPSNJ 2014: EmberJS & SharePoint
SPSNJ 2014: EmberJS & SharePoint
 
Erlang factory SF 2011 "Erlang and the big switch in social games"
Erlang factory SF 2011 "Erlang and the big switch in social games"Erlang factory SF 2011 "Erlang and the big switch in social games"
Erlang factory SF 2011 "Erlang and the big switch in social games"
 
Erlang, the big switch in social games
Erlang, the big switch in social gamesErlang, the big switch in social games
Erlang, the big switch in social games
 
Docker for everything
Docker for everythingDocker for everything
Docker for everything
 

More from reneedv

Fill Up your Bookshelves!
Fill Up your Bookshelves! Fill Up your Bookshelves!
Fill Up your Bookshelves! reneedv
 
Dealing with Legacy <del>Code</del> People
Dealing with Legacy <del>Code</del> PeopleDealing with Legacy <del>Code</del> People
Dealing with Legacy <del>Code</del> Peoplereneedv
 
Whose Wife Are You?
Whose Wife Are You?Whose Wife Are You?
Whose Wife Are You?reneedv
 
How I Learned to Smell Code
How I Learned to Smell CodeHow I Learned to Smell Code
How I Learned to Smell Codereneedv
 
RailsBrdige Seattle Workshop Intro
RailsBrdige Seattle Workshop IntroRailsBrdige Seattle Workshop Intro
RailsBrdige Seattle Workshop Introreneedv
 

More from reneedv (7)

Week2
Week2Week2
Week2
 
Week1
Week1Week1
Week1
 
Fill Up your Bookshelves!
Fill Up your Bookshelves! Fill Up your Bookshelves!
Fill Up your Bookshelves!
 
Dealing with Legacy <del>Code</del> People
Dealing with Legacy <del>Code</del> PeopleDealing with Legacy <del>Code</del> People
Dealing with Legacy <del>Code</del> People
 
Whose Wife Are You?
Whose Wife Are You?Whose Wife Are You?
Whose Wife Are You?
 
How I Learned to Smell Code
How I Learned to Smell CodeHow I Learned to Smell Code
How I Learned to Smell Code
 
RailsBrdige Seattle Workshop Intro
RailsBrdige Seattle Workshop IntroRailsBrdige Seattle Workshop Intro
RailsBrdige Seattle Workshop Intro
 

Week7

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