All Ideas

Idea Details

Post an Idea
190  Points
Under Point Threshold
Idea hasn't met the 2,500-point review threshold. Give it an upvote or downvote.

Optionally require @testMethod's to call system.Assert*

Apex & Visualforce

As a Salesforce consultant and developer I have inherited a number of orgs plagued with test classes that execute code, but make no assertions. 

As a developer, I understand the importants of testing code, and believe that we should always write *useful* tests. Additionally, I know Salesforce runs the unit tests in our orgs before every release. Without assertions, however, these test runs tell us only that the code runs, not that it's functioning properly. While there are rarely, if ever, technological solutions to social problems -- like the lack of rigor and professionalism with regard to testing amongst Salesforce developer-- I believe it is in the best interest of not only Salesforce Developers but also Salesforce itself, to build a feature allowing administrators to engage an org-wide flag requiring all test methods to call assert methods, with sane protections against such clear abuses as System.Asert(true);

This can only result in better testing, and therefore better code in production, as well as better feedback to Salesforce about the viablity of new API versions.  

Merge Idea · Flag

  • Upvotes
  • Downvotes

Ideas

Apps

from AppExchange

Questions

Help us to keep IdeaExchange clean by pointing out overlapping ideas. We'll investigate your suggestion and merge the ideas if it makes sense.



 

 

Thanks for your merge suggestion. We will review it shortly and merge the ideas if applicable.

Salesforce takes abuse situations very seriously. Examples of abuse include but are not limited to posting of offensive language or fraudulent statements. To help us process your request as quickly as possible, please fill out the form below describing the situation. For privacy and security reasons, the final outcome of an abuse case may not be revealed to the person who reported it.


 

Thank you for your feedback. We take abuse seriously and will investigate this issue and take appropriate action.