Running Unit Tests

Bart Cerneels bart.cerneels at kde.org
Wed Aug 5 10:35:57 CEST 2009


On Wed, Aug 5, 2009 at 10:24, Sven Krohlas<sven at asbest-online.de> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> HI,
>
>> What if I want to run a regression test on something without normal
>> amarok functions interfering? Take the playlist or collection-managers
>> for instance. These will behave differently when devices are plugged
>> in, services enabled, ...
>
> - From an academic point of view this goes beyond the scope of unit testing.
> Unit tests should test the smallest available components, so in a perfect
> world they should be independent from each other.
> One step upwards there are integrational tests which check several units
> as a group to see if they work well correctly together. From what I know
> those are usually still performed manually.
> But if there is a way to run them automatically we should try that too, of
> course. For example DirectoryLoader: I can tell it to load some files but
> will never get info in return, so from the academic pov I can't do unit
> testing. But the result is available in the Playlist, so checking there is
> possible in an automated way.
>
> But for that I think we have to look at it from case to case and I don't
> know the classes you are worried about (yet). That sounds even a bit like
> system testing, which is the next level after the integrational tests and
> takes the system as a whole into account.
> - --

I think I didn't make myself clear enough. I want to do unit testing
of PlaylistManager: adding a provider with certain playlists. Query PM
later and see if those playlists are there, trying to delete from a
non-writable provider, etc.

But since PlaylistManager is being used while initializing it will
never be in a known state when tested within amarok. So we can not do
unit testing except external to amarok-app.


More information about the Amarok-devel mailing list