Warning, /office/calligra/sheets/doc/UnitTests.dox is written in an unsupported language. File is not indexed.

0001 /**
0002 \page tests Unit tests
0003 \author Ariya Hidayat (<a href="mailto:ariya@kde.org">ariya@kde.org</a>)
0004 \date 2004
0005 
0006 \par Status:
0007     NEEDS UPDATE (QTestLib)
0008 
0009 <p>Relevant mailing-list threads:</p>
0010 <ul>
0011 <li><a href="http://lists.kde.org/?l=kde-cvs&m=109511244721480&w=2">
0012 http://lists.kde.org/?l=kde-cvs&amp;m=109511244721480&amp;w=2</a></li>
0013 <li><a href="http://lists.kde.org/?l=calligra-devel&m=109518196922944&w=2">
0014 http://lists.kde.org/?l=calligra-devel&amp;m=109518196922944&amp;w=2</a></li>
0015 </ul>
0016 
0017 <p>It is well known that writing clean and easily understandable module will lead
0018 to better maintenance. However testing that particular module everytime there is
0019 a significant change requires considerable amount of time and effort. Since KSpread
0020 and other applications of its scale consist of hundreds of modules, in this case
0021 automatic testing of each module will help a lot, not to mention that it might
0022 catch bug as early as possible.</p>
0023 
0024 <p>KSpread has a simple test framework to facilitate such kind of test. This can
0025 be activated using the shortcut <tt>Ctrl+Shift+T</tt>. This test is however
0026 not accessible via menu, because it is intended to be used only by the developers.
0027 Ideally, there should be tests for all modules contained in KSpread. It is
0028 the responsibility of the developer to create the corresponding <tt>tester</tt>
0029 for the code that he or she is working on. All tests should be kept in
0030 <tt>calligra/kspread/tests/</tt>.</p>
0031 
0032 <p>Making a new tester is not difficult. The easiest way is to copy an already
0033 existing tester and modify it. Basically, it must be a subclass of class Tester
0034 (see <tt>calligra/kspread/tests/tester.h</tt>). Just reimplement the virtual
0035 function <tt>run()</tt> and it is ready. In order to make it possible to run
0036 the new tester, add an instance of the class in TestRunner
0037 (for details, see <tt>calligra/kspread/tests/testrunner.cc</tt>).</p>
0038 
0039 <p>A tester must be self-contained, it should not use any test data from
0040 current document. If necessary, it must create (or hard code) the data by
0041 itself.</p>
0042 
0043 <p>Whenever parts of KSpread features are improved or rewritten, it is always
0044 a good idea to run the related tests to ensure that all the changes do not do
0045 any harm. However, bear in mind that there is no 100% guarantee that the new
0046 code is bug-free.</p>
0047 
0048 <p>Also, if there is a bug which is not caught by the tester (i.e. it does not
0049 fail the tester, but the bug is confirmed), then the relevant tester must be
0050 modified to include one or more test cases similar to the offending bug.
0051 When the bug is finally fixed, from that point the test should always pass all
0052 test cases.</p>
0053 
0054 */