Stringtokenizer

Thread Solved

Join Date: Apr 2006
Posts: 114
Reputation: KimJack is an unknown quantity at this point 
Solved Threads: 0
KimJack KimJack is offline Offline
Junior Poster

Stringtokenizer

 
0
  #1
Sep 10th, 2009
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.

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

Thanks, KimJack
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 1,580
Reputation: BestJewSinceJC is a name known to all BestJewSinceJC is a name known to all BestJewSinceJC is a name known to all BestJewSinceJC is a name known to all BestJewSinceJC is a name known to all BestJewSinceJC is a name known to all 
Solved Threads: 199
BestJewSinceJC BestJewSinceJC is offline Offline
Posting Virtuoso

Re: Stringtokenizer

 
0
  #2
Sep 10th, 2009
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.
Last edited by BestJewSinceJC; Sep 10th, 2009 at 9:11 pm.
Out.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC