Aikido, Controller Tests, and LinkedIn
-
Upload
mdenomy -
Category
Technology
-
view
896 -
download
1
description
Transcript of Aikido, Controller Tests, and LinkedIn
![Page 1: Aikido, Controller Tests, and LinkedIn](https://reader033.fdocuments.us/reader033/viewer/2022052820/5482b2475806b5f7048b46cd/html5/thumbnails/1.jpg)
@mdenomy
Thursday, January 16, 14
![Page 2: Aikido, Controller Tests, and LinkedIn](https://reader033.fdocuments.us/reader033/viewer/2022052820/5482b2475806b5f7048b46cd/html5/thumbnails/2.jpg)
Aikido,Controller Tests,
and LinkedIn
Michael DenomyLaunch AcademyJanuary 16, 2014
Thursday, January 16, 14
![Page 3: Aikido, Controller Tests, and LinkedIn](https://reader033.fdocuments.us/reader033/viewer/2022052820/5482b2475806b5f7048b46cd/html5/thumbnails/3.jpg)
Aikido,Controller Tests,
and LinkedIn3 things that seemingly
have nothing to do with one another
Michael DenomyLaunch AcademyJanuary 16, 2014
Thursday, January 16, 14
![Page 4: Aikido, Controller Tests, and LinkedIn](https://reader033.fdocuments.us/reader033/viewer/2022052820/5482b2475806b5f7048b46cd/html5/thumbnails/4.jpg)
What’s This All About• Get you thinking about life after
Launch Academy
Thursday, January 16, 14
![Page 5: Aikido, Controller Tests, and LinkedIn](https://reader033.fdocuments.us/reader033/viewer/2022052820/5482b2475806b5f7048b46cd/html5/thumbnails/5.jpg)
What’s This All About• Get you thinking about life after
Launch Academy
ABGB
lwayseettingetter
Thursday, January 16, 14
![Page 6: Aikido, Controller Tests, and LinkedIn](https://reader033.fdocuments.us/reader033/viewer/2022052820/5482b2475806b5f7048b46cd/html5/thumbnails/6.jpg)
Trivia Question
Who is this, and why should you care?
Thursday, January 16, 14
![Page 7: Aikido, Controller Tests, and LinkedIn](https://reader033.fdocuments.us/reader033/viewer/2022052820/5482b2475806b5f7048b46cd/html5/thumbnails/7.jpg)
Alistair Cockburn• One of the Agile Manifesto authors- http://agilemanifesto.org/
• Introduced concept of Shu-Ha-Ri to software development- Term from Aikido about 3 stages of learning
Thursday, January 16, 14
![Page 8: Aikido, Controller Tests, and LinkedIn](https://reader033.fdocuments.us/reader033/viewer/2022052820/5482b2475806b5f7048b46cd/html5/thumbnails/8.jpg)
Shu-Ha-Ri
http://www.infoq.com/presentations/cockburn-bury-not-praise-agile
Shu-Ha-Ri comes up at ~31:40, but entire talk worthwhile.
Thursday, January 16, 14
![Page 9: Aikido, Controller Tests, and LinkedIn](https://reader033.fdocuments.us/reader033/viewer/2022052820/5482b2475806b5f7048b46cd/html5/thumbnails/9.jpg)
What Does This Mean For You
• You are in the Shu phase- Don’t cherry pick what you think you should do- Learn a technique from your masters
• Someday you will leave these walls- Evaluate different techniques- Be open to other ways- This is Ha, incorporate different techniques
• Someday, you may get to Ri
Thursday, January 16, 14
![Page 10: Aikido, Controller Tests, and LinkedIn](https://reader033.fdocuments.us/reader033/viewer/2022052820/5482b2475806b5f7048b46cd/html5/thumbnails/10.jpg)
A Practical Example•When I learned Rails....
• Started with Hartl Tutorial- When I did it there were Controller tests like
these
Thursday, January 16, 14
![Page 11: Aikido, Controller Tests, and LinkedIn](https://reader033.fdocuments.us/reader033/viewer/2022052820/5482b2475806b5f7048b46cd/html5/thumbnails/11.jpg)
RSpec Docs Reinforced That
https://www.relishapp.com/rspec/rspec-rails/docs/controller-specs
Thursday, January 16, 14
![Page 12: Aikido, Controller Tests, and LinkedIn](https://reader033.fdocuments.us/reader033/viewer/2022052820/5482b2475806b5f7048b46cd/html5/thumbnails/12.jpg)
That Was Me in Shu Phase• I’d learned one way of doing it
• It worked for me
• Provided a safety net“Test-driven development is a way of managing fear during programming. I don't mean fear in a bad way-but fear in the legitimate, this-is-a-hard-problem-and-I-can't-see-the-end-from-the-beginning sense.” Kent Beck - Test Driven Development By Example
Thursday, January 16, 14
![Page 13: Aikido, Controller Tests, and LinkedIn](https://reader033.fdocuments.us/reader033/viewer/2022052820/5482b2475806b5f7048b46cd/html5/thumbnails/13.jpg)
Then A Few Things Happened
A perfect Shu response
A Shu comment
I reviewed some code for a Launcher’s final project
Thursday, January 16, 14
![Page 14: Aikido, Controller Tests, and LinkedIn](https://reader033.fdocuments.us/reader033/viewer/2022052820/5482b2475806b5f7048b46cd/html5/thumbnails/14.jpg)
And Another Thing
Thursday, January 16, 14
![Page 15: Aikido, Controller Tests, and LinkedIn](https://reader033.fdocuments.us/reader033/viewer/2022052820/5482b2475806b5f7048b46cd/html5/thumbnails/15.jpg)
Dan Calls Shenanigans!
Thursday, January 16, 14
![Page 16: Aikido, Controller Tests, and LinkedIn](https://reader033.fdocuments.us/reader033/viewer/2022052820/5482b2475806b5f7048b46cd/html5/thumbnails/16.jpg)
Time for some Ha Thinking
• Polled some people in the industry
• Thought about my own practices
•Made some changes- Take more of an outside-in approach- Start with a feature test- Explore data and models without being bound
to the database/migrations- Add in model tests and migrations- Mix of controller and feature tests for edge
cases
Thursday, January 16, 14
![Page 17: Aikido, Controller Tests, and LinkedIn](https://reader033.fdocuments.us/reader033/viewer/2022052820/5482b2475806b5f7048b46cd/html5/thumbnails/17.jpg)
Controller Tests I Don’t Write
• Testing the framework- e.g. index action rendering index template
• Testing template via controller test
• Assignments
Thursday, January 16, 14
![Page 18: Aikido, Controller Tests, and LinkedIn](https://reader033.fdocuments.us/reader033/viewer/2022052820/5482b2475806b5f7048b46cd/html5/thumbnails/18.jpg)
Controller Tests I Do Write
•Model/association creation on posts
• Redirects on invalid data/conditions
• Flash messages
Thursday, January 16, 14
![Page 19: Aikido, Controller Tests, and LinkedIn](https://reader033.fdocuments.us/reader033/viewer/2022052820/5482b2475806b5f7048b46cd/html5/thumbnails/19.jpg)
Controller Tests I Do Write
• External APIs- in conjunction with stubs
Thursday, January 16, 14
![Page 20: Aikido, Controller Tests, and LinkedIn](https://reader033.fdocuments.us/reader033/viewer/2022052820/5482b2475806b5f7048b46cd/html5/thumbnails/20.jpg)
Summary• There is value in controller tests
• Starting with feature tests help me keep perspective and explore
• Risk vs Reward- Every line of code costs $- Every line of code is a potential liability
• Always be open to change
Thursday, January 16, 14
![Page 21: Aikido, Controller Tests, and LinkedIn](https://reader033.fdocuments.us/reader033/viewer/2022052820/5482b2475806b5f7048b46cd/html5/thumbnails/21.jpg)
Bonus Tracks
Deleted Scenes
Alternate Endings
Interview with the director
Personalized LinkedIn Invites
Thursday, January 16, 14
![Page 22: Aikido, Controller Tests, and LinkedIn](https://reader033.fdocuments.us/reader033/viewer/2022052820/5482b2475806b5f7048b46cd/html5/thumbnails/22.jpg)
Bonus Tracks
Personalized LinkedIn Invites
Thursday, January 16, 14
![Page 23: Aikido, Controller Tests, and LinkedIn](https://reader033.fdocuments.us/reader033/viewer/2022052820/5482b2475806b5f7048b46cd/html5/thumbnails/23.jpg)
140 Characters Can’t Describe My Sadness
Thursday, January 16, 14
![Page 24: Aikido, Controller Tests, and LinkedIn](https://reader033.fdocuments.us/reader033/viewer/2022052820/5482b2475806b5f7048b46cd/html5/thumbnails/24.jpg)
140 Characters Can’t Describe My Sadness
Thursday, January 16, 14
![Page 25: Aikido, Controller Tests, and LinkedIn](https://reader033.fdocuments.us/reader033/viewer/2022052820/5482b2475806b5f7048b46cd/html5/thumbnails/25.jpg)
Good Networking Etiquette
• Send follow-up and thank you emails- Stand out from the crowd
• Get out there and talk to people- Tell them what you have done, not what
you want to do
• Personalize your LinkedIn invites
Thursday, January 16, 14
![Page 26: Aikido, Controller Tests, and LinkedIn](https://reader033.fdocuments.us/reader033/viewer/2022052820/5482b2475806b5f7048b46cd/html5/thumbnails/26.jpg)
@mdenomy
Thursday, January 16, 14