In my daily work, I intend to write tests for the code that I change.
My workflow usually is like this:
IntelliJ IDEA includes the code coverage support since the 6.0 version (Ultimate edition).
Through Run -> Edit Configurations -> Code Coverage you can configure the code coverage you want, then you can issue the "Run tests with coverage" command. You'll have as a result some code coverage data on the project view. When you open a source file you can also see what lines are fully covered, partially covered, or not covered at all.
You might want to customize the Colors & Fonts through File -> Settings -> Editor -> Colors & Fonts -> General modifying the following entries:
For example I wanted to add more evidency to the coverage, so I configured a different background for those lines.
Once you have some red lines (not covered), you can try to cover them and if you see them becoming green it means you did a good job, and so on!