directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Berin Loritsch <>
Subject Test Design
Date Thu, 17 Mar 2005 18:39:07 GMT
The thread on test naming got my memory jogged.  A number of the tests 
require a socket set up and things shoved through it to make it work.  
That is really integration testing, not unit testing.  Integration tests 
are important, but unit tests are what needs to be run as part of 
building a project.  Usually it consists of encoding a message, sending 
it over the wire and decoding it on the other side.

What would be better is if we could compare the encoded set of bytes 
(using a ByteInputStream and a ByteOutputStream) and compare the set to 
what the properly encoded message should look like.  Similarly, on the 
decode side start out with the byte array of the encoded message and 
have the system decode it on the other side.

If the code does not allow us to pass in our own streams then that would 
be a point for refactoring to make the system more friendly to testing.  
That would also releave the need to poke holes in personal firewalls 
just so the test can run (something Linux developers need to do).  It 
also reduces the points of failure and makes it plainly obvious what is 
an accurately encoded messgae.  Hopefully it will also avoid the problem 
where the library is consistent with itself but not with production LDAP 

View raw message