On 2002.05.14, Dennis Newbold <dennisn / pe.net> wrote:
> On Mon, 13 May 2002, Dossy wrote:
> > 
> > Unit testing?
> > 
> Well, its a great idea.  In point of fact, I do unit test my code.
> [...] Point is, that unit testing and static analysis are not mutually
> exclusive, but complementary.  And, as a fallible human software
> engineer, I can use all the help I can get.

How can you perform static analysis on a language like Ruby
where life is all about message passing?

I'd suggest a better tool would be a brute-force dynamic
analysis tool, something that ran the program and tried to
fully exercise it by sending it all sorts of messages at
runtime ...

But, I don't know how useful this would be.  Probably not
very useful -- hand-written unit tests would be much more
effective in much less time.

It'd be nice to see a static analysis tool for Ruby, but
given the nature of the language, I don't think it's possible
to write one that'll be worth anything.  In other words:
even as a fallible human being, who very rarely even writes
bugs in test code, I can't think of a single defect that
a static analysis tool for Ruby would find that even the
simplest of my unit tests wouldn't uncover first.

But, I'd _love_ to be proven wrong.  I'd _love_ a static
analysis tool that was worth using for Ruby.  As you say,
static analysis and unit testing are complementary.  I'm
just not going to hold my breath ...

Thanks for the interesting thought for the day!  Maybe
I'll actually think of some way of doing static analysis
that's useful ... that'd be incredible!

-- Dossy

-- 
Dossy Shiobara                       mail: dossy / panoptic.com 
Panoptic Computer Network             web: http://www.panoptic.com/ 
  "He realized the fastest way to change is to laugh at your own
    folly -- then you can let go and quickly move on." (p. 70)