Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Faster specs
Search
Alexander Balashov
June 14, 2013
Programming
150
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Faster specs
Alexander Balashov
June 14, 2013
Other Decks in Programming
See All in Programming
HTML-in-Canvasで作る未来のWeb UI表現
clockmaker
5
5.1k
JAWS-UG 東京支部が始める、JAWS-UG支部コラボ / JAWS-UG lunchtime LT Collaboration
y0hgi
0
270
UnityでSystem.Net.WebSocketsなWebSocketサーバが動かないのでUnity Monoのコードを覗いてみた / about implementing websocket server with unity mono
drumath2237
1
610
Starting & Sustaining Code-Based E2E Testing for Non-Coding QA Teams( #jasstniigata )
teyamagu
PRO
1
1k
ハーネス設計入門 〜 基礎知識の整理から実務へのステップアップ 〜
kinopeee
28
32k
Long Living Tokens, Die, Die, Die! (or: The One Ring is Banned in Modern)
sylph01
0
300
Simple Storage Service(S3) is not simple
iwatsukayura
0
290
半永久的に提供し続けられるプライベートクラウドを目指して ― 利用者の認知負荷を抑えるAPI抽象化とハードウェア世代交代の基盤設計
tomokon
0
500
sbt 2.0: takeoff
eed3si9n
0
160
[Dev Group Paris Octobre 26] Agentforce, SIforce, Claudeforce, Slackbot… on s'y retrouve ?
nabondance
0
110
3回つくってわかった、 定期実行ジョブ基盤の本質情報
takai
0
450
phperだってパンチカードでコーディングしたい
o0h
PRO
0
330
Featured
See All Featured
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
570
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
360
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
220
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
1
570
Optimising Largest Contentful Paint
csswizardry
37
4k
Making Projects Easy
brettharned
120
6.8k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
1
3.4k
RailsConf 2023
tenderlove
30
1.6k
AI Search: Where Are We & What Can We Do About It?
aleyda
0
8.1k
Done Done
chrislema
187
17k
Mobile First: as difficult as doing things right
swwweet
225
10k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Transcript
Тестирование. Скорость. Александр Балашов / Evrone Friday, June 14, 13
Загрузка приложения 1 Friday, June 14, 13
Friday, June 14, 13
Friday, June 14, 13
Friday, June 14, 13
(при реальном количестве гемов) Friday, June 14, 13
Группы в Gemfile => 3с group :test group :development group
:production Friday, June 14, 13
:development • hirb • wirble • bullet • migration_opener •
letter_opener • capistrano • quiet_assets • capistrano-nc • localeapp • dev_log_in Friday, June 14, 13
:test • fakeweb • timecop • database_cleaner • launchy •
zonebie Friday, June 14, 13
:production • newrelic_rpm Friday, June 14, 13
Lazy require => 3с gem 'savon', require: false require 'savon'
gem ‘paper_trail’, require: false gem 'whenever', require: false Friday, June 14, 13
Редко используемые # gem ‘debugger’ # gem ‘ruby-prof’ Friday, June
14, 13
Время выполнения 2 Friday, June 14, 13
Finished in 15 minutes 12.9 seconds 1589 examples, 0 failures,
0 pending Friday, June 14, 13
Friday, June 14, 13
Статистика FactoryGirl USER — 1m 36 create: 3425 Friday, June
14, 13
• до 2 мин на создание одной фабрики • несколько
тысяч вызовов каждой • 7 фабрик с временем минута и более Friday, June 14, 13
Время FactoryGirl 50% Friday, June 14, 13
FactoryGirl.create(:user) Когда реально нужно учитывать состояние БД Friday, June 14,
13
FactoryGirl.build(:user) Реально создаёт объекты в БД Friday, June 14, 13
User.new • Простые валидации • Методы не связанные с БД
Friday, June 14, 13
stub_model(User) • Быстро работает • Независимость тестов • Подходит для
spec/services/* • Подходит для spec/mailers/* Friday, June 14, 13
FactoryGirl Seeds Friday, June 14, 13
Вложенные фабрики => 2мин rating < comment < post <
user < city Friday, June 14, 13
factory :keyword do project { seed(:project) } user { project.user
} Friday, June 14, 13
Стандартные фабрики comment = create(:comment) Friday, June 14, 13
Повсеместный User user = create(:user) Friday, June 14, 13
Finished in 10 minutes 42.38 seconds 1556 examples, 0 failures,
0 pending Friday, June 14, 13
(10 * 60 + 42) / (15 * 60 +
13) = 2x Friday, June 14, 13
github evrone/factory_girl-seeds Friday, June 14, 13
Запуск тестов 3 Friday, June 14, 13
Spork Friday, June 14, 13
Spin spin serve spin push spec/models/user_spec.rb:12 Friday, June 14, 13
Zeus zeus start zeus test spec/models/user_spec.rb:12 Friday, June 14, 13
Spring spring rspec spec/models/user_spec.rb:12 Friday, June 14, 13
rails/commands rails console test > test "models/user" Friday, June 14,
13
rspec-console rspec spec/models/user_spec.rb:13 Friday, June 14, 13
Итог spring binstub rspec => ./bin/test alias fs='FAST_SPEC_START=1 ./bin/test' unless
ENV['FAST_SPEC_START'] Seed.all end fs spec/models/user_spec.rb:13 Friday, June 14, 13
alias rg='spring rails g' alias rs='spring rails s' alias rc='spring
rails c' Friday, June 14, 13
Приёмы в спеках 4 Friday, June 14, 13
valid? вместо save Friday, June 14, 13
много it при объёмном before Friday, June 14, 13
slow: true (требует CI-сервера) # .rspec --tag ~slow --tag ~stable
Friday, June 14, 13
stable: true (требует CI-сервера) Friday, June 14, 13
Rails.logger.level = Logger::WARN Friday, June 14, 13
Devise.stretches = 1 Friday, June 14, 13
Top 10 slowest examples # .rspec -p Friday, June 14,
13
Finished in 2 minutes 38.91 seconds 893 examples, 0 failures,
0 pending Friday, June 14, 13
(15 * 60 + 13) / (2 * 60 +
38) = 6x Friday, June 14, 13