From koffice-devel Tue Sep 14 17:11:52 2004 From: Thomas Zander Date: Tue, 14 Sep 2004 17:11:52 +0000 To: koffice-devel Subject: Re: koffice/kspread/tests Message-Id: <20040914171152.GA5478 () factotummedia ! nl> X-MARC-Message: https://marc.info/?l=koffice-devel&m=109518196922944 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--===============0447261459==" --===============0447261459== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="/04w6evG8XlLl3ft" Content-Disposition: inline --/04w6evG8XlLl3ft Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Sep 14, 2004 at 06:55:18PM +0200, Ariya Hidayat wrote: >=20 > >ALL the information for the test should be hardcoded in the test, in ord= er > >to let it be as small of a unit (to test) as possible. > >This also makes coding the actual test a LOT simpler (as no code has to > >be written validating the input) which allows you to write many little > >tests. >=20 > So I can't have a test which works with the current document? I find=20 > that will be handy, e.g. check whether cell storage (i.e. currently in=20 > cluster system) is proper or not. Or is this not the way a test=20 > framework should do? In my experience thats not a good way to do things; no. If you want to test if cell storage works you a) instanciate a Cell=20 b) fill it with some data c) call store d) check the backing store if the data went through. Very low level and small tests (20 lines of code per test is usual). What you want to do is do the 'fill with some data' a number of times with different sets of data, chosen in a way that you test the limits of certain parts. The huge advantage of testing comes only when you make it possible to run tests without a GUI (so you can run _all_ tests, with all data-sets, every time you made a bugfix). This leads to the behavior that if you wrote a number of tests for your new class, and some wierd sideeffect someone else creates breaks your code then currently its almost impossible for that other person to even detect it broke. Now its easy; just run the tests and see one break. There are people who even go as far as to have a minimum of one test per API call.. Thats probably overkill; but it illustrates the idea. So; you should write a test and include the test-data with that test, which means you don't want to run it on the current document. If another document breaks the code (but not your test) you find out what data it is and create another test (with that data). I hope you can use this; its the general way testing is implemented. --=20 Thomas Zander --/04w6evG8XlLl3ft Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (GNU/Linux) iD8DBQFBRyZYCojCW6H2z/QRApBIAJoCCV5cKYNvLRJYvMPsKHjKx6GaIQCfVNIt pgHiLFz2O6PLnSzYTaUuYrY= =F++X -----END PGP SIGNATURE----- --/04w6evG8XlLl3ft-- --===============0447261459== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ koffice-devel mailing list koffice-devel@mail.kde.org https://mail.kde.org/mailman/listinfo/koffice-devel --===============0447261459==--