Software development best-practices encourage a thorough automated test strategy and continuous integration (for me that's Hudson, Ant and JUnit). Even better is to measure code coverage of your tests using a tool such as Cobertura. Code coverage tools will tell you which code was executed by your tests. This kind of analysis is ideal for finding untested code, however it's easy to be mislead by code coverage reports.

Take for example the following ficticious example:


public class Calculator {
BigDecimal currentValue = new BigDecimal(0);
Stack history = new Stack();

public void add(BigDecimal augend) {
currentValue = currentValue.add(augend);
commandPerformed(Type.ADD,augend);
}

private void commandPerformed(Type type, BigDecimal augend) {
// TODO Auto-generated method stub
System.out.println(type+": "+augend);
}

public void undo() {
// TODO
}

public void redo() {
// TODO
}
}

Initially the coverage report will show that all of this class is not covered.
Create a test for the add() function, and the code coverage reports will show that the commandPerformed() has been covered -- even though it is clearly not doing what it is suppoed to.

Be careful when reading code coverage reports -- don't assume that code that is covered is tested. The most a coverage report can tell you is if code is not covered at all by your tests.