Verifying success

Was the memory leak eliminated?

To check that the memory leak was fixed:

  1. Select the Memory Profile tab.

  2. In the Report Window on the left-hand side of the UI, left-click the first snapshot for Test #2.

  3. Select the column header for Reference Bytes Diff AUTO, then select the column header for Reference Objects Diff AUTO.

  4. Scroll down and study each of the snapshots for Test #2 - is the GetChannels() method still responsible for referenced objects?

You successfully eliminated the memory leak. Have you improved performance?

To check that performance was improved:

  1. Select the Performance Profile tab.

  2. Select the menu option Performance Profile->Test by Test

  3. In the Report Window on the left-hand side of the screen, left-click the node labeled Test #1 in order to deselect it.

  4. Sort the table by Function Time if it is not sorted by this value already.

  5. Do you see the function checkLog()?

You successfully improved performance. Was code coverage improved?

To check that code coverage was improved:

  1. Select the Code Coverage tab.

  2. In the Report Window on the left-hand side of the screen, open the node for UmtsConnection.java, open the baseStation.UmtsConnection child node, then left-click the run() node.

  3. Select the menu option Code Coverage->Test by Test.

  4. Scroll down until you can see the if statement for which you have attempted to force an evaluation of true - did you? Has code coverage been improved?

You successfully improved code coverage. Note, by the way, that you can discern what this second manual interaction has gained you in terms of code coverage.

  1. With your mouse anywhere within the Source tab of the Code Coverage viewer, right-click and select CrossRef

  2. Scroll the Code Coverage viewer to expose the line of code that has been newly covered and then left-click it:

message.setCommand(UmtsMsg.ACCEPTED);

 

Notice that only Test #2 is mentioned. However, what tests are listed for the if statement itself?

  1. Left-click the line

if (message.getPhoneNumber().equals("5550001"))

 

Both Test #1 and Test #2 are listed. As further proof, do the following.

  1. With your mouse anywhere on the Source tab of the Code Coverage viewer, right-click and deselect Cross Reference

  2. In the Report Window, on the left-hand side of the screen, open the Tests node and deselect the checkbox next to Test #2.

Since you have deselected Test #2, all you are left with is the code coverage that has resulted from running Test #1, and Test #1 never forced the if statement to evaluate to true. Thus the newly covered code has become red again - in other words, unevaluated.