Where are some sample projects in Salesforce

Realize complex projects in Salesforce Marketing Cloud with SSJS

Test-driven development

The implementation of the first two patterns “DRY - Don't Repeat Yourself” and “Make It Configurable” makes it possible to adapt the so-called “Test-Driven-Development” as well as possible. Since we don't have a terminal, we switch to the implementation within CloudPages and output our test cases visually - everything is green, everything is good.

With the first pattern “DRY - Don't Repeat Yourself” we are able to integrate our code base, which is already used by the other CloudPages, into the Test Suite-CloudPage. If something changes in the codebase, the tests must continue to be successful - or the adjustments are still faulty. By the way: In order to be able to carry out such adjustments without disrupting the live operation, the Codebase elements are saved by us in a versioned manner. A new version must first be confirmed by the test suite, then it can be integrated by the controllers.

Since we pass on the URL of the Test Suite-CloudPage and the tests should be able to be initiated at any time by everyone involved in the project, it would be unthinkable to run data-extension-based tests against the “live database”. Unfortunately, Salesforce Marketing Cloud doesn't know the concept of “live database” vs. “test database”. There are simply no such differences. This is where the “Make It Configurable” pattern comes to the rescue. Before we call methods in the test suite for tests, we ensure that the configuration variables of the data extensions used are overwritten - instead of the potentially productive data extensions, we use an image of the data extensions for test purposes during development. This approach is also a very useful tool for debugging processes without disrupting live operations.

The rest is then the “usual” development work: writing methods, developing and carrying out tests for them. From our point of view, this kind of development is extremely reassuring. The better we write tests, the more certain we can be that our software is doing its job. However, if we test complex processes manually (which was necessary for a long time before we had created the tools in Salesforce Marketing Cloud), this is on the one hand nerve-wracking (since it often requires a lot of click work) and on the other hand, above all, time-consuming, because everyone Adjustment, the test must start from the beginning in order to consider possible cross-influences.