function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Pay extra for test class?

I am a programming-illiterate admin who recently hired a free-lance programmer to write a simple trigger for our org and provide directions for deployment. He finished the job, and now directed me to write the test class prior to deployment. I had a look at the instructions and its Greek to me. He now offered to do it for me, at an extra cost. Does it make sense that this would not be considered a natural part of the trigger development and would require an extra cost?

Well test classes are required for deployment and hence this is generally considered as a part of development.

Generally freelancer charge you for the hour of effort they spend on particular job. So essentially the total effor should be (Trigger + TestClass).

But again it depends on the relationship you carry with the developer, the terms that you both agreed on. This is something I dont think can be discussed in develoepr board

Without these 'tests', the programs cannot go to production.

The 'code' he wrote is useless without the tests.

Without the 'tests', you gain no benefit.

Without benefit, what did you need the programs for?

Generally, it is assumed the programmer will provide code that can/will work in production.

Does the contracts say you write the tests?

Go look at your contract with that programmer.


To add to this thought - the 'tests' are the proof his programs work according to Salesforce requirement. That burden would be on the programmer. Otherwise - he could write anything!


Assume you write the tests? And the programs fail the test? Then what?

As mentioned by other contributors, Its developers responsibility to write the test method. Also, If the If you have tested the functionality and its working fine then you can push the trigger without test method to prod( If overall code coverage for your org is well above 75%..this is not a best practice but in case you want to push this code ASAP to prod)

Agreed.  The testing requirement for deployment should make it a package deal.


Interesting dilema and conversation. I agree you need to approach the developer to work this out as there are always two sides.  That said, looking at it from your side, here's the way I would look at this, based on the assumption that you didn't have a detailed conversation about the finish line for this work but at the same time never indicated this was for anything other than production use.


There are two possibilities:


1) The developer is new to the platform.


2) The developer is not new to the platform.


Drilling into each of these conditions:


1) If this is the first project this developer has done then there is some level of excusability here. Without a built in test framework the effort to bring a generic testing infrastructure to the project would likely have made the bid he/she gave you much more significant, likewise without prior knowledge the developer might have assumed the sandbox or DE environment they received from you or via directions from you was satisfactory and that you had the ability to move the implementation to whatever environment you choose.  It's possible the developer gave you a bid without much knowledge of the system other than the basic syntax and was unaware of the testing facilities/requirement at the time you entered into the agreement.


2) If the developer is not new to the platform he/she is very likely aware of the testing requirement and thus failure to include this in the bidding process or the scope of work is inexcusable and the honus is very much on the developer to explain how, in good faith, they can expect to be paid for incomplete performance. 


If I were the "customer" this is how I would approach the conversation.


When I worked as a contractor in, my effort estimations included at least 75% coverage - otherwise it can't be deployed to production - meaning a job that can't be delivered...

So by the way I see it - at least 75% coverage is part of the contract in otherwise it can't reach destination org.