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

RubyConf India 2015: Diving in the Unknown depth of a project

RubyConf India 2015: Diving in the Unknown depth of a project

As a developer, diving in a new code base is not uncommon: you've just been hired, you change of project, you want to help an open source project, the open source library your project depends on is buggy, etc. It's like entering in a underwater cave, you don't know the treasures or the monsters you'll find there, neither if the path is treacherous or if it's a true labyrinth where you'll get lost. You can prepare yourself, you can plan your visit, you can equip yourself, you can survive and find the gem you're looking for...

Christophe Philemotte

April 04, 2015
Tweet

More Decks by Christophe Philemotte

Other Decks in Programming

Transcript

  1. Diving in the
    Unknown depth
    of a project
    Andy Spearing © 2009

    View Slide

  2. _toch
    toch
    Hi, I'm
    Christophe

    View Slide

  3. @matylda © 2011
    Intro

    View Slide

  4. @matylda © 2011
    The most
    common
    task

    View Slide

  5. continuous typing

    View Slide

  6. View Slide

  7. but
    continuous reading
    Jono Witts © 2008

    View Slide

  8. Each written line
    is read
    at least 1 time
    Gavin St. Ours © 20013

    View Slide

  9. ● 300 dev days
    ● 14633 LOC
    ● 634595 Changed lines
    ● → 634595 / 14633 ~ 43 changed LOC / LOC

    View Slide

  10. For 1 final line,
    I read at least
    43 lines.

    View Slide

  11. View Slide

  12. How to
    Dive
    into a project
    Stuart Hamilton © 2008

    View Slide

  13. DO NOT
    Wander
    without a plan
    Felix Esteban © 2004

    View Slide

  14. Journey
    Needs
    Plan
    Peter Southwood © 20011

    View Slide

  15. Plan
    1. Goal
    2. Map
    3. Equipment & Dive
    4. Next?
    Peter Southwood © 20011

    View Slide

  16. 1.
    Goal
    Peter Southwood © 20011

    View Slide

  17. ➔ fix a bug
    ➔ implement a feature
    ➔ write some doc
    ➔ style the code
    ➔ refactor a small piece of code
    ➔ simply use it

    View Slide

  18. View Slide

  19. View Slide

  20. ~/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/net/http.rb:878:in `initialize': Connection refused -
    connect(2) (Errno::ECONNREFUSED)
    from ~/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/net/http.rb:878:in `open'
    from ~/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/net/http.rb:878:in `block in connect'
    from ~/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/timeout.rb:52:in `timeout'
    from ~/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/net/http.rb:877:in `connect'
    from ~/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/net/http.rb:862:in `do_start'
    from ~/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/net/http.rb:851:in `start'
    from ~/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/open-uri.rb:313:in `open_http'
    from ~/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/open-uri.rb:708:in `buffer_open'
    from ~/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/open-uri.rb:210:in `block in open_loop'
    from ~/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/open-uri.rb:208:in `catch'
    from ~/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/open-uri.rb:208:in `open_loop'
    from ~/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/open-uri.rb:149:in `open_uri'
    from ~/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/open-uri.rb:688:in `open'
    from ~/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/open-uri.rb:34:in `open'
    from -e:1:in `'

    View Slide

  21. 2.
    Map
    Peter Southwood © 20011

    View Slide

  22. Find the Map
    ➔ Repository URI
    ➔ Project URI
    ➔ Intro Doc: README

    View Slide

  23. Find the Map
    ● https://github.com/ruby/ruby
    ● https://bugs.ruby-lang.org/
    ● https://github.com/ruby/ruby/blob/trunk/
    README.md

    View Slide

  24. Find the Legend

    View Slide

  25. a
    Legend

    View Slide

  26. Find the Legend
    ➔ CONTRIBUTING Guideline

    View Slide

  27. Find the Legend
    ➔ CONTRIBUTING Guideline
    https://github.com/ruby/ruby/blob/trunk/
    CONTRIBUTING.md

    View Slide

  28. Find the Legend
    ➔ CONTRIBUTING Guideline
    https://github.com/ruby/ruby/blob/trunk/
    CONTRIBUTING.md

    View Slide

  29. Find the Legend
    ➔ CONTRIBUTING Guideline
    ➔ Directory Structure

    View Slide

  30. Find the Legend
    ➔ CONTRIBUTING Guideline
    ➔ Directory Structure

    View Slide

  31. Find the Legend
    ➔ CONTRIBUTING Guideline
    ➔ Directory Structure
    ➔ Talk to other contributors, maintainers

    View Slide

  32. Find the Legend
    ➔ CONTRIBUTING Guideline
    ➔ Directory Structure
    ➔ Talk to other contributors, maintainers
    ➔ Participate to the dev meeting

    View Slide

  33. If blocked?
    ➔ ASK!

    View Slide

  34. Boris Dimitrov © 20009
    3.
    Equipment
    & Dive

    View Slide

  35. Get a Toolbelt
    ➔ Pick an Editor

    View Slide

  36. View Slide

  37. Get a Toolbelt
    ➔ Pick an Editor
    ➔ Bundle & Run Tests

    View Slide

  38. Get a Toolbelt
    ➔ Pick an Editor
    ➔ Bundle & Run Tests
    ➔ Others

    View Slide

  39. Get a Toolbelt
    ➔ ST3
    ➔ Apply a Patch & Use it
    ➔ MRI WIKI DeveloperHowto
    ➔ Sign up to Ruby Redmine

    View Slide

  40. Use your Toolbelt
    ➔ Run the App & Use it

    View Slide

  41. View Slide

  42. Use your Toolbelt
    ➔ Run the App & Use it
    ➔ Read & Edit the Code

    View Slide

  43. ➔ Find proxy management into open-uri.rb
    ➔ Understand how OpenURI.open_http works
    ➔ Spot the bug
    ➔ Fix it

    View Slide

  44. View Slide

  45. Use your Toolbelt
    ➔ Run the App & Use it
    ➔ Read & Edit the Code
    ➔ Report a bug
    ➔ Submit a contribution

    View Slide

  46. View Slide

  47. If blocked?
    ➔ ASK!

    View Slide

  48. 4.
    Next?
    Peter Southwood © 20011

    View Slide

  49. How long?
    ➔ Keep it reasonable at first
    ➔ From ½ to 1 day

    View Slide

  50. Find Next Goal
    ➔ Fix a bug
    ➔ Develop a feature
    ➔ Run Static Analysis Tools
    ➔ Review a PullRequest

    View Slide

  51. Iterate
    ➔ :)
    Jean-Marc Kuffer © 2007

    View Slide

  52. If blocked?
    ➔ ASK!

    View Slide

  53. Outro
    1. Goal
    2. Map
    3. Equipment & Dive

    View Slide

  54. ?
    _toch
    toch

    View Slide