title: JUnit Testing -- What makes it so useful over manual testing?
body: <p>I understand the importance of testing and unit testing in general, but is JUnit used ubiquitously in the real world, and what are the advantages of using it over a "manual" test method?  That is to say, why use a JUnit Test:</p>
  
  <pre><code>public class MyTest extends TestCase
  {
      public void testSomething()
      {
          assertTrue(someCondition);
          assertTrue(manyOtherConditions);
      }
  }
  </code></pre>
  
  <p>versus some kind of lightweight custom-coded unit debugging tool</p>
  
  <pre><code>public class MyTest
  {
      public static void testSomething()
      {
          MyDebugUtility.println(someCondition);
          MyDebugUtility.println(expectedCondition);
      }
  }
  </code></pre>
  
  <p>and checking the return values yourself?  Either way you'll have to make a comparison between conditions, and with Unit Tests, it seems VERY easy to make a slip in your test code (as I've done) and wonder why your class isn't working when your real error was accidentally typing assertTrue rather than assertFalse.</p>
  
  <p>Even if you wanted the easy boolean functionality, what makes JUnit superior to</p>
  
  <pre><code>public class MyTest
  {
      public static void testSomething()
      {
          if(condition1)
              MyDebugUtility.println("Passed condition1");
          else
              MyDebugUtility.doError(); //handle however you want
      }
  }
  </code></pre>
  
  <p>Are there more powerful features of JUnit that I'm missing?  Most of the unit tests I've written just seemed like cumbersome versions of some simple printing and boolean checking.</p>