On Sun, 31 Oct 2004, Robert Feldt wrote:

> John Carter wrote:
>
>> On Wed, 27 Oct 2004, gabriele renzi wrote:
>> 
>>> (http://www.pronovomundo.com/htu/theses2004/checkr_olofsson_thesis_final_040521.pdf) 
>> 
>> 
>> 
>> I take part of what I said back. There is one idea in that thesis that
>> would be pretty useful and very easy to do.
>> 
> Only one; maybe I should rethink the approval then... ;)

Only one that was useful _and_ very easy. There were many others in the not easy basket.

> I truly think there is some power in having a static analyser also for Ruby, 
> but after taking the "low-hanging" fruits (like the one you mention and is 
> talked about in the thesis) you need some kind of intelligence / 
> pattern-matching to find other bugs. I hope to attract another student to go 
> deeper/further...

Hmm. The next highest source of bugs in Ruby programs is getting
Regexes wrong.

I have one RCR in on that subject already...
   http://rcrchive.net/rcr/show/179


There after I really think you are into annotated checking like
splint. Yuck.

As I said, most of the bugs left in Ruby programs are functional in
nature. You need a "ruby-lint --read-my-mind myprog.rb"

Perhaps the most bang for analysis buck could be obtained from...
   1) Propagating duck typing constraints up the call tree.
   2) Static analysis of Design by Contract assertions. DbC being
      closest to formally stating what is on your mind.

For example allowing the programmer to insert some structured form of
Design by Contract style pre and post condition assertions and
attempting to statically check them.

Also allow the programmer to declare, in a structured manner, an
invariant, and attempt to statically check that it is valid after
construction, and before and after every public: method.

The nice thing is you can afford to really sloppy and heuristic about
it. To be valuable your checker need only find _any_ single case where
the contract _is_ violated. It needn't even try find every case.



John Carter                             Phone : (64)(3) 358 6639
Tait Electronics                        Fax   : (64)(3) 359 4632
PO Box 1645 Christchurch                Email : john.carter / tait.co.nz
New Zealand

The universe is absolutely plastered with the dashed lines exactly one
space long.