GSoC/GCI Archive
Google Code-in 2012 KDE

Trojitá: Unit tests for the Sender Identities Model

completed by: Andromeda Galaxy

mentors: Jan Kundrát

Developing exciting new features is only part of the day-to-day tasks of a software developer. In real world, making sure that the code does not break suddenly when fixing an unrelated part of the program is just as hard and even more important.

Most people believe that the unit tests are boring stuff coded by monkeys while adding new features is exciting work which only Real Programmers (tm) can do. In this task, I will try to persuade you that writing test cases is challenging and difficult, too.

Scope of work

Start thinking as an attacker -- what you have in front of you is some code and your only task is to find out how it can possibly break down. Is the code you're testing checking for all range conditions? Can you trick it to divide by zero, access an element at offset -1 or maybe draw a rectangle with negative width? Can you make the list contain duplicates of the same item just by trying to reshuffle it?

When you have identified the possible issues that the code might have, it's time to write the test case, a code which checks that the code actually behaves. When the test is written, we can make it a part of the automated test suite -- that way, the computer will remember to always check these corner cases for us.

Required skills

Qt and C++ knowledge is a must,  familiarity with the Qt's model classes (QAbstractItemModel and its contraints) is a big plus.

Contact details

#trojita on irc.freenode.net or jkt@flaska.net e-mail.