durusmail: quixote-users: debugging
debugging
2001-10-29
2001-10-29
2001-10-29
2001-10-29
debugging
Andrew Kuchling
2001-10-29
On Mon, Oct 29, 2001 at 02:48:12PM -0500, Greg Ward wrote:
>Have you tried setting DEBUG_LOG and sprinkling print statements into
>your app?  It's crude and primitive, but it works.

Agreed.  Inserting print statements and putting Quixote in RUN_ONCE
mode is generally how I debug Quixote code.  That works nicely when
sessions are fully persistent so you don't lose anything (except a bit
of speed) by restarting the Quixote process all the time.

>Definitely!  Neil cooked up something like that many moons ago, but it
>never really went beyond prototype.  I also don't think it's that useful

We'd love to have a way of regression-testing our Web site, but it's
difficult to see how that would work.  It should be possible to write
unit tests for simple little PTL functions, no different from how
you'd test a regular Python function.  It's also easy to automatically
hit a bunch of URLs that should work and verify that they don't return
a 5xx HTTP response.

Beyond that, it gets hard to do anything higher-level.  You could save
the output from each URL and compare them to notice any differences.
The Python test suite mostly works like this, but it can sometimes be
difficult to spot whether a change is a problem or not.  With a Web
application, where you're often tweaking a bit of HTML and therefore
modifying a great many pages, the diffing approach doesn't seem like a
large step above just checking that URLs work.

Neil tried an approach of recording the URLs and form data from a Web
browsing session and replaying them, but we don't really use that code
very much.  Again, it's brittle in the face of changes to the forms;
add or remove a field and you'd have to re-record the test suite.

(On the bright side, the Web is no worse than any other GUI
application in this respect.)

--amk


reply