From Patterns to `test && commit || revert`

From Patterns to `test && commit || revert`

Kent Beck (TDD, eXtreme Programming, Agile Manifesto) has a couple new ideas. They both sound so terrible and impossible that they just might be totally amazing.

1. test && commit || revert If tests pass, commit everything. If they fail, revert everything. Automatically. Wild.

2. LIMBO. Anything that's committed is pushed. Anything that's committed by teammates is automatically pulled in while you work. So wild.

Does this work? Does it scale? Will I always be losing important progress because of a typo? Will this make me a better / faster / happier programmer?

We'll cover tools, process, deficiencies, mental models, and experiences. Show up and see what happens.

---

Shane Becker
Shane (he/him) is a developer, designer, and an anarchist. He was once the open source cheerleader for Rubinius. He co-organized Cascadia Ruby, Farmhouse Conf and Barn Talks. Currently, he’s a senior software engineer at Mode.com and coordinator of development on crimethinc.com (an anti-fascist anarchist publishing collective). He's exploring these wild-sounding new ways software development to see if another world is possible.

317259b800623d76bba3e7a4fbbbf70a?s=128

Shane Becker

April 30, 2019
Tweet

Transcript

  1. From test && commit || revert to LIMBO

  2. From test && commit || revert to LIMBO

  3. From test && commit || revert to

  4. From test && commit || revert to

  5. From test && commit || revert

  6. From test && commit || revert

  7. test && commit || revert

  8. Patterns test && commit || revert

  9. On patterns and test && commit || revert

  10. On patterns and test && commit || revert

  11. Shane Becker

  12. @veganstraightedge

  13. None
  14. None
  15. None
  16. None
  17. None
  18. Cascadia Ruby Co-organized with Ben Bleything

  19. Farmhouse Conf And one Barn Talk

  20. Open Source Cheerleader

  21. Rubinius

  22. JRuby

  23. San Francisco, California

  24. None
  25. None
  26. None
  27. None
  28. We’re Hiring!

  29. mode.com

  30. None
  31. SQL

  32. We’re Hiring!

  33. Heather Rivers Chief Technical Officer

  34. This slide intentionally left blank

  35. On patterns and test && commit || revert

  36. Brief technical overview A historical interlude Deeper technical exploration

  37. tl;dr too long; didn’t read

  38. test

  39. and

  40. commit

  41. or

  42. revert

  43. test && commit || revert

  44. test && commit || revert

  45. test

  46. rake test

  47. rspec

  48. bundle exec rspec

  49. be rspec

  50. commit

  51. COMMIT

  52. git commit -am "ALL OF THE THINGS"

  53. git commit -am working

  54. git commit -am [TCR]

  55. git add .

  56. git add . && git commit -am [TCR]

  57. revert

  58. git revert

  59. git reset --hard

  60. git add . && git stash

  61. test && commit || revert

  62. be rspec && git add . && git commit -am

    [TCR] || git reset --hard
  63. alias tcr = " be rspec && git add .

    && git commit -am [TCR] || git reset --hard"
  64. > tcr

  65. > tcr

  66. None
  67. mental_alias tcr = "test && commit || revert"

  68. What is TCR, even?

  69. 1.“Just” an idea

  70. 2.Combination of 3 existing tools

  71. 3.Automation of that combination

  72. 4.Naming that pattern

  73. 5.Software development process

  74. Why now?

  75. The history of TCR

  76. The history of TCR

  77. A history of TCR

  78. #truefacts

  79. No history is objective No history is unbiased No history

    is complete
  80. No history is objective No history is unbiased No history

    is complete
  81. No history is objective No history is unbiased No history

    is complete
  82. A brief and incomplete history of people, events, and ideas

    that predate the idea of TCR which when swirled together in a stew and looked at from a certain perspective can be seen as related around a particular theme, or something…
  83. A brief and incomplete history of people, events, and ideas

    that predate the idea of TCR which when swirled together in a stew and looked at from a certain perspective can be seen as related around a particular theme, or something…
  84. A brief and incomplete history of people, events, and ideas

    that predate the idea of TCR which when swirled together in a stew and looked at from a certain perspective can be seen as related around a particular theme, or something…
  85. A brief and incomplete history of people, events, and ideas

    that predate the idea of TCR which when swirled together in a stew and looked at from a certain perspective can be seen as related around a particular theme, or something…
  86. A brief and incomplete history of people, events, and ideas

    that predate the idea of TCR which when swirled together in a stew and looked at from a certain perspective can be seen as related around a particular theme, or something…
  87. None
  88. On patterns and test && commit || revert

  89. First things first

  90. Eugene, Oregon

  91. University of Oregon

  92. 1961

  93. None
  94. None
  95. 1968

  96. Klamath Hall

  97. Brutalist architecture

  98. None
  99. None
  100. The Jetsons

  101. Bulgaria

  102. None
  103. Бузлуджа Buzludzha

  104. Turkish for “icy”

  105. None
  106. None
  107. None
  108. None
  109. None
  110. None
  111. None
  112. None
  113. Klamath Hall

  114. None
  115. None
  116. None
  117. 1970

  118. None
  119. President of the University

  120. University of California, Berkeley

  121. Christopher Alexander Sara Ishikawa Murray Silverstein Shlomo Angel Denny Abrams

    Ingrid Fiksdahl-King
  122. The Oregon Experiment

  123. Organic Order Planning and construction will be guided by a

    process which allows the whole to emerge gradually from local acts.
  124. Participation All decision about what to build, and how to

    build it, will be in the hands of the users.
  125. Piecemeal Growth The construction undertaken in each period will be

    weighed overwhelmingly toward small projects.
  126. Patterns All design and construction will be guided by a

    collection of communally adopted planning principles called patterns.
  127. Diagnosis The well being of the whole will be protected

    by an annual diagnosis which explains, in detail, which spaces are alive and which ones are dead, at any given moment in the history of the community.
  128. Coordination Finally, the slow emergence of organic order in the

    whole will be assured by a funding process which regulates the stream of individual projects put forward by users.
  129. The Oregon Experiment

  130. The Timeless Way of Building

  131. A Pattern Language

  132. Identifiable Neighborhood

  133. Eccentric Nucleus

  134. Web of Public Transportation

  135. Sitting Wall

  136. Small Window Panes

  137. Pools of Light

  138. Isaac Newton & Gottfried Wilhelm Leibniz

  139. 1979

  140. A Pattern Language

  141. Ward Cunningham

  142. Kent Beck

  143. 1985

  144. Pair Programming

  145. Patterns

  146. Portland Pattern Repository

  147. C2.com

  148. First wiki

  149. 1994

  150. Design Patterns

  151. Gang of Four

  152. 1997

  153. Kent Beck

  154. Smalltalk Best Practice Patterns

  155. Josh Susser

  156. A Pattern Language

  157. Web design

  158. Tiny house

  159. A Pattern Language

  160. Smalltalk Best Practice Patterns

  161. Kent Beck

  162. Test Driven Development

  163. TDD

  164. Rediscovered TDD

  165. 1960s

  166. None
  167. Mercury missions

  168. eXtreme Programming

  169. Pair Programming

  170. Test Driven Development

  171. Story cards

  172. Agile Manifesto

  173. A Pattern Language

  174. The Timeless Way of Building

  175. The Oregon Experiment

  176. Organic Order Participation Piecemeal Growth Patterns Diagnosis Coordination

  177. Organic Order Participation Piecemeal Growth Patterns Diagnosis Coordination

  178. Agile development

  179. None
  180. Architecture design principles

  181. 1970s

  182. test && commit || revert

  183. 2018

  184. Kent Beck

  185. test && commit

  186. 2012

  187. Sandi Metz

  188. Practical Object Oriented Design with Ruby

  189. POODR

  190. Refactoring

  191. Patterns

  192. Design

  193. Testing

  194. 2017

  195. Sandi Metz & Katrina Owen

  196. 99 Bottles of OOP

  197. Manual TCR

  198. Make a tiny change

  199. Run the tests

  200. If they pass, commit

  201. If they fail, undo your change…

  202. …and make a better change

  203. TCR sounds like 99 Bottles of OOP!

  204. In Oslo at Code Camp

  205. || revert

  206. test && commit

  207. Oddmund Strømmer

  208. Absurd

  209. Cheap

  210. Safe

  211. MUST TRY

  212. Who invented TCR?

  213. Who discovered TCR?

  214. Katrina Owen

  215. Kent Beck

  216. Oddmund Strømmer

  217. Ideas don’t exist in a vacuum

  218. Stands on the shoulders of giants

  219. Everything is a Remix

  220. The adjacent possible

  221. An idea’s time has come

  222. The idea for TCR

  223. In the air

  224. Sandi Metz, Kent Beck, Katrina Owen, or Oddmund Strømmer

  225. Someone else would have

  226. None
  227. TCR exploration

  228. Misadventures into TCR

  229. Improving tests

  230. Didn’t run all of the tests

  231. Only the changed test

  232. Much faster feedback loop

  233. > a few seconds

  234. Make your tests fasts

  235. Run isolated tests, manually

  236. Run isolated tests, automatically

  237. Do the Right Thing™

  238. RSpec

  239. Minitest

  240. Guard

  241. Fast tests

  242. Obviously Good Idea™

  243. Refactoring

  244. Refactoring

  245. Refactoring Refactoring is a disciplined technique for restructuring an existing

    body of code, altering its internal structure without changing its external behavior.
  246. Make tiny change

  247. Run tests

  248. If pass, commit

  249. If fail, undo

  250. Repeat

  251. TCR pairing sessions

  252. Morgan Fogarty

  253. Fibonacci

  254. Commit history is not useful

  255. [tcr] [tcr] [tcr] [tcr] [tcr] [tcr] [tcr]

  256. Does this matter?

  257. Always work on a branch

  258. Never on master

  259. Squash commit

  260. UNDO ⌘Z

  261. Restore the changes

  262. || revert

  263. Is that cheating?

  264. Confusing when code disappears

  265. TCR tooling

  266. Test and implementation

  267. Write a test

  268. Hardcode the implementation

  269. > tcr

  270. Test gets locked in

  271. TCR just the implementation

  272. None
  273. Evan Phoenix

  274. None
  275. None
  276. 6 commits

  277. 2 files

  278. ~12 reverts

  279. Exploring an interface

  280. @e.stdout.string

  281. @e.stdout.to_s

  282. None
  283. Isolated tests, for speed

  284. Pre-pull request

  285. Entire test suite

  286. Again, in CI

  287. None
  288. Bookis Worthy

  289. Rails + React

  290. Kids on 45th

  291. kidson45th.com

  292. Fast tests!

  293. 53 commits

  294. 86 minutes

  295. TCR commit log as a timetracker

  296. Bookis Worthy 3 minutes ago: Working 4121ab0 Bookis Worthy 3

    minutes ago: Working dfa242a Bookis Worthy 8 minutes ago: Working 1267372 Bookis Worthy 9 minutes ago: Working d873303 Bookis Worthy 10 minutes ago: Working 1b9a472 Bookis Worthy 12 minutes ago: Working f2517fa Bookis Worthy 12 minutes ago: Working 5ac2c2d Bookis Worthy 13 minutes ago: Working 292aedc Bookis Worthy 14 minutes ago: Working a7ca016 Bookis Worthy 14 minutes ago: Working 1aacf64 Bookis Worthy 14 minutes ago: Working af9396e Bookis Worthy 19 minutes ago: Working a9a3d4a Bookis Worthy 19 minutes ago: Working 2690a93 Bookis Worthy 27 minutes ago: Working 53f8ae7 Bookis Worthy 29 minutes ago: Working 69e6aee Bookis Worthy 30 minutes ago: Working 80e9ade Bookis Worthy 31 minutes ago: Working c0d4e04 Bookis Worthy 31 minutes ago: Working c33ad17 Bookis Worthy 34 minutes ago: Working 61162c8 Bookis Worthy 34 minutes ago: Working c09eb74 Bookis Worthy 35 minutes ago: Working 51346ed Bookis Worthy 38 minutes ago: Working 589a813 Bookis Worthy 39 minutes ago: Working 77d0320 Bookis Worthy 41 minutes ago: Working 93e2c21 Bookis Worthy 41 minutes ago: Working c23e1c4 Bookis Worthy 41 minutes ago: Working 2c78c63 Bookis Worthy 44 minutes ago: Working e35da95 Bookis Worthy 46 minutes ago: Working 384a9ee Bookis Worthy 49 minutes ago: Working dd65bd0 Bookis Worthy 51 minutes ago: Working c71c605 Bookis Worthy 52 minutes ago: Working 3c9a425 Bookis Worthy 52 minutes ago: Working 9ec1327 Bookis Worthy 53 minutes ago: Working b30bbfa Bookis Worthy 57 minutes ago: Working a154824 Bookis Worthy 63 minutes ago: Working 8bc157f Bookis Worthy 65 minutes ago: Working f657d30 Bookis Worthy 66 minutes ago: Working e5fb094 Bookis Worthy 67 minutes ago: Working 4f0c7cf Bookis Worthy 68 minutes ago: Working 230e17b Bookis Worthy 69 minutes ago: Working 29f1932 Bookis Worthy 69 minutes ago: Working 9802c3a Bookis Worthy 70 minutes ago: Working 0f81873 Bookis Worthy 72 minutes ago: Working 443cd08 Bookis Worthy 73 minutes ago: Working 1c447a3 Bookis Worthy 74 minutes ago: Working 93a6840 Bookis Worthy 75 minutes ago: Working 41057b8 Bookis Worthy 82 minutes ago: Working 183c82c Bookis Worthy 83 minutes ago: Working 61ab629 Bookis Worthy 84 minutes ago: Working 5ccc45d Bookis Worthy 86 minutes ago: Working fab43fc Bookis Worthy 86 minutes ago: Working d2982cd
  297. Smaller moves

  298. foo.update bar: 'baz'

  299. > tcr

  300. foo.update! bar: 'baz'

  301. By being careful

  302. Be risky

  303. Small moves

  304. Safe

  305. Easy

  306. Cheap to try

  307. Cheap to fail

  308. Trust the process

  309. Be pedantic

  310. Feel the pain

  311. Find the benefits

  312. Make small moves

  313. Single words

  314. Single characters

  315. Lean on || revert

  316. Clean up our exploratory demolition

  317. SomeClass. strange_method

  318. class Foo def bar SomeClass.strange_method end end

  319. Outside in

  320. One step at a time

  321. None
  322. require 'test_helper' class SwapRequestCreditorTest < ActiveSupport::TestCase fixtures :swap_requests, :basic_orders, :order_items,

    :skus, :order_skus test "#credit_amount_cents sums out of stock sku price" do order = basic_orders(:complete) swap_request = swap_requests(:one) swap_request.update!(order: order, state: SwapRequest::INITIATED) out_of_stock_sku = skus(:one) out_of_stock_sku.update!(in_stock: 0) out_of_stock_order_sku = order_skus(:one).tap { |os| os.update!(sku: out_of_stock_sku, order: order) } out_of_stock_order_item = order_items(:shirt).tap do |oi| oi.update!(order_sku: out_of_stock_order_sku, price_cents: 100, quantity: 3) end order.order_items << out_of_stock_order_item cents = SwapRequestCreditor.new(id: swap_request.id).credit_amount_cents assert_equal(cents, 300) end end
  323. require 'test_helper' class SwapRequestCreditorTest < ActiveSupport::TestCase fixtures :swap_requests, :basic_orders, :order_items,

    :skus, :order_skus test "#credit_amount_cents sums out of stock sku price" do order = basic_orders(:complete) swap_request = swap_requests(:one) swap_request.update!(order: order, state: SwapRequest::INITIATED) out_of_stock_sku = skus(:one) out_of_stock_sku.update!(in_stock: 0) out_of_stock_order_sku = order_skus(:one).tap { |os| os.update!(sku: out_of_stock_sku, order: order) } out_of_stock_order_item = order_items(:shirt).tap do |oi| oi.update!(order_sku: out_of_stock_order_sku, price_cents: 100, quantity: 3) end order.order_items << out_of_stock_order_item cents = SwapRequestCreditor.new(id: swap_request.id).credit_amount_cents assert_equal(cents, 300) end end
  324. require 'test_helper' class SwapRequestCreditorTest < ActiveSupport::TestCase fixtures :swap_requests, :basic_orders, :order_items,

    :skus, :order_skus test "#credit_amount_cents sums out of stock sku price" do order = basic_orders(:complete) swap_request = swap_requests(:one) swap_request.update!(order: order, state: SwapRequest::INITIATED) out_of_stock_sku = skus(:one) out_of_stock_sku.update!(in_stock: 0) out_of_stock_order_sku = order_skus(:one).tap { |os| os.update!(sku: out_of_stock_sku, order: order) } out_of_stock_order_item = order_items(:shirt).tap do |oi| oi.update!(order_sku: out_of_stock_order_sku, price_cents: 100, quantity: 3) end order.order_items << out_of_stock_order_item cents = SwapRequestCreditor.new(id: swap_request.id).credit_amount_cents assert_equal(cents, 300) end end
  325. require 'test_helper' class SwapRequestCreditorTest < ActiveSupport::TestCase fixtures :swap_requests, :basic_orders, :order_items,

    :skus, :order_skus test "#credit_amount_cents sums out of stock sku price" do order = basic_orders(:complete) swap_request = swap_requests(:one) swap_request.update!(order: order, state: SwapRequest::INITIATED) out_of_stock_sku = skus(:one) out_of_stock_sku.update!(in_stock: 0) out_of_stock_order_sku = order_skus(:one).tap { |os| os.update!(sku: out_of_stock_sku, order: order) } out_of_stock_order_item = order_items(:shirt).tap do |oi| oi.update!(order_sku: out_of_stock_order_sku, price_cents: 100, quantity: 3) end order.order_items << out_of_stock_order_item cents = SwapRequestCreditor.new(id: swap_request.id).credit_amount_cents assert_equal(cents, 300) end end
  326. require 'test_helper' class SwapRequestCreditorTest < ActiveSupport::TestCase fixtures :swap_requests, :basic_orders, :order_items,

    :skus, :order_skus test "#credit_amount_cents sums out of stock sku price" do order = basic_orders(:complete) swap_request = swap_requests(:one) swap_request.update!(order: order, state: SwapRequest::INITIATED) out_of_stock_sku = skus(:one) out_of_stock_sku.update!(in_stock: 0) out_of_stock_order_sku = order_skus(:one).tap { |os| os.update!(sku: out_of_stock_sku, order: order) } out_of_stock_order_item = order_items(:shirt).tap do |oi| oi.update!(order_sku: out_of_stock_order_sku, price_cents: 100, quantity: 3) end order.order_items << out_of_stock_order_item cents = SwapRequestCreditor.new(id: swap_request.id).credit_amount_cents assert_equal(cents, 300) end end
  327. require 'test_helper' class SwapRequestCreditorTest < ActiveSupport::TestCase fixtures :swap_requests, :basic_orders, :order_items,

    :skus, :order_skus test "#credit_amount_cents sums out of stock sku price" do order = basic_orders(:complete) swap_request = swap_requests(:one) swap_request.update!(order: order, state: SwapRequest::INITIATED) out_of_stock_sku = skus(:one) out_of_stock_sku.update!(in_stock: 0) out_of_stock_order_sku = order_skus(:one).tap { |os| os.update!(sku: out_of_stock_sku, order: order) } out_of_stock_order_item = order_items(:shirt).tap do |oi| oi.update!(order_sku: out_of_stock_order_sku, price_cents: 100, quantity: 3) end order.order_items << out_of_stock_order_item cents = SwapRequestCreditor.new(id: swap_request.id).credit_amount_cents assert_equal(cents, 300) end end
  328. require 'test_helper' class SwapRequestCreditorTest < ActiveSupport::TestCase fixtures :swap_requests, :basic_orders, :order_items,

    :skus, :order_skus test "#credit_amount_cents sums out of stock sku price" do order = basic_orders(:complete) swap_request = swap_requests(:one) swap_request.update!(order: order, state: SwapRequest::INITIATED) out_of_stock_sku = skus(:one) out_of_stock_sku.update!(in_stock: 0) out_of_stock_order_sku = order_skus(:one).tap { |os| os.update!(sku: out_of_stock_sku, order: order) } out_of_stock_order_item = order_items(:shirt).tap do |oi| oi.update!(order_sku: out_of_stock_order_sku, price_cents: 100, quantity: 3) end order.order_items << out_of_stock_order_item cents = SwapRequestCreditor.new(id: swap_request.id).credit_amount_cents assert_equal(cents, 300) end end
  329. require 'test_helper' class SwapRequestCreditorTest < ActiveSupport::TestCase fixtures :swap_requests, :basic_orders, :order_items,

    :skus, :order_skus test "#credit_amount_cents sums out of stock sku price" do order = basic_orders(:complete) swap_request = swap_requests(:one) swap_request.update!(order: order, state: SwapRequest::INITIATED) out_of_stock_sku = skus(:one) out_of_stock_sku.update!(in_stock: 0) out_of_stock_order_sku = order_skus(:one).tap { |os| os.update!(sku: out_of_stock_sku, order: order) } out_of_stock_order_item = order_items(:shirt).tap do |oi| oi.update!(order_sku: out_of_stock_order_sku, price_cents: 100, quantity: 3) end order.order_items << out_of_stock_order_item cents = SwapRequestCreditor.new(id: swap_request.id).credit_amount_cents assert_equal(cents, 300) end end
  330. require 'test_helper' class SwapRequestCreditorTest < ActiveSupport::TestCase fixtures :swap_requests, :basic_orders, :order_items,

    :skus, :order_skus test "#credit_amount_cents sums out of stock sku price" do order = basic_orders(:complete) swap_request = swap_requests(:one) swap_request.update!(order: order, state: SwapRequest::INITIATED) out_of_stock_sku = skus(:one) out_of_stock_sku.update!(in_stock: 0) out_of_stock_order_sku = order_skus(:one).tap { |os| os.update!(sku: out_of_stock_sku, order: order) } out_of_stock_order_item = order_items(:shirt).tap do |oi| oi.update!(order_sku: out_of_stock_order_sku, price_cents: 100, quantity: 3) end order.order_items << out_of_stock_order_item cents = SwapRequestCreditor.new(id: swap_request.id).credit_amount_cents assert_equal(cents, 300) end end
  331. require 'test_helper' class SwapRequestCreditorTest < ActiveSupport::TestCase fixtures :swap_requests, :basic_orders, :order_items,

    :skus, :order_skus test "#credit_amount_cents sums out of stock sku price" do order = basic_orders(:complete) swap_request = swap_requests(:one) swap_request.update!(order: order, state: SwapRequest::INITIATED) out_of_stock_sku = skus(:one) out_of_stock_sku.update!(in_stock: 0) out_of_stock_order_sku = order_skus(:one).tap { |os| os.update!(sku: out_of_stock_sku, order: order) } out_of_stock_order_item = order_items(:shirt).tap do |oi| oi.update!(order_sku: out_of_stock_order_sku, price_cents: 100, quantity: 3) end order.order_items << out_of_stock_order_item cents = SwapRequestCreditor.new(id: swap_request.id).credit_amount_cents assert_equal(cents, 300) end end
  332. require 'test_helper' class SwapRequestCreditorTest < ActiveSupport::TestCase fixtures :swap_requests, :basic_orders, :order_items,

    :skus, :order_skus test "#credit_amount_cents sums out of stock sku price" do order = basic_orders(:complete) swap_request = swap_requests(:one) swap_request.update!(order: order, state: SwapRequest::INITIATED) out_of_stock_sku = skus(:one) out_of_stock_sku.update!(in_stock: 0) out_of_stock_order_sku = order_skus(:one).tap { |os| os.update!(sku: out_of_stock_sku, order: order) } out_of_stock_order_item = order_items(:shirt).tap do |oi| oi.update!(order_sku: out_of_stock_order_sku, price_cents: 100, quantity: 3) end order.order_items << out_of_stock_order_item cents = SwapRequestCreditor.new(id: swap_request.id).credit_amount_cents assert_equal(cents, 300) end end
  333. require 'test_helper' class SwapRequestCreditorTest < ActiveSupport::TestCase fixtures :swap_requests, :basic_orders, :order_items,

    :skus, :order_skus test "#credit_amount_cents sums out of stock sku price" do order = basic_orders(:complete) swap_request = swap_requests(:one) swap_request.update!(order: order, state: SwapRequest::INITIATED) out_of_stock_sku = skus(:one) out_of_stock_sku.update!(in_stock: 0) out_of_stock_order_sku = order_skus(:one).tap { |os| os.update!(sku: out_of_stock_sku, order: order) } out_of_stock_order_item = order_items(:shirt).tap do |oi| oi.update!(order_sku: out_of_stock_order_sku, price_cents: 100, quantity: 3) end order.order_items << out_of_stock_order_item cents = SwapRequestCreditor.new(id: swap_request.id).credit_amount_cents assert_equal(cents, 300) end end
  334. require 'test_helper' class SwapRequestCreditorTest < ActiveSupport::TestCase fixtures :swap_requests, :basic_orders, :order_items,

    :skus, :order_skus test "#credit_amount_cents sums out of stock sku price" do order = basic_orders(:complete) swap_request = swap_requests(:one) swap_request.update!(order: order, state: SwapRequest::INITIATED) out_of_stock_sku = skus(:one) out_of_stock_sku.update!(in_stock: 0) out_of_stock_order_sku = order_skus(:one).tap { |os| os.update!(sku: out_of_stock_sku, order: order) } out_of_stock_order_item = order_items(:shirt).tap do |oi| oi.update!(order_sku: out_of_stock_order_sku, price_cents: 100, quantity: 3) end order.order_items << out_of_stock_order_item cents = SwapRequestCreditor.new(id: swap_request.id).credit_amount_cents assert_equal(cents, 300) end end
  335. require 'test_helper' class SwapRequestCreditorTest < ActiveSupport::TestCase fixtures :swap_requests, :basic_orders, :order_items,

    :skus, :order_skus test "#credit_amount_cents sums out of stock sku price" do order = basic_orders(:complete) swap_request = swap_requests(:one) swap_request.update!(order: order, state: SwapRequest::INITIATED) out_of_stock_sku = skus(:one) out_of_stock_sku.update!(in_stock: 0) out_of_stock_order_sku = order_skus(:one).tap { |os| os.update!(sku: out_of_stock_sku, order: order) } out_of_stock_order_item = order_items(:shirt).tap do |oi| oi.update!(order_sku: out_of_stock_order_sku, price_cents: 100, quantity: 3) end order.order_items << out_of_stock_order_item cents = SwapRequestCreditor.new(id: swap_request.id).credit_amount_cents assert_equal(cents, 300) end end
  336. require 'test_helper' class SwapRequestCreditorTest < ActiveSupport::TestCase fixtures :swap_requests, :basic_orders, :order_items,

    :skus, :order_skus test "#credit_amount_cents sums out of stock sku price" do order = basic_orders(:complete) swap_request = swap_requests(:one) swap_request.update!(order: order, state: SwapRequest::INITIATED) out_of_stock_sku = skus(:one) out_of_stock_sku.update!(in_stock: 0) out_of_stock_order_sku = order_skus(:one).tap { |os| os.update!(sku: out_of_stock_sku, order: order) } out_of_stock_order_item = order_items(:shirt).tap do |oi| oi.update!(order_sku: out_of_stock_order_sku, price_cents: 100, quantity: 3) end order.order_items << out_of_stock_order_item cents = SwapRequestCreditor.new(id: swap_request.id).credit_amount_cents assert_equal(cents, 300) end end
  337. require 'test_helper' class SwapRequestCreditorTest < ActiveSupport::TestCase fixtures :swap_requests, :basic_orders, :order_items,

    :skus, :order_skus test "#credit_amount_cents sums out of stock sku price" do order = basic_orders(:complete) swap_request = swap_requests(:one) swap_request.update!(order: order, state: SwapRequest::INITIATED) out_of_stock_sku = skus(:one) out_of_stock_sku.update!(in_stock: 0) out_of_stock_order_sku = order_skus(:one).tap { |os| os.update!(sku: out_of_stock_sku, order: order) } out_of_stock_order_item = order_items(:shirt).tap do |oi| oi.update!(order_sku: out_of_stock_order_sku, price_cents: 100, quantity: 3) end order.order_items << out_of_stock_order_item cents = SwapRequestCreditor.new(id: swap_request.id).credit_amount_cents assert_equal(cents, 300) end end
  338. assert_equal(cents, 300)

  339. None
  340. None
  341. None
  342. TCR Lessons Learned

  343. Fast tests

  344. Fast tests Fast tests

  345. Fast tests Fast tests Fast tests

  346. Small moves

  347. Iterative growth

  348. Trust the process

  349. The Oregon Experiment

  350. None
  351. Weird

  352. Wild

  353. Wonderful

  354. None
  355. # TODO:

  356. Books to read

  357. The Oregon Experiment

  358. The Timeless Way of Building

  359. A Pattern Language

  360. Practical Object Oriented Design with Ruby

  361. 99 Bottles of OOP

  362. The Uninhabitable Earth Life After Warming by David Wallace-Wells

  363. Station Eleven by Emily St. John Mandel

  364. Try TCR

  365. Toy project

  366. Fibonacci

  367. Fizz buzz

  368. Production codebase

  369. Make a new branch

  370. Run TCR

  371. Refactor something

  372. Improve tests / coverage

  373. Fix a bug

  374. Add a feature

  375. Make small moves

  376. Go smaller

  377. My offer to you

  378. sidekick

  379. cheerleader

  380. pair buddy

  381. I will pair with you

  382. ~30 minutes

  383. My request of you

  384. Tweet about your TCR experience

  385. @veganstraightedge

  386. What works?

  387. What doesn’t?

  388. What did you learn?

  389. Was it fun?

  390. Will you keep using TCR?

  391. Extra credit bonus!!!

  392. Bash function

  393. IDE integration

  394. IDE integration

  395. Text editor plugin

  396. Text editor plugin

  397. VS Code

  398. Atom

  399. Sublime

  400. TCR CLI Rubygem

  401. *

  402. Shane Becker THANK YOU! @veganstraightedge

  403. None
  404. One more thing…

  405. LIMBO

  406. while(true); do git pull --rebase; git push; done;

  407. Shane Becker THANK YOU! @veganstraightedge

  408. None