Looks like a cool QA tool, I'll check it out. Thanks. Harry
----- Original Message ----- From: "Tyler MacDonald" <[EMAIL PROTECTED]> To: "Harry Zhu" <[EMAIL PROTECTED]> Cc: <modperl@perl.apache.org> Sent: Wednesday, February 22, 2006 3:50 PM Subject: Re: find all uninitialized variables? > Harry Zhu <[EMAIL PROTECTED]> wrote: > > Say I have a file directory with hundreds of modules, I want to know if > > there is a tool I can scan and identify the uninitalized variables in all > > the files once (or through a loop) without actually running through all the > > pages. > > If you don't want to run through all the pages and possibilites > yourself, I reccommend selenium: > > http://www.openqa.org/selenium/ > > That will allow you to create test suites that run in your browser > that go through every page and try to do things on it. Then you can check > your error logs and, if your test does everything a regular user possibly > could, you'll have a list of all your uninitialized variables, as well as > possibly turning up some bugs you hadn't tested for before. > > There's no easy way to do tell whether or not a variable is going to > be used throughout the course of a webpage, except watching the warnings and > running every single code path that web page has (logged in, not logged in, > filled out this form element before hitting "submit", didn't, etc.) > > You might be able to do detect global variables that aren't used by > a package, but nowadays over 90% of variables are local (my) variables, and > still... What if the variable isn't initialized in one module, because > another module initializes it? > > Devel::Cover can help to see if you're running every single code > path possible in the code you care about; Devel::Trace and Devel::Profile > can help to see exactly what code you're actually running and when. > > If you just want to get rid of the warnings and don't care whether > or not the module is using it's variables cleanly, you can add the line > > no warnings 'uninitalized'; > > to each module that you're being annoyed by. > > - Tyler > > >