Download - Building and Scaling a Test Driven Culture
![Page 1: Building and Scaling a Test Driven Culture](https://reader035.vdocuments.net/reader035/viewer/2022081519/55621906d8b42af2128b5534/html5/thumbnails/1.jpg)
1
Building and Scaling a Test Driven CultureEngineering at Scale / AppNexusWednesday, May 8th 2013
@dblockdotorghttp://artsy.net
![Page 2: Building and Scaling a Test Driven Culture](https://reader035.vdocuments.net/reader035/viewer/2022081519/55621906d8b42af2128b5534/html5/thumbnails/2.jpg)
Open Source FTW!
![Page 3: Building and Scaling a Test Driven Culture](https://reader035.vdocuments.net/reader035/viewer/2022081519/55621906d8b42af2128b5534/html5/thumbnails/3.jpg)
3
1:0 Dev:Test1124:1 Test:Code
http://www.sqlite.org/testing.html
full automationeverybody tests
rock solid
![Page 4: Building and Scaling a Test Driven Culture](https://reader035.vdocuments.net/reader035/viewer/2022081519/55621906d8b42af2128b5534/html5/thumbnails/4.jpg)
4
some automationsome people test
some software doesn’t install
2:1 Dev:Test?:1 Test:Code
![Page 5: Building and Scaling a Test Driven Culture](https://reader035.vdocuments.net/reader035/viewer/2022081519/55621906d8b42af2128b5534/html5/thumbnails/5.jpg)
5
full automationcontinuous everything
8 hours of sleep per day5
1:0 Dev:Test2:1 Test:Code
![Page 6: Building and Scaling a Test Driven Culture](https://reader035.vdocuments.net/reader035/viewer/2022081519/55621906d8b42af2128b5534/html5/thumbnails/6.jpg)
6
Artsy.net Website is [Relatively] Big
5534 Automated Tests
1h22m to Run / 6 Machines
http://art.sy/artwork/liu-di-animal-regulation-no-2
![Page 7: Building and Scaling a Test Driven Culture](https://reader035.vdocuments.net/reader035/viewer/2022081519/55621906d8b42af2128b5534/html5/thumbnails/7.jpg)
7
RSpec / BDD
“when X and Y it does X + Y” Data Models : ODM with real data Ruby API : HTTP request – response Integration : Capybara
![Page 8: Building and Scaling a Test Driven Culture](https://reader035.vdocuments.net/reader035/viewer/2022081519/55621906d8b42af2128b5534/html5/thumbnails/8.jpg)
8
Models = Mongo ODM + Fabricators: 2156 tests
context “spline” do let(:spline) { Fabricate :spline } it “reticulate! updates reticulated count” do expect { spline.reticulate! }.to change(Spline.reticulated, :count).by(1) endend
![Page 9: Building and Scaling a Test Driven Culture](https://reader035.vdocuments.net/reader035/viewer/2022081519/55621906d8b42af2128b5534/html5/thumbnails/9.jpg)
9
Ruby API: 1894 Tests
context “spline” do it “create” do expect { post “/api/spline?name=test” response.status.should == 201 }.to change(Spline, :count).by(1) endend
![Page 10: Building and Scaling a Test Driven Culture](https://reader035.vdocuments.net/reader035/viewer/2022081519/55621906d8b42af2128b5534/html5/thumbnails/10.jpg)
10
Integration: 1484 Tests
context “spline” do let(:spline) { Fabricate :spline } it “displays a spline” do visit “/spline/#{spline.id}” page.should have_css “.spline[id=#{spline.id}]” endend
![Page 11: Building and Scaling a Test Driven Culture](https://reader035.vdocuments.net/reader035/viewer/2022081519/55621906d8b42af2128b5534/html5/thumbnails/11.jpg)
![Page 12: Building and Scaling a Test Driven Culture](https://reader035.vdocuments.net/reader035/viewer/2022081519/55621906d8b42af2128b5534/html5/thumbnails/12.jpg)
12
10x Everything
![Page 13: Building and Scaling a Test Driven Culture](https://reader035.vdocuments.net/reader035/viewer/2022081519/55621906d8b42af2128b5534/html5/thumbnails/13.jpg)
JavaScript: 960 TestsJasmine
beforeEach ->
view = new App.Views.UsersEdit view.model = new App.Models.User fabricate ‘user’
describe ‘#save’, -> it ‘saves the model’, -> view.model.set ‘name’, ‘updated’ view.save() JSON.parse(jqLastAjaxRequest.data).name.should equal ‘updated’
13
![Page 14: Building and Scaling a Test Driven Culture](https://reader035.vdocuments.net/reader035/viewer/2022081519/55621906d8b42af2128b5534/html5/thumbnails/14.jpg)
JavaScript: Recent Projects
Node – headless unit testing for client-side code Mocha – rspec-like testing Sinon – stub JSDom – simulate DOM API Zombie – headless browser integration testing
![Page 15: Building and Scaling a Test Driven Culture](https://reader035.vdocuments.net/reader035/viewer/2022081519/55621906d8b42af2128b5534/html5/thumbnails/15.jpg)
Test Driven Culture
Tests are second nature A bug becomes a test becomes a fix A feature starts as a test becomes a feature Tests absorb developer stress Everyone has confidence in moving forward
![Page 16: Building and Scaling a Test Driven Culture](https://reader035.vdocuments.net/reader035/viewer/2022081519/55621906d8b42af2128b5534/html5/thumbnails/16.jpg)
Successful Test Driven Culture
“It Works”
![Page 17: Building and Scaling a Test Driven Culture](https://reader035.vdocuments.net/reader035/viewer/2022081519/55621906d8b42af2128b5534/html5/thumbnails/17.jpg)
Signs of a Test Driven Culture
![Page 18: Building and Scaling a Test Driven Culture](https://reader035.vdocuments.net/reader035/viewer/2022081519/55621906d8b42af2128b5534/html5/thumbnails/18.jpg)
Cost of Failure
A very important demo with a potential investor A very important person using our site Hundreds of thousands of users You’re selling things for $
![Page 19: Building and Scaling a Test Driven Culture](https://reader035.vdocuments.net/reader035/viewer/2022081519/55621906d8b42af2128b5534/html5/thumbnails/19.jpg)
“To Be or Not to Be”
![Page 20: Building and Scaling a Test Driven Culture](https://reader035.vdocuments.net/reader035/viewer/2022081519/55621906d8b42af2128b5534/html5/thumbnails/20.jpg)
Testability
![Page 21: Building and Scaling a Test Driven Culture](https://reader035.vdocuments.net/reader035/viewer/2022081519/55621906d8b42af2128b5534/html5/thumbnails/21.jpg)
UI?
![Page 22: Building and Scaling a Test Driven Culture](https://reader035.vdocuments.net/reader035/viewer/2022081519/55621906d8b42af2128b5534/html5/thumbnails/22.jpg)
Ownership
https://groups.google.com/forum/?fromgroups=#!topic/ruby-grape/VELsU47wXkU
“It doesn’t work!”
![Page 23: Building and Scaling a Test Driven Culture](https://reader035.vdocuments.net/reader035/viewer/2022081519/55621906d8b42af2128b5534/html5/thumbnails/23.jpg)
23
Management Money Consultants
Don’t Count On Them
![Page 24: Building and Scaling a Test Driven Culture](https://reader035.vdocuments.net/reader035/viewer/2022081519/55621906d8b42af2128b5534/html5/thumbnails/24.jpg)
24
Remove Those that Talk About Testing Hire From Open-Source Remove the Safety Net
Use a Non-Compiling Language Do Devops
Maintain a Test Driven Culture