|
Post by Sylph on Jan 20, 2002 14:01:00 GMT -5
how do we do URLListTester? when we test some methods, we assume other methods work that test them! are we just supposed to do a linear test, and then print something only when there is an error? how do we structure the testing? right now, my testing procedures seem very random.
|
|
|
Post by Sylph on Jan 20, 2002 15:43:21 GMT -5
what if my URLList class automatically calls a method from another class that prints stuff(output)? is this acceptable?
|
|
|
Post by Brutal_Chicken on Jan 20, 2002 16:57:05 GMT -5
URLList should not be printing anything by its own.
|
|
|
Post by EurasianVixen on Jan 21, 2002 18:34:16 GMT -5
For URLListTester, does it have its own main method and inside it, all the test cases? So all u would have to do is run URLListTester class and it should automatically give you the results of every test case? How are ppl doing it?
|
|
|
Post by Sylph on Jan 21, 2002 19:07:13 GMT -5
yeah, i think it's supposed to work like that. URLListTester and URLList would be in a new project, and i think ur only supposed to output if the're any errors.
|
|
|
Post by EurasianVixen on Jan 21, 2002 20:08:58 GMT -5
I don't understand how you can create a URLList (vector/arraylist) in the URLListTester class. I thought you are suppose to only create it in URLList class and only have its results sent back to each test case in URLListTester? Just like how A1Driver does not mention anything about a "predefined list", doesn't URLListTester work the same way? So whats A1 talking about making a URLList? Which leads me to my dilemma: say my test case is to return the size of a 6 element arrayList from URLList to URLListTester. Then my next test case is to return the size of an empty arrayList. It will return 6 to me b/c I did not make the list empty from the previous test case. How do you solve this?
|
|
|
Post by Sylph on Jan 21, 2002 23:42:39 GMT -5
the name of the class is URLList, so u create a URLList by creating an instance of URLList in A1Driver. u also create on in URLListTester. for the size problem, make a new URLList.
testing (proof) seems to be recursive, becuz in order to see if, say, get works, u have to add a new url, and in order to see if add works, u have to get it. how did u guys structure ur test cases? what are good test cases? for size, is 0, 1, and 1+ good samples?
|
|
|
Post by Sylph on Jan 21, 2002 23:51:52 GMT -5
also, is URLListTester supposed to have good structure/program design? some of my outputs seem repetitive, but i didn't learn "case 0: ..." and stuff like that, and many if statements seem like a lot of work for just a class that tests another class. i mean, getting that complex is like needing another class to test URLListTester..
|
|
|
Post by EurasianVixen on Jan 22, 2002 0:15:25 GMT -5
oohh, I get it, thanx! ;D Yeah, I know what you mean about the recursive thing. In the example on A1, to test "add and retrieve one element" it uses both the add and get to perform that. So I suppose its ok to use both operations to prove that one method works. (Sounds silly doesn't it, since we're using a method to show that another method works and vice versa!)
|
|
|
Post by Tony on Jan 22, 2002 20:52:58 GMT -5
Exactly! we're making a program to test if our program works! the best way to test would be to manually check while programming and then re-run and test when it's done.
|
|
|
Post by 1.8T on Jan 23, 2002 0:28:02 GMT -5
i'm having trouble testing my list method., when testing., do compare the list b4 its printed or after? before meaning,. the /n stuff isn't added to it., EDIT: nevermind.,., got it.,., when u have something like this if (condition); <-- and a semicolon at the end., things tend not to work as nicely..,
|
|