Documente Academic
Documente Profesional
Documente Cultură
Nicholas Cancelliere
email: ncancelliere@gmail.com
twitter: ozmox
Overview
Client
Value is in the views!
Views Often html but can also be programmatic
interfaces (such as XML or JSON),
Controllers remember valuable to the user.
Model
Red Green Refactor
write enough
test code to fail write just
enough code to
pass
review your
work and
refactor
Red Green Refactor
write enough
test code to fail write just
enough code to
pass
review your
work and
refactor
Red Green Refactor
write enough
test code to fail write just
enough code to
pass
review your
work and
refactor
Red Green Refactor
write enough
test code to fail write just
enough code to
pass
review your
work and
refactor
User Stories
concept popular in Agile practices like Scrum and XP
define the user’s role, what it is they need/want to do,
and why they need/want (the value)
As a us e r
w i t h an a
c o n t ac t s ddre s s b o
so I c an e o k , I ne e d
As a u s e r a s i l y re t r t o a dd
w i ie ve t h e m
e di t/de le t t h a n add l a te r.
e c o n t ac t r e s s bo ok , I n
s so I c an ee d to
d a te a n d ke e p i t up
m a n ag e a -to-
As a us e r b le .
w i t h an a
my c on t a ddre s s b o
c ts to o t h o k , I ne e d
e r us e rs t to se nd
o be sh a r
e d.
Pop the Why Stack
/config/environments/test.rb
config.gem 'rspec-rails', :lib => false
config.gem 'rspec', :lib => false
config.gem 'cucumber'
config.gem 'webrat'
/features/support/env.rb
# require ‘cucumber/rails/rspec’
# require ‘webrat/rspec-rails’
/features/step_definitions/webrat_steps.rb
# replace any matchers that use RSpec syntax
/features
review_past_events.feature
/step_definitions
event_steps.rb
webrat_steps.rb
/support
env.rb
paths.rb
Features
Features
Step Definition
Step Definition
Cukeing
Cukeing
Cukeing
Cukeing
Cukeing
Cukeing
Backgrounds
Backgrounds
Backgrounds
Scenario Outlines
Scenario Outlines
Remember...
Conversation
Acceptance Criteria
Design
Documentation
Automated Functional and Integration Tests
What do I use?
Speed
Selenium +
Webrat
Unit Testing +
Integration
Cucumber Smells
Relying too much on state in your step-definitions
Tests with no user value
Too much concrete, less abstract
Cucumber Smells
Relying too much on state in your step-definitions
Tests with no user value
Too much concrete, less abstract
Given /^state$/ do
@article = Article.create!
end
Given /^coupled by state/ do
@article.title = ‘Bad’
end
Cucumber Smells
Relying too much on state in your step-definitions
Tests with no user value
Too much concrete, less abstract