Hi Aurelien,

On Mon, Oct 25, 2010 at 11:51 AM, Aurelien Degremont
<aurelien.degrem...@cea.fr> wrote:
> Hello
>
> I want to give you some of my best advises I can for any Python development.
> The most important element I discovered since I'm developing in Python are 
> the following 3 tools.
Thanks :)
>
>  - unittest
>  - coverage
>  - pylint
>
> This 3 tools used together can help a lot into increasing Python code quality 
> and avoid bugs.
>
> . unittest
>
> Write unit tests, this is really important to test every piece of your code 
> is working as expected and no regression are
> introduced.
Yes, we use it in the test/ directory. Not all the code is tested like
that, but quite a huge part (and all new code is done by TDD, with
tests firsts, thansk to Gerhard :) ).

>
> . coverage
>
> http://nedbatchelder.com/code/coverage/
> http://pypi.python.org/pypi/coverage/
>
> When you have unit tests, it is really interesting to use them with Coverage. 
> This is a python tool that will compute
> the code coverage of those tests and tell you which line of your sources are 
> not tested by them.
> This is really the unittest best friend.
Oh we don't use this one, this can be useful to see what we do not
test from now. Thanks! :)

>
> . pylint
>
> Pylint si code checker developed by french team Logilab. It is checking a lot 
> (a lot!) of things on your Python code. It
> can detect bugs without running the code. It checks the PEP8 conformity which 
> is important IMHO for any Python
> collaboration. And a lot more. It is highly configurable, and I strongly 
> advise any python developer to try to run it on
> its code.
I passed some pylint passes some months ago, and with a good
configuration it even solve bugs! (it make me saw some = instead of ==
bugs before we use TDD...). But with a standard conf, it warn about
properties used but not created in the __init__ but it's normal with
the properties dict. It also warn about 80+ lines (lot for again the
properties dict... :p ). But we'll pass a big pylint in the code
before the next release, thanks to remember this tool :)

>
>
> Hoping this can help Shinken.
Oh yes, the coverage will help us to spot what is not fully tested (I
think the pyro part because it's not easy with unit tests... :( ).


Jean
>
>
> Aurelien
>
> ------------------------------------------------------------------------------
> Nokia and AT&T present the 2010 Calling All Innovators-North America contest
> Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
> $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
> Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
> http://p.sf.net/sfu/nokia-dev2dev
> _______________________________________________
> Shinken-devel mailing list
> Shinken-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/shinken-devel
>

------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
Shinken-devel mailing list
Shinken-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/shinken-devel

Reply via email to