[TIP] [pytesting] How to begin

Kumar McMillan kumar.mcmillan at gmail.com
Wed Feb 28 11:45:15 PST 2007


since you're in the early stages, I would suggest to explore your
interface before you start testing.  If you have a few features
already, consider how you test those manually (open the app, select NN
from menu, drag in object NN, or whetever you are doing currently).
Then start converting that manual process to an automated
process---these become your functional tests.  Once you have an idea
for what internal objects are needed for your application you can also
add unit tests for those so that you know they are working at the
lowest level.  That would be my approach anyway.  Then again I've
never tried to test a desktop app ;)

k

btw that qunittest link didn't work for me.  google said:
http://freshmeat.net/projects/qunittest/

On 2/28/07, Grig Gheorghiu <grig at gheorghiu.net> wrote:
> --- simon stockes <simonstockes at gmail.com> wrote:
>
> > I want to start my new project in using unittest methodology.
> > My software will be a desktop application using PyQt.
>
> OK, first off, here are some PyQt-related testing tools:
>
> qunittest:
>
> http://projects.edgewall.com/qunittest/
>
> pyGuiUnit:
>
> http://sourceforge.net/projects/pyguiunit/
>
> (these and many more are categorized on the Python Testing Tools
> Taxonomy wiki at
> <http://pycheesecake.org/wiki/PythonTestingToolsTaxonomy>)
>
> >
> > To do it I would like to know certains things:
> > Should I write a test for each method or function i will write ?
>
> That would be your best bet. That's what unit testing is all about. But
> you shouldn't stop there; you need to write functional and system
> integration tests too, that exercise multiple paths through your
> application. Basically you need to look at your application both from
> the inside out (unit testing) and from the outside in
> (functional/system/integration testing).
>
>
> >
> > How to organize the tests in the software architecture ?
>
> See above. Another important thing to remember is that once you have
> automated tests of any kind, you need to set up a continuous
> integration system (such as buildbot) that runs your tests
> periodically, using the very latest version of your source code, and
> that notifies you on failures.
>
>
> >
> > Is there better unittest modules than others ?
>
> You can use either nose or py.test.
>
> nose:
>
> http://somethingaboutorange.com/mrl/projects/nose/
>
> py.test:
>
> http://codespeak.net/py/current/doc/test.html
>
> Titus spoke quite extensively about nose in our tutorial at Pycon.
>
> Here are some more links worth checking out:
>
> http://code.google.com/p/python-nose/wiki/RecentArticles
>
> Grig
>
> _______________________________________________
> testing-in-python mailing list
> testing-in-python at lists.idyll.org
> http://lists.idyll.org/listinfo/testing-in-python
>



More information about the testing-in-python mailing list