Unit Testing Using JUnit


The course seems to be more interesting since I am getting more coding assignments. This one was to just to read a sentence and reverse the sentence in way such that each of the words gets different position in the new sentence. Like the last word takes the first position and penultimate word takes the second position like that.

The algorithm seems to be very simple but implementation made us to learn the importance of unit testing. With my daily coding go around PL/SQL also I am trying TDD with PL/SQL in my own style working unit testing framework is always seems to be very great.

We need to use JUnit for unit testing. I tried implementing the assignment via TDD and ensured that I am getting used to JUnit.

Doing this way made me to learn a lot

  • How to handle exceptions in JUnit
  • How to make the code more modular
  • How to segragate the functionalities
  • How to make a test case pass from fail using JUnit