Skip to content

Cloud-Code-Academy/module11-testing-debugging-tarafullerton

 
 

Repository files navigation

Open in Visual Studio Code

Developer Kickstart: Testing and Debugging

This repository is an essential segment of the Developer Kickstart curriculum at Cloud Code Academy. Tailored specifically for up-and-coming Salesforce developers, this module plunges into the crucial aspects of testing and debugging, underscoring the necessity of robust test classes, effective debugging strategies, and the maintenance of high code coverage.

Goals of the Practice

During this repository, you will deepen your grasp of:

  • The imperative role of test classes in ensuring the reliability and stability of your Apex code within Salesforce.
  • Crafting and deploying well-structured test methods to cover a multitude of scenarios, both positive and negative.
  • The importance of achieving and maintaining a high code coverage percentage, ensuring every line of code is vetted for functionality.
  • Mastering Salesforce's built-in debugging tools, such as the Developer Console, to identify, diagnose, and resolve issues efficiently.
  • Incorporating systematic logging and exception handling to provide clarity on runtime behaviors and unexpected errors.

By excelling in these testing and debugging techniques, you'll bolster your capability to write resilient and fault-tolerant code. This strengthens your expertise in ensuring that Salesforce applications are not only functional but also reliable, emphasizing the best practices that underpin top-tier Salesforce development.

Setup

Setup Overview

Getting Started Checklist

  1. Create/Configure a trailhead playground or developer org to do your work throughout this program.
  2. Install Visual Studio Code from here.
  3. Install Salesforce Extension Pack in Visual Studio Code. This can be done by searching 'Salesforce Extension Pack' in the Extensions view in VS Code and clicking Install.
  4. Authorize your org in Visual Studio Code. Press Ctrl + Shift + P to open the command palette and type 'SFDX: Authorize an Org', then press Enter. Follow the steps in the browser to log in to your org, then return to VS Code.
  5. Make sure to save and deploy your changes into Salesforce from your local machine. This can be done through the command pallet or right clicking the file you want to deploy and using the option SFDX: Deploy this source to org

Running the Test Classes

To run the test classes:

  1. Open the command palette with Ctrl + Shift + P.
  2. Type 'SFDX: Invoke Apex Tests...', and press Enter.
  3. In the 'Select Test Class' input, select the test class you want to run and press Enter.
  4. The test results will appear in the Output panel at the bottom of the screen. You can switch to the 'Test' tab in this panel to see a summary of the test run.

Resources

If you get stuck at any point, here are some resources that might help:

And remember, programming is often about solving problems, so don't be afraid to use search engines to find answers to your questions.

Good luck with your learning journey in Salesforce development!

About

developer-kickstart-cohort6-module11-testing-debugging-developer-kickstart-testing-debugging created by GitHub Classroom

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Apex 97.2%
  • JavaScript 2.1%
  • Shell 0.7%