Your SlideShare is downloading. ×
0
Only You Can Prevent Cthulhu
Only You Can Prevent Cthulhu
Only You Can Prevent Cthulhu
Only You Can Prevent Cthulhu
Only You Can Prevent Cthulhu
Only You Can Prevent Cthulhu
Only You Can Prevent Cthulhu
Only You Can Prevent Cthulhu
Only You Can Prevent Cthulhu
Only You Can Prevent Cthulhu
Only You Can Prevent Cthulhu
Only You Can Prevent Cthulhu
Only You Can Prevent Cthulhu
Only You Can Prevent Cthulhu
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Only You Can Prevent Cthulhu

589

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
589
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
1
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Only you can prevent Cthulhu How finding a bug in BioRuby fixed a bug in Rails Andrew Grimm, University of New South Wales
  • 2. Bite me once...
    • Tried running my work project under JRuby
      • Result: BioRuby DO NOT LIKE
    • Googled whether anyone else had tried doing this. No-one had, but core reckoned it ought to work
    • 3. Conclusions at the time:
      • Notify them of the issue
      • 4. Stop experimenting with other implementations, stick with MRI/YARV
  • 5. Bite me twice...
    • Next week, tried RubyInstaller on Windows
      • Result: BioRuby DO NOT LIKE
    • This time it needed fixing!
    • 6. Culprit: trying to determine OS by parsing RUBY_PLATFORM, rather than using rbconfig's Config::CONFIG["host_os"]
  • 7. Summoning Cthulhu
  • 8. How did Rails handle it?
    • Couldn't find ideal test for ability to fork (e.g. telling if JRuby has fork enabled)
    • 9. May as well see how Rails handles it
      • 949 forkers and 5606 watchers can't be wrong!
      • 10. Rails summons Cthulhu too?
  • 11. Pick a bug. Any bug
    • Couldn't understand why they still used RUBY_PLATFORM
    • 12. Decided to test one of the uses of RUBY_PLATFORM and see if it produced a bug
    • 13. It did – duplicate of #3999
  • 14. So Easy a Caveman Can Do It
    • Here's the bug
    • 15. Here's the offending code
    • 16. Here's a link showing what to do
    • 17. If you know require , you could fix it
    • 18. No-one did for 2 months
  • 19. Lessons learnt
    • It's ok to extensively test code
    • 20. Select can be broken
    • 21. Check for duplicates before filing
    • 22. Don't forget to put your name and email in git
    • 23. Only you can prevent Cthulhu!
  • 24. It's ok to extensively test code
    • You're not being unreasonable in testing code in JRuby
  • 25. Select can be broken
    • “Select isn't broken” (SIB) suggests that if there's a bug either in heavily-used code third-party code, and code you've just written, consider the possibility that it's the latter
    • 26. Rails can't possibly have a bug?
      • It can. It has 800 tickets. (Hat tip: Ryan Bigg)
    • SIB applies less if the code can't be unit tested, only manifests under certain circumstances, and isn't used much
  • 27. Check for duplicates before filing
    • I assumed the bug was so simple that if it had been noticed before, it would have been fixed
    • 28. Check for duplicates before filing
    • 29. Check for duplicates before filing
    • 30. Check for duplicates before filing
    • 31. Check for duplicates before filing
    • 32. Check for duplicates before filing
  • 33. Don't forget username and email
    • With people named “Avdi Grimm” and “Andrew Grim”, agrimm@unknown is unhelpful for a commit
    • 34. Happened because I was on a rarely-used partition
  • 35. Only you can prevent Cthulhu!
    • My bug fix inspired someone else to remove use of RUBY_PLATFORM for determining OS from Rails entirely
  • 36. Best way to test something: use it?
    • I've heard people complain that ruby core don't test whether their changes break Rails
      • Should Rails developers do that?
    • I've heard Rails users complain that changes to Rails breaks their code
      • Should Rails users run their code's tests against new versions of Rails?

×