Finding Code Coverage in Spring ’13

With the arrival of Spring ’13, you may have noticed that finding code coverage is a little more challenging. Before Spring ’13, I would just open up my class which contained my tests, click the Run Test and then look at the code coverage results on the resulting page. That has changed in Spring ’13 because the tests now run asynchronously. There are a few ways to view your code coverage.

The first way is under Setup->Develop->Apex Classes. Look for the column called “Code Coverage”. When you click on the percentage, you’ll get a familiar looking screen.

Code Coverage 1

The other option is to use the Developer Console. This gives you additional details about what each test method is actually doing. Open the Developer Console, click on the Repository Tab and then open the class for which you want to see the coverage. You can select to see no coverage, the coverage from all tests or coverage from a specific test method.

code coverage 2

You can also run specific test methods from the Developer console if you open the test class.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s