0

Hi all,

I have a quick question. Is this a proper way of using blackbox testing to test the stringTokenizer class? If not, would you provide a proper example that displays the pass or fail.

string = "cat, dog";
    StringTokenizer token = new StringTokenizer(string, ",");	     
         if (token.countTokens() == 2)
	System.out.println("Passed");
	     else {
	     System.out.println("Fail");	     
	     }

Thanks, KimJack

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by BestJewSinceJC
0

Black box testing would involve trying to break your code by giving it invalid inputs and making sure it handles them appropriately, as well as giving it valid inputs and making sure it comes up with the right result. So I do not think your code counts as black box testing. . however, that isn't to say your test is invalid, it just isn't black box IMO.

Edited by BestJewSinceJC: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.