Upgrade to Pro — share decks privately, control downloads, hide ads and more …

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.

Shane Becker

April 30, 2019
Tweet

More Decks by Shane Becker

Other Decks in Programming

Transcript

  1. SQL

  2. and

  3. or

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

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

    && git commit -am [TCR] || git reset --hard"
  6. 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…
  7. 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…
  8. 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…
  9. 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…
  10. 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…
  11. Organic Order Planning and construction will be guided by a

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

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

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

    collection of communally adopted planning principles called patterns.
  15. 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.
  16. 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.
  17. TDD

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

    body of code, altering its internal structure without changing its external behavior.
  19. 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
  20. 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
  21. 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
  22. 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
  23. 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
  24. 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
  25. 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
  26. 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
  27. 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
  28. 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
  29. 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
  30. 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
  31. 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
  32. 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
  33. 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
  34. 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
  35. 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
  36. *