Re: "static" checking
From: Peter Hansen (peter_at_engcorp.com)
Date: 01/29/04
- Next message: Peter Hansen: "Re: Python & XML & DTD (warning: noob attack!)"
- Previous message: Eric Brunel: "Re: Rookie question about data types (hashtables)"
- In reply to: Moosebumps: ""static" checking"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 29 Jan 2004 09:41:14 -0500
Moosebumps wrote:
>
> I'm wondering what kind of checking I can do on a python program before
> running it (besides reading over every line). I hate running a long python
> script, only to have it fail at the end because I misspelled a function
> name, or made some other silly mistake that a compiler would normally catch.
> Then I have to run it all over again to see what happened or come up with
> some sort of short test.
>
> I usually do try to isolate the new parts of my code, and run them first
> with some dummy data that will run fast. But that is not always possible
> because of dependencies, and it would be nice to have some sort of sanity
> check up front.
These issues largely go away once you start doing test-driven development.
See, for example, Mark Pilgrim's excellent introduction in his book at
http://www.diveintopython.org/ (see the link under "unit testing"), or
Kent Beck's paper book "Test-Driven Development" (published by Addison Wesley).
With this approach, your code generally won't have those dependencies
(sometimes the approach has to be tried before someone can really believe
that, but it's true) and you find your spelling mistakes, and many other
problems that static checking can't find, in seconds without no more
effort than it takes to run a batch file.
-Peter
- Next message: Peter Hansen: "Re: Python & XML & DTD (warning: noob attack!)"
- Previous message: Eric Brunel: "Re: Rookie question about data types (hashtables)"
- In reply to: Moosebumps: ""static" checking"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|