Thanks to mutation testing Salesforce developers and admins now can assess how good tests are in finding bugs.
As the community moves towards Salesforce DX and continuous integration, the need for high quality tests increases. In Salesforce we all succeed in 75% code coverage analysis. However, this metric does not enforce test quality: we still need to trust that the developers asserted for the right output. That’s why we decided to provide a tool for mutation testing to the Salesforce platform. Mutation testing provides the tool to Salesforce for creating good tests.
What is mutation testing?
- Mutation testing is process of creating faulty copies of your code and analyzing the results of running the test suite against them.
- If a test fails, it is said that the mutant (faulty copy) is killed. If no tests fail, it is said that the mutant survived
- The goals of mutation testing is to kill the mutants and make the tests fail
- The mutation testing score shows the number of mutants killed / total number of mutants. This score, expressed in percentage, is also referred to as mutation coverage.
How can mutation testing help you improve your Salesforce development experience?
- Reduced reliance on manual testers thanks to higher quality of automated tests
- Reduced reliance on the original development team of your Salesforce solutions
- Shorter integration time for new development team members
- Faster feedback
- Easy reporting
- Better test accuracy
Want to know more
Find out more about mutation testing
Watch an introduction of mutation testing in Salesforce presented at French Touch Dreamin 2017.
A crucial problem occurs when a developer only tries to reach the highest coverage and forgets that tests are about the requirements. If you are a Salesforce developer and you care about the quality of the work you deliver, this blog post definitely is worth reading.
To demonstrate that not every developer is a mathematical genius that writes code, we decided to catch up with two members of 4C’s London Development Team, to find out more about their day-to day-roles, career paths and hopefully de-bunk a few developer myths!
At 4C we are working on developing a mutation testing tool for Salesforce and we would like your help. By completing this questionnaire you will help us create a valuable product. In return, you will receive free and exclusive beta access to the tool.
Frequently Asked Questions about mutation testing for Salesforce
Why is mutation testing not widely used?
Mutation testing is a software testing technique first discussed in 1971. The first implementation was around 1980 and was left aside as a topic because of the computation power it requires. As computers developed, so did the mentioning of mutation testing in research papers and developer blogs. This kind of testing generates a large amount of mutants and requires the run of tests in the organization for each mutant. The generation and testing time of the technique are constantly improving, however the analysis of survived mutants is still a long manual process.
What are the benefits of using mutation testing?
What you can achieve directly from using mutation testing is automated quality tests. Good tests means reliability on the test suite and faster deployment times. Automated tests have more benefits such as:
- Saving time and money
- Shorter time to find bugs
- Reusable tests that can run 24/7
- Reduce reliance on manual testers
- Reduce reliance on original development team
- Faster feedback
- Easy reporting
- Happier developers (do it once - do it right)
- Improved testing accuracy
- Requirements can be documented in the test suite
- Reduced developer liability
- Reliable and stable systems
How can I start mutation testing in Salesforce?
The tool is under development and you can subscribe for a beta invitation by completing this survey.
What is the price for this tool?
The tool is still under development and you can help answer this question by completing this survey. The beta preview is free of charge, no card details required.