-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 11/10/2010 05:53 AM, Dr. David Kirkby wrote:
> Someone recently said he felt that a test:code ratio of 1:1 is about optimal,

That of course is bunk.  The optimal amount depends on what the project
does, the resources available, the consequences of bugs, and the values of
the developers.  For example for your project I'd guess that accuracy is
very important while running out of memory is not.  If the project is run on
a buggy FDIV pentium would it even notice?

SQLite is a library and hence has no control over the application it runs
in.  There may be a lot of memory or it may be a small device with tens of
kilobytes.  It may be an application that doesn't really matter if it
crashes, or in one that should never crash.  The data may be randomly
generated or very important.

The SQLite developers decided their library will always be reliable and
greatly care about data integrity hence the amount of testing.

> Of course there are practical issues with having a lot of test code - if you 
> spend a lot of time writing that, you have less time to add functionality.

If you have code that is unexercised by your test suite then does it make a
sound when falling in the woods?  Sorry I mean can you make any assumptions
about it at all?  You are of course using your users as the inefficient test
and hoping they would notice any problems.  Depending on the application
this may be ok.

Note that the standard test suite is written in TCL.  Languages like TCL,
Python, Lua etc are significantly more productive especially for being test
harnesses.  There is generally no boilerplate since you can automate that away.

However some environments can not adequately run TCL to test SQLite which is
why there is TH3 that does the tests in C.  That C code is generated with
control over how it is done as for example having it all done at once may
produce something to big for the platform to run at once.

At the end of the day the best thing to do is be honest with your users.  On
the web site say how much test code there is.  Say what percentage of the
codebase it covers.  Say if that is just lines or decision points (MCDC).
Say what kinds of testing there are (eg correctness, memory allocation, data
integrity etc).

Roger
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkzayEcACgkQmOOfHg372QTDIwCdHZvbK6MZuQOHqTXkJKpzDAyh
lKYAoJIhWI2G/Rk4CfZZQn5rCdv/4TgG
=kp6o
-----END PGP SIGNATURE-----
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to