GNOME Platform Stormclouds
Posted Mar 25, 2004 19:56 UTC (Thu) by
mly (guest, #2171)
In reply to:
GNOME Platform Stormclouds by NAR
Parent article:
GNOME Platform Stormclouds
> I generally have the opposite situation - the test runs slow
> (because the program communicates with a remote computer which
> I don't have any control over so I can't make it faster) but
> the C++ compilation is fast
This will probably not be an issue very often in GNOME, but you
are certainly right that running the complete program might
be slow. Nowadays I often write programs that access databases,
and I can tell you that accessing DB2 system tables on IBM
mainframes isn't very fast...
A solution to this is to either use proper unit tests for each
class, as prescribed by extreme programming, or to just make
a stub for the communication. I don't know what your program
does, but assuming that you will follow different paths in your
program depending on what data you recieve through your
communication, you could make a stub that will replace the actual
communication with test data that will cause your all of the
paths of your program to be explored. Perhaps you can make some
command line switch, or just a global variable TEST that will
let you read a file instead of reading from a socket. Then you
can just put yor test data in a file.
As I said, PyChecker or PyLint can also find many errors, but
test driven development can be particularly useful. When your
application gets big, you will be much less worried about
changing code if you can test each class and module separately.
Writing the tests first a la XP is both good as an exercise in
trying to flesh out in a proper and interface focused way what
the various parts of the program does, and you also get examples
of how each class and method can be used. In that way, the tests
become useful documentation. Always writing the tests first also
assures that the tests actually get written, and that you get a
good regression test suite.
(
Log in to post comments)