the Use Case :
You received a huge piece of code to maintain, that you know is
partially covered by tests.
CPD, and IDEA's inspections help you locate a very hot spot : a 600 line
method, full of duplication and poorly written code. You see crap, you
smell crap, you locate crap.
You are ready to jump in, with IDEA's scalpel, but you wonder :
- is this piece of code tested, so I can safely "fix" it,
and be told if I broke anything?
This is where the "ultimate feature" comes handy.
the "I had a dream" part:
With the cursor in the method you want to edit,
you push on ONE BUTTON, and IDEA does 3 things :
1/ creates a dynamic test suite with all the tests that exercise the
2/ runs this test suite, watching the code usage, to build and ..
3/ displays the code coverage result of the method, by the tests
=> in green , all the code that will be used by the tests
=> in red , all the code that will NOT be used by the tests
=> in yellow, all the code that will MAYBE be used by the tests
This info would tell you
- where it's safe to refactor, and
- where you need to add some test before refactoring/fixing
the point 1/ has a related feature request :
"run only the tests that exercise the class/method .."
Just an idea, ..