943,752 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Marked Solved
  • Views: 401
  • Java RSS
Sep 10th, 2009
0

Stringtokenizer

Expand Post »
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.

Java Syntax (Toggle Plain Text)
  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
Similar Threads
Reputation Points: 8
Solved Threads: 0
Junior Poster
KimJack is offline Offline
114 posts
since Apr 2006
Sep 10th, 2009
0

Re: Stringtokenizer

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.
Reputation Points: 874
Solved Threads: 352
Posting Maven
BestJewSinceJC is offline Offline
2,758 posts
since Sep 2008

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: using a resource from another package?
Next Thread in Java Forum Timeline: Dice Game





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC