The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
Call graphs to analyze code dependencies, or just because.

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Eigen Class

Posts: 358
Nickname: eigenclass
Registered: Oct, 2005

Eigenclass is a hardcore Ruby blog.
Call graphs to analyze code dependencies, or just because. Posted: Mar 14, 2006 9:33 AM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Eigen Class.
Original Post: Call graphs to analyze code dependencies, or just because.
Feed Title: Eigenclass
Feed URL: http://feeds.feedburner.com/eigenclass
Feed Description: Ruby stuff --- trying to stay away from triviality.
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Eigen Class
Latest Posts From Eigenclass

Advertisement

Here's one of the intermediate results on the path to extending the rcov code coverage tool for Ruby: recording call graph information, so we can analyze the dependencies between our modules. The following figure is quite expressive:

sample-call-graph.png

The diagram tells at once what's happening below:

class Bar
  def foo
    1+1
  end

  def bar(x)
    10.times{|i| x.bar(i) }
  end
end

class Test
  def initialize
    @bar = Bar.new
  end

  def test
    a = 1
    b = 2
  
    @bar.foo
  end

  def test2
    @bar.bar(self)
  end

  def bar(x)
    if x > 5
      @bar.foo
    else
      test
    end
  end
end

t = Test.new
t.test
t.test2

Recording the call graph


Read more...

Read: Call graphs to analyze code dependencies, or just because.

Topic: Distinguishing power from versatility Previous Topic   Next Topic Topic: Vienna V: Donau City

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use