Deletion Driven Development: Code to delete code!
summary
Builds a static analyzer that parses Ruby with RubyParser (racc) into s-expressions, walks them with a SexpProcessor-derived visitor, records method definitions and calls, and reports potentially dead methods; handles edge cases like send/public_send, attr_accessor and attribute-assignment nodes, adds Rails-DSL hooks, and counts single-call methods. The result is the Debride-style tool used on ManageIQ that finds deletions reliably but requires manual verification and more edge-case handling.
AI-written summary · about
chapters (12)
- 0:00Start
- 5:47Part One Parsing the Code
- 6:34Context-Free Grammar
- 11:10Ruby Parser
- 13:24Main Method
- 15:43Method Tracking Processor
- 17:29Helpers
- 18:43Part Three Building the Dead Method Finder
- 24:09Adding Edge Cases
- 24:50Rails Methods
- 29:59Old Code Finder
- 30:42Parting Message
related talks
51mForbidden Fruit: A Test of Ruby's Parse Tree
50mLaser: Static Analysis for Ruby, in Ruby
32mSAST and Sensibility: A Rubyist’s Guide to Static...
36mA Static Type Analyzer of Untyped Ruby Code for Ruby 3
32mParsing Ruby
11mBeware the Dreaded Dead End!!
39mIDE development with Ruby
29mAnalyzing an analyzer - A dive into how RuboCop works
