[clug] PSIG last night

Paul Wayper paulway at mabula.net
Fri Nov 14 13:01:20 GMT 2008


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

Alex Satrapa wrote:
| Has anyone from the PSIG (testing in Django) last night tried writing
| tests today?  :)

I did :-)

I'm still struggling with some of the philosophy behind testing, however.  For
example, with Django you can have a field with a maximum length.  I'm assuming
that I don't have to test that it doesn't accept strings longer than that
(because I assume Django's testing framework already does).  Should I see
whether it can accept unicode characters?  Should I test whether it's
resilient to \0 characters?  Should I do this with every CharField I have in a
model?  And so on with integers?  I can see that those are probably tests
already handled in Django - but the philosophical question is whether I have
to check whether Django's working or not.  Sometimes a subtle bug might show
through one of those assumptions.

OTOH the tests in the framework seem strangely simple - e.g. create a new
object, save it in the database, and immediately retrieve it.  Surely the
problem I'm wanting to test for is whether that record is still in the
database six months from now, or that no-one can change the ID field of this
object through the web interface?

Don't get me wrong, I can see the value of unit tests.  I can see how
test-driven development makes a lot of sense when you're trying to make an
algorithm that processes data according to a variety of complex rules.  The
testing frameworks that Paul Leopardi was talking about for testing Sage are
vital so that mathematicians can know that the results are correct.  I hate it
when I go and change something seemingly innocuous and find out it had deep
consequences that a testing framework could have told me about right away.

I'm just struggling to get exactly how it applies.

Anyway, have fun,

Paul
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iEYEARECAAYFAkkddqAACgkQu7W0U8VsXYJYDACgifycR2EZkG2iXJZV3w+ZwJqH
M0gAoIj4SSa3ipB0Z6NCg9wURU87m+ER
=blXp
-----END PGP SIGNATURE-----


More information about the linux mailing list