For code coverage, you will need a combination of a unit test framework, and a code coverage tool. So in the Java world, you might use JUnit/Coberatura.
Although code coverage can be done outside of unit testing, it's generally done in unit testing as you can mock and stub out parts of the application to make it easier to mimic the exact conditions.
As for code coverage. It should be 100% branch coverage. A well thought out design that properly uses interfaces and good object creation patterns should be easy to mock out it's dependencies and test in isolation.
Beyond just simple branch coverage, you also want to use a few concrete real world values as proof of acceptance.