Share

J2EE slashcode

Tracker: Bugs

5 insufficient unit tests - ID: 558928
Last Update: Comment added ( cwatana )

As the amount of code is beginning to reach a critical
mass, every class should have an automated unit test.
This is needed for regression test purposes and to
ensure developers don't check in code that breaks
existing functionality.

As far as I can see there are two types of tests.

1. It should be easy to write junit tests for model and
data access classes. So I expect these to be written.

2. Automated testing of the front end is a bit more
involved. We should look into how this can be achieved
e.g. cactus or httpunit.

To separate the code, perhaps we should create a new
project and package structure e.g.
unittest.j2eeslashcode.UserTest etc.


Chris Watana ( cwatana ) - 2002-05-21 23:40

5

Open

None

Nigel Wetters Gourlay

None

None

Public


Comments ( 5 )




Date: 2002-06-04 19:55
Sender: cwatanaProject Admin

Logged In: YES
user_id=522688

JUnit test for the User class is now complete. Simply follow
the style given in the code and write the rest of the tests
;-) Writing the test has been worthwhile as, in addition to
the reasons given when this bug was raised, I've learnt more
about BufferedReader.readline() and when User.equals() is used.

The test should automatically run when you do an ant deploy
or ant unittest from within eclipse or off the command line.
Please can you check this. I've also commited an
eclipse-HOWTO as well.




Date: 2002-05-30 22:44
Sender: cwatanaProject Admin

Logged In: YES
user_id=522688

See src/unittest/j2eeslashcode/UserTest.java
Sadly the test fails in a pretty spectacular way. We'll have
to talk about this. I'll raise two more bugs.

The test should automatically run when you do an ant deploy
from within eclipse or off the command line. Please can you
check this. I've also commited an eclipse-HOWTO as well.



Date: 2002-05-29 16:01
Sender: nwettersProject Admin

Logged In: YES
user_id=104837

see files in test/md5

md5test.pl produces two files, one (plain.txt) containing
1000 plaintext words between 6 and 20 characters in length
excluding chars 10 and 138, each followed by a newline. The
other (hashed.txt) contains 1000 md5 hashes followed by
newlines.

over to you....



Date: 2002-05-23 23:41
Sender: cwatanaProject Admin

Logged In: YES
user_id=522688

will write junit for class containing the code that creates an
MD5 hash of the user's password. Please produce a file using
the Perl slashcode that contains 1000 random passwords
and their hashes. Ensure that passwords of the minimum and
maximum length are included and that there is a fair selection
of good and bad passwords e.g. dy3726YnqWEd and
password.


Date: 2002-05-22 08:33
Sender: nwettersProject Admin

Logged In: YES
user_id=104837

Please write a junit test for one class in the structure,
and alter build.xml to perform all tests when someone types
'ant test'.

I will look at how you've built the test and write tests for
all other classes.


Log in to comment.




Attached File

No Files Currently Attached

Changes ( 4 )

Field Old Value Date By
assigned_to cwatana 2002-06-04 19:55 cwatana
assigned_to nwetters 2002-05-29 16:01 nwetters
assigned_to cwatana 2002-05-23 23:41 cwatana
assigned_to nwetters 2002-05-22 08:33 nwetters