[Feature] Code and Tests both in single source code editing window
Tests usually are separated from the code.
Code Coverage report shows green and red code pieces.
To be able to get 100% code coverage, one has to alter the code into many separate strange functions, use extensive mocking.
For weak programmers, here the willingness to write the tests disappears.
It is possible to put the tests visually in those code coverage if else blocks. No need for refactoring.
The test for this block can specify that the debugger needs to falsify at the line n some value so that this test gets called. Mocking at the debugger level.
In reality, tests are calling some web service 100 times. Test situations are being provoked via changed function parameters.
That same could be achieved by the debugger altering some values to get in those code branches.
This way it will be visually easy to add some simple tests. Also, no refactoring, no mocking.
Idea could be extended to database with routines and tests, which are being united in collections and views. Source code file paradigm shift into database code and tests.
All this a little affects debugger and runtime, and a lot IDE.

Please sign in to leave a comment.
Hi Sandijs,
I understand this is a feature request. If this is the case, please create an issue on https://youtrack.jetbrains.com/issues/IDEA.
Done! https://youtrack.jetbrains.com/issue/IDEA-314806/Code-and-Tests-both-in-single-source-code-editing-window