I have a test class which is just inserting few object records. It does not have any test.startTest()/Test.StopTest(); . Neither it is instantiating any other class. How to know that which classes are covered by this test class ? And the percentage of each classes that is covered.
I believe you can use tooling API to find out which classes are covered by a particular TESTCLASS and TESTMETHOD. But first make GOTO
Setup > Apex Test Execution > Options and make sure that `Store aggregate test coverage only' is turned OFF.
Then go-to Workbench > Utilities > Rest Explorer. and use tolling API to query ApexCodeCoverage object.
It will give you Id of the class it covers and number of lines covered and uncovered of all classes and triggers. You can calculate the percentage using by using
The simple answer to your question is No and No (as of now .. may be it will change in future)
You will not be able to easily find the % covered by specific test class. You can find which classes are covered and to what percent(but not by which test class).
You can not also find which classed are tested by your test class. You will have to read your test class and find out which trigger and classed are getting executed.
There are few partial workaround thought for 2nd point above.
1) You can look at debug log and find the trace of all classes & triggers
2) If your test fail it will give your trace of classes