GSoC: Unit testing with QtScript

Sven Krohlas sven at asbest-online.de
Tue Mar 17 19:43:25 UTC 2009


Heya,

as i'm also interested in this one: here's my current draft for

http://techbase.kde.org/index.php?title=Projects/Summer_of_Code/2009/Ideas#Project:_Code_regression_test_suite.2C_implemented_with_QtScript


==Main Script==
One of the main ideas is to implement as much as possible using
QtScript. So my main concept is to create a control-script, which
has a nice GUI to

* list all available tests, sorted by some kind of category
  (like playlist, collection, etc), maybe with tested Classes.
* let you run all of them/single ones
* give you infos about past/expected test results
* give an overview of the current test result and details on
  failed ones

I also found:
http://apps.sourceforge.net/mediawiki/cppunit/index.php?title=QtTestRunner

which seems to have this nice gui, but I still have to investigate
weather QtTestRunner (a part of CppUnit) could be used for this
project directly. At least it's gui can be an inspiration. :)


==Test data==
Some test data will be needed to perform tests. There are two choices:

* creating static test data (comparable between different testers)
* use the tester's collection (more dynamic tests)

Tests should work with both approaches.


==Tests==
All tests should be small, verifyable, single scripts, called by
the main one.
Apart from doing correctness tests they could also measure execution
time to be able to detect performance regressions.


==Limits and Requirements==
The script API currently does not allow to test all of Amarok. So
part of this project would be to enhance the scripting API with
the needed functions, for example to manipulate the playlist queue.

BUT:
All functions exported will also be used by other script authors
sooner or later. And so weould need to be supported. So I propose
only to export those that might be needed by script developers.

For other parts that have to be tested C++ tests would have to be
implemented. The test classes themselves could be nicely integrated
into the gui by making them scriptable or by using the CppUnit framework.


==Timeline==
April 20: (start) (13 weeks)
* main script (1 week)
* first sample tests and test data (1 week)
* tests based on existing scripting interface (4 weeks)
* tests based on enhanced scripting interface (4 weeks)
* collection scanner tests (3 weeks)

July 6: (mid-term evaluations) (5 weeks)
* more tests in c++

August 10: (final evaluations)


==About me==
Name: Sven Krohlas, I'm a 26 years old computer science student from
Karlsruhe, Germany. I'm the author of the Free Music Charts script
(http://www.kde-apps.org/content/show.php?content=91484) for Amarok 2.

I have basic knowledge in C++ and the Amarok sources and want to bring
that knowledge to the next level by working on a bigger project. :)

Oh, and although I'm from Europe I don't have any lectures in the summer,
as I already heard all the ones I need for my next exams.

cu
-- 
Darkerradio Free Music Charts:
http://www.darkerradio.com/news/free-music-charts-februar-2009/



More information about the Amarok mailing list