Fog Creek Software
Discussion Board




Daily Builds, lint, and the web

Does anybody know of a good tool for doing the equivalent of "daily builds" for web pages? Whether it be for php, perl, asp, ruby, python, etc....(and no, I don't mean xcopy /e)

Ideally, there would be a lint like tool or a compile tool for the website to verify the existance of relative file references. One thing that a web environment lacks is the compile-link stage of most modern environments (a-la C++, Delphi, etc..), and I'd like to get the early warnings - because build and smoke tests are rarely useful when you're dealing with web pages.

thx!

James Wann
Friday, February 22, 2002

Hehe...

Segmentation fault, core dumped...
Access violation in 'main.html': cannot READ page at 'indax.html'

But yeah, sounds like a good idea =).

Dan Maas
Saturday, February 23, 2002

In interpreted web environments (perl, php, asp) all errors are runtime errors.  It's frustrating to have to run the application to see if you've missed a semicolon, but I haven't found a good solution to that.

Maybe a solution would be to build a custom script which includes all the other files (to check for parse errors) but takes no other action.  That would give you something similar to a compile/link step.

Wayne Venables
Saturday, February 23, 2002

Well, of course ASP.NET web applications have a build step (and the same build/source code control processes as any other Visual Studio .NET application). But that doesn't help in the more general case, and I don't think the compiler is looking for HTML errors in any case.

Mike Gunderloy
Saturday, February 23, 2002

Perl isn't really interpreted, it's compiled into byte code at run-time, and then the byte code is interpreted. So it's easy to test for compilation errors by just trying to run the script.

You can also test for compilation errors by typing "perl -c cgiscript.pl".

It wouldn't be too hard to write a script that would go through a folder of perl scripts and build a report if there were any compilation errors.

Matthew Lock
Sunday, February 24, 2002

If you use java most app servers have an option to pre compile the JSPs.

Daniel Shchyokin
Sunday, February 24, 2002

Spider the site.  It will alert of of broken links, missing images, and HTML errors.

Adam
Monday, February 25, 2002

Also, Use something like Http Unit to do unit/functional tests. You can do this with PERL quite easily as well.  There are links on Junit.org fo Unit test suites (Or XPrgramming.com )

Adam
Monday, February 25, 2002

Adam:

I've considering spidering the site, but a large part of the functionality is database oriented with click tracking and interactivity in links that spidering would require me to re-scrub the database against the logfiles, which is something I don't enjoy doing.

Also, to those who have posted with "xxx language with xxx platform compiles", I don't have a problem with that. But when you are moving to a large number of modules - in different languages, (Unless you REALLY want 1 big perl or jsp script running the entire site), you'll need to validate the simple existance of the other scripts.

I'm tempted to just write a pattern matching script that'll find all the link related code in each language, and then validate them against the filesystem.

James Wann
Monday, February 25, 2002

You should always design and build to test. 

If spidering is the most reasonable way to test (and it generally appears to be for this kind of thing), then build that into the system.  Only spider from one IP or range of IPs, and have the click tracking and db interactivity not record actions from those test addresses, or record them in some other way.

If you can't test something reliably, it's broken, plain and simple.  Build the ability to test into everything you do, and you'll have more reliable software.  Most web sites (and I've been there, believe me) don't do this, usually because the people involved aren't experienced enough to know to do this, or because they think it's too hard to do, or because they think they haven't got the time to do it.  Take the time now, take 10x the time later, or have software that's always broken.

James Montebello
Tuesday, February 26, 2002

*  Recent Topics

*  Fog Creek Home