SP Software Development Lifecycle 2 — Questions and Answers
Question 1: Which Salesforce tool allows developers to compare metadata between two orgs or between an org and a local project?
- Org Diff in VS Code Salesforce Extension (Correct answer)
- Change Set Comparison Tool
- Metadata API compareMetadata()
- Workbench Metadata Diff
Correct answer: Org Diff in VS Code Salesforce Extension
The Salesforce Extension Pack for VS Code includes an Org Diff feature that compares metadata between orgs or between a local project and an org.
Question 2: In a Salesforce DX project, what is the purpose of the .forceignore file?
- It lists metadata types excluded from source tracking and push/pull operations. (Correct answer)
- It defines the API version for all deployments.
- It specifies which users can deploy to production.
- It stores authentication tokens for connected orgs.
Correct answer: It lists metadata types excluded from source tracking and push/pull operations.
The .forceignore file tells SFDX which files and directories to ignore during source push/pull operations, similar to .gitignore.
Question 3: A developer needs to run Apex tests only for classes modified in the current feature branch before merging. Which CI strategy best supports this?
- Run only tests in the delta change set identified by the deployment tool (Correct answer)
- Always run all 30,000 Apex tests in the org
- Skip tests entirely in non-production pipelines
- Run tests manually after every merge to main
Correct answer: Run only tests in the delta change set identified by the deployment tool
Delta deployments identify only changed components and run associated tests, reducing pipeline time while still validating changes.
Question 4: What does the 'validate' command do in Salesforce CLI deployments?
- Performs a dry-run deployment that runs tests but does not commit changes to the org (Correct answer)
- Validates that the sfdx-project.json file has no syntax errors
- Checks SOQL queries for governor limit violations before deployment
- Confirms that the connected app has the correct OAuth scopes
Correct answer: Performs a dry-run deployment that runs tests but does not commit changes to the org
The validate command (or --checkonly flag) tests the deployment against the org without saving any changes, allowing quick-deploy later.
Question 5: Which branching strategy uses short-lived feature branches merged directly into a main trunk, emphasizing frequent integration?
- Trunk-Based Development (Correct answer)
- GitFlow
- Release Branching
- Environment Branching
Correct answer: Trunk-Based Development
Trunk-Based Development keeps feature branches short-lived and merges into the main trunk frequently to minimize merge conflicts.
Question 6: A Salesforce org has 87% Apex code coverage overall but a specific new class has 0% coverage. Can the deployment proceed to production?
- No, every Apex class and trigger must have at least 1% coverage and the org total must reach 75%. (Correct answer)
- Yes, overall org coverage of 75%+ is the only requirement.
- No, every class must individually have at least 75% coverage.
- Yes, code coverage rules only apply to triggers, not classes.
Correct answer: No, every Apex class and trigger must have at least 1% coverage and the org total must reach 75%.
Salesforce requires that each individual Apex class and trigger must be covered by at least one test line, plus the org-wide average must be 75%.
Question 7: Which Salesforce feature allows a team to package a group of related metadata and deploy it as a versioned, upgradeable unit?
- Unlocked Packages (Correct answer)
- Change Sets
- Metadata API CRUD deployment
- Static Resources ZIP deployment
Correct answer: Unlocked Packages
Unlocked Packages enable versioned, modular packaging of metadata that can be installed and upgraded across orgs in a controlled way.
Which Salesforce tool allows developers to compare metadata between two orgs or between an org and a local project?