title: What is boundary conditions of test for String data?
body: <p>I'm testing a java method by Junit. The method takes a String then returns a modify String. I've already written a common test, a test for Null and Empty String. What tests can I write yet? What is boundary conditions for that test?
  What are large and small String for the test of that method?</p>
  
  <pre><code>public String reverse(String text) {
  
  String[] textFragments = text.split(" ");
  StringBuilder stringBuilder = new StringBuilder();
  
  for (int i = 0; i &lt; textFragments.length; i++) {
      char[] chars = textFragments[i].toCharArray();
  
      int leftElementIndex = 0;
      int rightElementIndex = textFragments[i].length() - 1;
  
      while (leftElementIndex &lt; rightElementIndex) {
  
      boolean isLeftLetter = Character.isLetter(chars[leftElementIndex]);
      boolean isRightLetter = Character.isLetter(chars[rightElementIndex]);
  
      if (isLeftLetter &amp;&amp; isRightLetter) {
          swap(chars, leftElementIndex, rightElementIndex);
          leftElementIndex++;
          rightElementIndex--;
      } else {         
          leftElementIndex = (!isLeftLetter) ? ++leftElementIndex : leftElementIndex;
          rightElementIndex = (!isRightLetter) ? --rightElementIndex : rightElementIndex;
      }
      }
      stringBuilder.append(new String(chars));
  
      if (i != (textFragments.length - 1)) {
      stringBuilder.append(" ");
      }
  }
  return stringBuilder.toString();
  }
  </code></pre>