In this chapter, you will continue learning about the Salesforce-specific knowledge areas a CTA must master. The development life cycle and deployment planning are part of the sixth domain out of seven. You will learn the required knowledge and then complete a hands-on exercise using a small hypothetical scenario for each domain.
In the previous chapters, you covered several topics that are required to develop a secure and scalable enterprise solution using the Salesforce Platform. In this chapter, you will go through the considerations, capabilities, concepts, techniques, and tools required to set up an enterprise development environment.
Enterprises want to ensure they are getting the most out of their Salesforce investment. This cannot be achieved without the right level of governance, which supports and guides development activities throughout the program. Project/program governance should ensure the developed solution meets the business requirements and is easy to maintain, scalable, and bug free and can perform well.
As a CTA, you are expected to be the guide throughout this process. You should be able to help your client establish the right governing body and guide the development teams to put together the development and release process. This will ensure Salesforce features are delivered bug free, on time, and within budget.
There is usually a whole section full of requirements dedicated to this domain in full review board scenarios. This domain has a well-defined scope, which means that the challenge typically lies in the depth of the knowledge required. In this chapter, you are going to cover the following main topics:
Development life cycle and deployment architects are usually hands-on, technically capable professionals who design and implement a software development environment, including its release management processes and tools. They identify and mitigate project risks and work with other professionals to define an overall testing strategy that addresses quality concerns.
These architects also actively participate in structuring a governance body that ensures the best technical solution is chosen for a given business challenge.
Note
According to Salesforce’s online documentation, a CTA candidate should be able to meet a specific set of objectives, all of which can be found at the following link: https://packt.link/UskVD.
By the end of this chapter, you should be able to do the following:
Now, it’s time to have a closer look at each of these objectives.
The review board scenario is designed to represent a real-world use case. In real projects, you will encounter many challenges and risks. Some are related to the platform itself, while others are related to other systems, solutions, or parallel projects.
You are expected to identify these risks and develop a set of mitigation strategies to address them. The risks could be related, but not limited to, the following:
Next, you will go through each of these risks in detail.
You could have multiple projects running in parallel on the Salesforce Platform or on another platform related to/integrated with Salesforce. It is common to get conflicts when more than one project/platform has a different release cycle, mainly due to incompatibilities between the versions of the released solutions. You can typically solve this by proposing a combination of the following:
More details on each of these strategies are included later in the Recommend the Right Project Governance to Support Technical Decision-Making and Craft the Right Environment Management Strategy sections. Next, you will explore the second most common risk you might encounter while designing your development life cycle and deployment strategy.
One of the key challenges for multi-regional/multi-national projects is the lack of discipline in every region’s business processes. Many enterprises will be looking to get some sort of unification/standardization across these processes. But this is not an easy task, and you usually address it using a combination of the following:
You will delve more into the second and third points in the Recommend the Right Project Governance to Support Technical Decision-Making section. Next, you will explore the third most common risk you might encounter while designing your development life cycle and deployment strategy.
This is a common challenge for any new solution or technology introduced to an enterprise. People are often hesitant to accept things that they do not know by nature. Some users might find it difficult to leave their comfort zone and use a new solution or a completely new platform. Such a challenge requires a comprehensive change management process. This is not something a Salesforce Architect is expected to lead. However, you are expected to be familiar with some of its principles and the common ways of addressing them, which generally include a combination of the following:
You will cover the second and third points during this chapter, but the comprehensive communication plan is out of the scope of this book. You are encouraged to read more about it from other sources such as the book Practical Change Management for IT Projects by Emily Carr.
As a Salesforce CTA, you are expected to have strong knowledge of and experience with the different development methodologies used in IT, particularly Salesforce projects.
There are three main development and delivery methodologies:
Product development is broken into small incremental iterations, called sprints. Each normally lasts between 1 and 4 weeks and involves a cross-functional team working on planning, defining, designing, developing, testing, and releasing the different features included in each sprint.
It is worth mentioning that the right-level solution design is exactly the level of detail you are expected to provide during the CTA review board. You have seen several examples in the small scenarios you have covered already; this is exactly the level of detail your solution is expected to be at after the blueprinting phase.
The following diagram illustrates the difference between waterfall and agile:
Figure 10.1 – Waterfall and agile delivery methodologies
The following diagram illustrates the hybrid methodology:
Figure 10.2 – Hybrid delivery methodology
The flexible nature of the Salesforce Platform makes it very suitable for the agile methodology as it is easy to introduce changes compared to other platforms. However, in some cases, continuous design changes create a hard-to-maintain solution due to the lack of an early solution vision. This is better addressed in the hybrid methodology. This is the reason why you see an increased number of Salesforce projects delivered using the hybrid methodology.
Every software solution must pass a rigorous set of tests to ensure quality. You need to be familiar with the different types of tests and the environments that are most suitable to execute each of them.
The following table will help clarify this:
Test type |
Purpose |
Tools |
Unit test |
This test is used to check your solution’s building blocks’ validity, such as Apex code and different configurations. This is a must-have test, not only for the enforced Salesforce test coverage but also for the value it provides. It should be considered the first line of defense. Unit tests are executed every time new code is deployed to a particular instance. Please note that this could be used to test configured functionalities, not just code. |
Apex test classes |
Functional test |
This test is used to check the validity of a specific functionality’s behavior based on tailor-made test scenarios and use cases. It can be executed manually or automatically using specific tools. Automating these tests ensures that the exact scenario is executed every time they are needed, such as when new functionality is deployed to an environment. |
Manual test scripts and automated testing tools such as Selenium and Provar |
Integration test |
This test is used to check the validity of the solution and confirm that the overall parts of the solution work together as expected. This includes internal parts (such as code changes from multiple sandboxes) and external parts (such as the integration interfaces with other systems). |
Manual test scripts and automated testing tools |
User acceptance testing (UAT) |
This test is used to check specific UAT scripts/scenarios to ensure that the delivered functionality meets the business requirements. This is usually done side by side with the client. |
Manual test scripts |
Load test |
This test is used to gauge the system’s performance under normal conditions but after loading the environment with a huge dataset. This type of test is particularly crucial for solutions with a potentially large volume of objects. |
Manual test scripts and automated testing tools; data loading is done using ETL tools such as Informatica |
Performance test |
This test is used to gauge (and document) the system’s performance under both normal and edge conditions. You need to raise a case for Salesforce to plan this test. This test is particularly important for solutions with complex setups. |
Raise a case with Salesforce |
Smoke test |
This test is used to ensure the system’s overall stability. It normally validates a set of basic, common, and most frequently used functionalities by running a limited set of tests (typically, this is done in the production environment, but it could take place in other environments as well) for a period of pre-defined time. The results are then monitored. This test is based on a simple test you would execute on a newly bought machine; for example, you turn it on and see whether any smoke comes out of it. |
Manual test scripts and automated testing tools |
Table 10.1 – Purpose and tools of different test types that ensure quality of software solutions
Note
There are different types of tests you can perform, such as regression tests, security tests, penetration tests, and more. Regression tests usually include a combination of functional tests, integration tests, and smoke tests. Security and penetration tests are beyond the scope of this book.
In the Craft the Right Environment Management Strategy section, you will explore the environments that are most suitable to perform these tests.
Next, you will learn about the governance structure required for your projects.
Project governance is essential to the success of any project. Suppose that different teams are developing and releasing different features and functionalities. They could overwrite each other’s work, redevelop the same functionalities multiple times, create conflicting functionalities, modify the data model and the sharing model to negatively impact performance or security, and create a difficult system to change and maintain. In short, this could result in total chaos.
Can you imagine an instance where the situation is even more complicated? Imagine multiple Salesforce teams (probably from multiple service implementation partners) developing and releasing a series of functionalities and solutions. These solutions involve other integrated applications. One team is building a series of Apex classes to develop point-to-point integration interfaces. Another is using an integration middleware, and a third team has decided to develop their own versions of these Apex classes because they are unaware of the work of the first team or due to time constraints.
When different teams begin to introduce different processes and bring in disparate ways to use Salesforce (probably to meet the same objectives), this will inevitably create confusion within the organization. Moreover, this will likely result in a lot of duplicate work, which all enterprises should try to avoid in order to maintain an efficient setup.
This is a common challenge not only for complex implementations but even for more straightforward projects. This is exactly why enterprises create a Salesforce Center of Excellence (CoE).
A Salesforce CoE is a central governing body that deals with anything related to Salesforce. The CoE is a unified entity responsible for discussing, evaluating, challenging, and deciding on everything associated with Salesforce. It includes both business and technical members from across the enterprise. The CoE is concerned with topics such as the following:
The CoE can contain a sub-body that is responsible for challenging and approving every design decision that’s made. This is referred to as the design authority (DA).
The following diagram explains the standard structure of a Salesforce CoE:
Figure 10.3 – Proposed CoE structure
The actual implementation could vary from one client to the other. This is by no means a one-size-fits-all structure. You need to work out the right format for your client. During the review board, you need to come up with a proposal based on the scenario. The preceding diagram is a good place to start.
The DA may have the following structure:
Figure 10.4 – Proposed DA structure
The structure of the DA could also be different from one client to the other.
During the review board, you need to explain the value of a CoE, what roles are involved in it, and what activities and tasks are expected to be accomplished by the group. This all must be done in the context of the scenario and should address the scenario’s challenges.
You need to understand the different types of environments that are available in the Salesforce Platform/Salesforce Core Cloud. You should propose an environment management plan that includes the right type of environment, explain each environment’s use, and justify the rationale behind the selected environment type.
In organized development environments, the development process contains multiple stages (such as development, QA, UAT, and so on). The activities in each of these stages are accomplished in a different environment. This separation of concerns removes any dependencies and allows other teams to work in parallel. This multi-layered development environment is something very common in Salesforce, mainly because it is easy to create sandboxes.
Monolithic applications typically have three environments (development, testing, and production). In Salesforce, you can create more layers to provide an even more organized development and release cycle. The typical arrangement is development, CI environment (also known as the build environment), QA, staging, and production. Additional layers can be added, depending on the project’s nature, such as integration testing, hotfix, and a dedicated training environment.
The following table can be used to help you select the right combination of environments for each task:
Sandbox type |
Developing new features |
Testing |
Integration testing/performance testing |
Staging and UAT |
Scratch |
Excellent fit |
Good (unit test, functional tests, UI automated test) |
Not a good fit |
Not a good fit |
Developer |
Excellent fit |
Good (unit test, functional tests, UI automated test) |
Not a good fit |
Not a good fit |
Developer pro |
Good fit |
Excellent fit for feature testing; data storage can be used for limited regression testing |
Limited usage for integration testing; not a good fit for performance testing |
Not recommended |
Partial copy |
Ensure that the data subsets are fine to be shared with the developers |
Excellent fit for feature testing; data storage can be used for limited regression testing and production debugging (data subset) |
Good fit for integration testing (limited data subset); not a good fit for performance testing |
Good fit (limited data subset) |
Full copy |
Unusual; ensure it is fine to share data with the developers |
Best used for production debugging |
Excellent fit for integration testing; ideal for performance testing (considering that it has the same infrastructure as the production org) |
Excellent fit |
Table 10.2 – Fitness description of different sandbox types for different tasks
Note
You can find more details about the different sandbox types at the following link: https://packt.link/X5blZ.
The following link contains some information about the capabilities and limitations of the different types of sandboxes: https://packt.link/mEpe5.
The following table can further help you select the right combination of environments for each layer of your environment strategy:
Scratch |
Developer |
Developer pro |
Partial copy |
Full copy | |
Development |
X |
X |
X |
X | |
CI/build |
X |
X |
X | ||
QA |
X |
X |
X | ||
Integration testing |
X |
X | |||
Training |
X |
X | |||
UAT |
X |
X | |||
Load testing |
X | ||||
Performance testing |
X | ||||
Staging |
X |
Table 10.3 – Fitness description of different sandbox types to strategize the right combination of environments
In the solution for this chapter’s mini scenario, you will find an example of an environmental strategy that utilizes some of the environment types.
Understanding the value of these two topics is crucial to passing this domain. This goes beyond knowing the different tools and technologies on the market, as you should be able to explain the value of the concept of CI. The multi-layered development environment structure and the automated release management tools have become so popular to the point that some architects are overlooking the original reason CI was created. During the review board, you are expected to explain these details. You are expected not only to come up with the proposed release management but also to be ready to explain why you are suggesting it, as well as how it will solve its shared challenges.
Now, have a quick look at the details of CI:
The value is mainly in preventing conflicts and detecting them as early as possible. Developers work in different environments (except if they use a shared development environment, something you should try to avoid as it makes it difficult to trace the developed functionalities and tie them back to requirements). If they are aware of the changes that have been made by other developers, there will be fewer chances for conflicts.
Merging their work regularly and frequently (some practices recommend doing this multiple times a day) ensures that they are aware of the conflicts they have with others as early as possible. This work is typically merged into a specific source control’s build branch associated with the build environments.
To do that, the developers are expected to fetch the latest code base, which is usually available in the build branch. This could take place in multiple shapes and forms. It could be manual, or automated using a simple script, or even using an automation tool. An alternate approach is to build the entire developer sandbox using the code base, which is available either in the source control branch or in the build environment itself.
Scratch orgs are a good example of the first case, where a new scratch org is created and built using the metadata stored in source control every time a developer delivers a new feature.
Sandbox cloning is a good example of the second case: you can clone the build sandbox to create a new development environment with the latest code base.
You need to understand CI and the rationale behind it. It is recommended that you practice it if possible.
CI comes with its counterpart, continuous delivery (CD). CD is more straightforward; it complements CI and offers help to bridge the gap between development and operation by automating an application’s testing and deployment. Establishing the right multi-layered development environment strategy, selecting the right release management automation tools, and crafting a comprehensive automated test strategy will ensure that you have the right building blocks for CD.
The last element to cover here, which is a crucial part of your CI/CD strategy, is source control. Source control management (SCM) (also known as version control) provides you with the ability to track and manage code changes easily and efficiently. It helps you detect and resolve conflicts, and it provides you with a mechanism to roll back changes to an earlier version if needed. GitHub, Bitbucket, and GitLab are very popular SCM solutions.
The final part you need to know about and include in your release strategy is versioning. Each time you release a set of functionalities to production, they must have a version name/number. The version number has three common parts:
For example, version 2.1.3 can be translated into major version 2, minor version 1, and patch version 3.
Some might add a daily release number, but this is only applicable to businesses with a very rapid release cycle.
Now that you are familiar with this domain’s expectations, let’s look at a practical example of using this knowledge to design smooth and scalable development and deployment processes.
The following scenario describes a challenge with a particular client. The scenario has been designed to focus on challenges related to the development life cycle and its deployment. This is one of the domains that depends the least on other domains. Despite this, it is vital for the success of any project in real life.
Go through the scenario to build an understanding of the required solution. Then, go through the requirements one by one and try to solve them yourself, then compare your solution with the suggested one.
Make yourself familiar with the diagrams provided earlier (Figure 10.1, Figure 10.2, Figure 10.3, and Figure 10.4) in this chapter. Many of them can be reused with little or no changes. Learning them off by heart could save you a lot of valuable time while you are creating your review board’s solution. Without further ado, let’s proceed to the scenario.
Modern Furniture (MF) is a large furniture retailer operating in the United States. It has been using Salesforce Sales Cloud and Service Cloud for about 5 years. You, as their trusted consultant, have been requested to review their environments, particularly the release process. They are open to suggestions and would like to become more agile and quick to respond to market demands.
During the last 4 years, their release strategy utilized Visual Studio Code (VSC) as an IDE and a tool to deploy metadata between their different sandboxes and their production environment. From time to time, they also used change sets, although the developers favor VSC.
MF has the current situation:
MF investigates their issues internally and defines a set of requirements.
MF has been struggling with many issues recently. Some of them can be traced back to their governance model and release strategy. They shared the following requirements:
MF is looking for your help to rearchitect its current strategy to allow them to be more agile and responsive to its business needs.
Give yourself time to quickly skim through the scenario, understand the big picture, and develop some initial thoughts about the solution. This is a must-do step for every scenario. In this scenario, you will find some requirements that are related to each other and can be clubbed together.
MF is using two different clouds. The scenario did not specify that both these products are in the same environment, but considering the difficulties in release management, it is fair to assume so. Note that this challenge is not likely to appear in a multi-org setup.
MF used VSC and change sets to deploy metadata between environments. What does that information tell us?
It probably indicates that no SCM is included, which means that changes cannot be tracked and tied back to a requirement. Moreover, that could indicate that the environments are likely out of sync.
Out-of-sync environments could become a real challenge during deployments. One environment might have built some functionalities depending on a specific system state and designed all its tests based on that. While releasing to production, the system might be in a different state, which will cause some tests to fail and some functionalities to behave irregularly.
You also learned that there are two main teams working for PFM and that they operate in different release cycles. This usually occurs in parallel projects but could be a significant risk for the platform in the short and long term.
You also learned that each developer is using a separate sandbox. Now, use all this information to build your landscape architecture and current development life cycle diagram.
Your landscape architecture may look as follows:
Figure 10.5 – Landscape architecture
On the other hand, your development life cycle diagram may look as follows:
Figure 10.6 – Development life cycle diagram – first draft
Now that you understand the current situation, move on and look at the shared requirements.
Now, go through the requirements shared by MF, craft a proposed solution for each requirement, and update your diagrams accordingly to help with the presentation. Start with the first requirement, which begins with the following:
This requirement should be an assertion of your previous expectations. If the deployments are taking place using change sets and the IDE, they likely lack an auditable record. This can be overcome with a very high level of discipline, of course, but from my experience, that is nearly impossible to achieve.
There is a solution, and it has been battle-tested for years in custom software development rather than with Salesforce. That solution is SCM. You came across the concept and value of SCM earlier in this chapter. Your proposed solution could be as follows:
Note the relationship between this requirement and the next: the lack of auditable records and the reported code conflicts can both be addressed using the right release management process and tools. You need to go through all these requirements to come up with a comprehensive solution that is fit for the given business challenge rather than something generic. You might decide to split up your answer during the presentation and map it to each requirement. However, the proposed solution should consider all of them.
Also, note that you need to explain the value of SCM shortly and concisely. Remember that the audience is supposed to be CXOs from the client company. They know what SCM is, but you need to explain the value it adds to your solution.
Now, you can move on to the next requirement:
Both development teams reported challenges during deployment, such as the inability to predict the result.
This is another thing you could predict, even without MF reporting it. It is a common challenge when parallel teams are developing new features in silos. They have no idea what the other team is building, and even if they do, they have no mechanism to ensure that it would not conflict with something else they are developing.
This challenge is the key reason why two of the concepts you encountered earlier in this chapter were created: multi-layered development environments and CI.
You need to utilize your proposed development life cycle diagram to explain the proposed solution. Your proposed solution could be as follows:
Your proposed development life cycle diagram may look as follows:
Figure 10.7 – Development life cycle diagram – final
This pretty much answers this requirement. Note that this diagram is almost complete, even at this stage. This diagram is one of those that you would likely build in one go once you have gone through all the related requirements, unlike other diagrams, which you would progressively develop.
Now, continue to the next requirement and build your end-to-end development and release management solution:
The current process is creating several conflicts between the two development teams.
Your proposed solution could be as follows:
Again, remember that it is not enough to know what the ideal setup should be. This can be easily gathered from different online resources. You should also know why it has been designed like that in the first place and defend the rationale behind it.
This requirement could be addressed by introducing a more structured testing mechanism. The multi-layered development environment that you proposed should automatically address part of that as it reduces the number of errors created by code conflicts. But to further improve this process, you can utilize automated testing tools and ensure that the unit tests are used properly. Your proposed solution could be as follows:
The QA team is overwhelmed with tasks. They cannot keep up with the developments and are consistently leaking untested bugs.
The previously proposed solution addresses most of this. Your proposed solution could be as follows:
Now, move on to the next requirement, which starts as follows:
The last deployment took more than 5 hours. The actual deployment time was estimated to be less than 30 minutes.
Again, most of this is addressed by the previous points. Your proposed solution could be as follows:
Next, move on to the next and final requirement, which starts as follows:
Currently, there have been a lot of challenges regarding the existing environment setup.
The teams are unsure whether they should continue using a developer sandbox per developer or have each team share a single sandbox.
This is something you addressed in your previously proposed solution, but do not skip any requirements. Make sure you cover everything in your presentation. Your proposed solution could be as follows:
I propose continuing to use a developer sandbox per user. We can also investigate the possibility of using scratch orgs, as we previously mentioned. However, in both cases, I do not see the members of each team sharing a single development org, as this will make it nearly impossible to track all the changes happening and tie them back to a user story or task. This means we lose the desired transparency, which is one of MF’s main requirements.
That concludes this scenario. The diagrams you created earlier (Figure 10.5 and Figure 10.7) are still valid.
In this chapter, you have dived into the details of the Salesforce development life cycle and deployment domain. You learned what is expected from a CTA to cover and the level of detail. You dissected some key principles, such as DevOps, CI/CD, multi-layered development environments, and SCM. Then, you learned about their importance and their impact on the development and release cycle.
As you might have already noticed, the scope of this domain is limited. The key challenge with such domains is in the depth of knowledge, understanding why some best practices are there and how to implement them.
Then, you tackled a small hypothetical scenario that focused on the development life cycle and deployment, and you provided solutions for it and created some catchy presentation pitches. You developed a development and release diagram that could be easily reused for other scenarios (with minor changes), and you learned how to present this to an audience to capture their attention and provide them with detailed information and rationale behind the proposal.
In the next chapter, you will move on to the seventh and final domain you need to master, which is communication.