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

Bugs - What are they good for

Bugs - What are they good for

84cd9fd20832381fc78084aac4cb4b6c?s=128

Leif Gensert

December 05, 2019
Tweet

Transcript

  1. 1 Bugs What are they good for?

  2. None
  3. What is a bug?

  4. “First actual case of bug being found” Grace Hopper -

    1947
  5. “I did find a bug in my apparatus” Thomas Edison

    - 1878
  6. The Crash <> Request Scale Crash Change Request ⚠

  7. Let’s ship some products

  8. Numbers only?

  9. Nope

  10. “You didn’t say you wanted to ship stuff to the

    Queen”
  11. “Well you should know how addresses work”

  12. The Crash <> Request Scale Crash Change Request ⚠

  13. Record Investigate Fix

  14. None
  15. Reproduce It Fix It Ship It

  16. Find a reproducible scenario

  17. Speeds up fixing process

  18. accepted Closed Won

  19. paid Closed Lost

  20. context 'accepted order' do let(:order) { build(:order, status: 'accepted') }

    it 'returns "closed won"' do expect(deal_stage(order)).to eq('closed won') end end context 'paid order' do let(:order) { build(:order, status: 'paid') } it 'returns "closed won"' do expect(deal_stage(order)).to eq('closed won') end end
  21. def deal_stage(order) return 'enquired' if order.nil? return 'quoted' if order.open?

    return 'closed won' if order.accepted? 'closed lost' end
  22. Lets you try out different solutions

  23. Makes it clear what to fix

  24. NoMethodError: undefined method `date’ for nil:NilClass

  25. def render(order) { id: order.id, delivery_date: order.delivery.date } end

  26. def render(order) { id: order.id, delivery_date: order.delivery&.date } end

  27. GET /api/v1/orders?status=delivered • Order 01 • Order 02 • Order

    03
  28. Confidence that bug has been fixed

  29. Continuous Integration Heroku Review Apps Create App Precompile Assets Create/Migrate

    Database Launch App Code
  30. But what about actually fixing the bugs?

  31. def deal_stage(order) puts "What's happening?: #{order.inspect}" return 'enquired' if order.nil?

    puts "What's happening?: #{order.inspect}" return 'quoted' if order.open? puts "What's happening?: #{order.inspect}" return 'closed won' if order.accepted? puts "What's happening?: #{order.inspect}" 'closed lost' end Puts Debugging
  32. github.com/pry/pry def deal_stage(order) binding.pry return 'enquired' if order.nil? return 'quoted'

    if order.open? return 'closed won' if order.accepted? 'closed lost' end
  33. Is it really the culprit? Caching Third Party Libraries Recent

    Changes User
  34. Push Continuous Integration Deploy Revert Continuous Integration

  35. Record Investigate Fix Now Depends on Urgency/Impact

  36. My Latest Bug

  37. None
  38. None
  39. None
  40. None
  41. Reproduce It Don’t jump to conclusions