April 05
Prof. Ismael H. F. Santos -  ismael@tecgraf.puc-rio.br                                                          2
When is JUnit appropriate?
nAs the name implies…
nfor unit testing of small amounts of code
nOn its own, it is not intended for complex testing, system testing, etc.
n
nIn the test-driven development methodology, a JUnit test should be written first (before any code), and executed.
nThen, implementation code should be written that would be the minimum code required to get the test to pass – and no extra functionality.
nOnce the code is written, re-execute the test and it should pass.
nEvery time new code is added, re-execute all tests again to be sure nothing gets broken.