Search the web
Sign In
New User? Sign Up
a-a-p-dev · A-A-P project development list (closed)
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want your group to be featured on the Yahoo! Groups website? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Montly overview A-A-P June 2002   Message List  
Reply | Forward Message #14 of 43 |
Re: [a-a-p-dev] Montly overview A-A-P June 2002

> > > Furthermore, I have added a mechanism for testing. Both for testing
> > > individual modules and executing recipes. The typeless nature of Python
> > > requires doing a lot of tests. Only a few have been added so far, but
> > > one bug has already been detected.

I'd highly recommend implementing a testing discipline in your process
up front. On SCons, we have a policy (adopted from and enforced by
Aegis) that every checkin must be accompanied by one or more new or
changed tests that demonstrate the bug or feature by failing on the old
code base. By building up our tests incrementally, we now have a very
complete set of unit tests for our modules, and a regression test suite
of 163 end-to-end tests.

I've found this way of working to be especially crucial during the early
stages of development, when you may need to refactor parts of the design
frequently as you add features. Being able to do this and *know* you
haven't broken anything because all of the tests pass (a la eXtreme
Programming) is invaluable.

> > Isn't the typeless nature of python a problem when you try to build
> > good solid code? I don't like the Java - we do the checks runtime and
> > generate an exception when something goes wrong - attitude. You can't
> > have a 100% test coverage. I like the C++ way - strong typechecking,
> > we don't want to loose performance runtime - better. Do you need
> > lint-like tools to overcome the typeless nature of Python, or is your
> > code 80% error recovery, 20% functionality?
>
> It's true that Python leaves most of the testing to the user. The
> largest potential problem I see is using a function that wasn't imported
> and passing a variable of the wrong type to a function. This can only
> be checked with a large set of tests. Mostly written with one eye on
> the code and making sure each line is used at least once in a test.

Python will throw an exception if you try to use a function that hasn't
been imported. It won't throw an exception just because you pass a
variable of the wrong type, but it will if/when you try to use that
variable inappropriately.

In practice, we've found that the ongoing challenge is to not just rely
on generic exception-handling, which is great for programmer debugging,
but to catch exceptions at all of the appropriate points and provide
error messages more helpful for less sophisticated end-users.

> Perhaps some kind of Python-lint exists, I haven't looked for it yet.

Look for PyChecker, available on SourceForge. It finds a number of
problems in Python code by performing analysis on the compiled byte
code.

--SK




Mon Jul 1, 2002 7:02 pm

knight@...
Send Email Send Email

Forward
Message #14 of 43 |
Expand Messages Author Sort by Date

In June the recipe executive module was further enhanced. Quite a few tough issues have been dealth with. The choice for mixing Makefile and Python syntax...
Bram Moolenaar
vimboss
Offline Send Email
Jul 1, 2002
8:43 am

On Mon, 1 Jul 2002, Bram Moolenaar wrote: Thanks for this update. ... Isn't the typeless nature of python a problem when you try to build good solid code? I...
Aschwin Marsman - aYn...
marvinmarsman
Offline Send Email
Jul 1, 2002
4:24 pm

... It's true that Python leaves most of the testing to the user. The largest potential problem I see is using a function that wasn't imported and passing a...
Bram Moolenaar
vimboss
Offline Send Email
Jul 1, 2002
5:49 pm

... I'd highly recommend implementing a testing discipline in your process up front. On SCons, we have a policy (adopted from and enforced by Aegis) that...
Steven Knight
knight@...
Send Email
Jul 1, 2002
7:00 pm

... Although I agree with doing a lot of testing, A-A-P is still in a phase where the design is more important than correct code. The main goal currently is...
Bram Moolenaar
vimboss
Offline Send Email
Jul 1, 2002
7:13 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help