Verifying Success

Was the memory leak eliminated?

To check that the memory leak was fixed:

  1. Select the Memory Profile tab.

  2. Maximize the window

  3. In the Report Window on the left-hand side of the screen, look inside the node labeled (BaseStation)<timestamp> - do you see the ABWL error anymore?

You successfully eliminated the ABWL error. 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 #2

  4. Sort the table by Avg F Time - do you see the function checkUmtsNetworkConnection()?

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.cpp and then left-click the method processMessages()

  3. 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. Select the menu option Code Coverage->Test by Test

  2. In the Report Window on the left-hand side of the screen, reselect the method processMessages()

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

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

strcpy(response.command,cmd_accepted);

 

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

  1. Left-click the line

if (strcmp(msg->phoneNumber,"5550001")==0)

 

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.