GNOME Bugzilla – Bug 396804
Write unit tests
Last modified: 2009-05-14 14:06:14 UTC
Currently PiTiVi is missing unit tests, we need those to be sure we don't introduce regressions and that all features work as expected.
I'd like to help with this, but I need a lot more information
I think the easiest way to implement unit testing would be to use the python unittest module. I just added an option to pitivi to be run without UI since a lot can be tested without having the UI. In fact we NEED to be able to do a lot of testing on the non-UI part of PiTiVi. I think a first bunch of tests could be written to test the behaviour of the timeline model. Some random ideas: * Adding sources : test all the available Composition methods for adding/inserting/pre-pending a source and see if the values after that are correct (was it properly added ? at the right place ? were the neighbours properly moved if needed ?...) * Removing sources : test the removal of sources from a composition and check whether it was removed, were neighbours properly moved if requested ,... * Moving sources : test all available methods for moving around sources and check if they were moved to the correct place, their start position was properly changed, the neighbours were properly moved if requested, ... Then maybe we could start writing some unit tests for the expected behaviour when adding/removing/moving effects and transitions. We don't need to enable them at first, but it would help when writing the needed code later on.
The unit test framework is now in svn: 2007-03-27 Edward Hervey <edward@fluendo.com> * pitivi/pitivi.py: Separate the gtk mainloop handling outside of the Pitivi class. This allows not forcing the use of a gobject MainLoop when using PiTiVi. * Makefile.am: * configure.ac: * tests/: * tests/Makefile.am: * tests/runtests.py: * tests/test_basic.py: Added unit-test system. First provided test tests that pitivi gets properly created and destroyed, nothing fancy. This should lead the way to a whole bunch of unit-tests. Ideally we should have one unit test per relevant code file.
Ideally, it should be possible to write unittests without having a pitivi instance. I'm thinking in particular to all the timeline/composition tests, those should be possible by creating a Timeline object and working on that.
There's already a nice bunch of unit tests now, I'm closing this bug