I recently finished up an internal project which required a comprehensive approach to test cases, in particular those relating to Visualforce pages, and Controllers. Throughout the project I did a lot of self-discovery combining my experience with other testing frameworks such as JUnit, Selenium etc. with my knowledge of how test cases work within the Force.com platform. The result was a great exercise in identifying real world test patterns, best practices and most importantly, the practical applications of these patterns within the Force.com platform

One such example is the use of test cases vs. test suites. I like to think of test cases as specific assertions to validate a specific logical outcome. Within Force.com, test cases may be implemented as test methods, or perhaps as fine grained as a System.assert() calls. Test cases are typically used to confirm the correct functioning of triggers as an example.

Test Suites, however, take a more holistic look at a functional use case (enrollment in a class for example). A suite may contain a number of test cases, which when passed in its entirety, can confirm the system functions as expected from end-to-end. Planning for test suites, takes more work, and some planning, specifically around the implementation of test patterns.

I am currently working on an article to capture, and share some of this knowledge. If you have any ideas/experience that you think would be good to include please let me know!

Get the latest Salesforce Developer blog posts and podcast episodes via Slack or RSS.

Add to Slack Subscribe to RSS