어느 Salesforce Developer의 개발 성장기

[Salesforce Certified Platform Developer1] Dump 오답 일기12 본문

Salesforce Dump/Platform Developer1 Dump

[Salesforce Certified Platform Developer1] Dump 오답 일기12

Developer_Foryou 2020. 3. 8. 01:05

※ 각 자격증별 Dump는 시험을 준비하면서, 
웹상에 공개된 Dump와 유료 Dump를 풀면서 자주 틀렸던 문제를 위주로 작성하였습니다. 
오래된 문제도 간혹 있기 때문에 버전에 따라 답이 다른 경우도 있으며,
개인이 공부하면서 푼 문제이기 때문에 오답일 가능성도 있습니다.
이점 유의하여 공부하시길 바랍니다.

 

When are code coverage calculations updated?

A. When unit tests are run on an organization. ( Ans )
B. When Apex code is saved.
C. When changes are made to an organization’s configuration.
D. When a deployment is validated.

What are two testing considerations when deploying code from a sandbox to production? Choose 2 answers

A. Apex Code requires 100% coverage.
B. 75% of tests must execute without failure.
C. 100% of tests must execute without failure. ( Ans )
D. Apex Code requires 75% coverage. ( Ans )

A developer is asked to write negative tests as part of the unit testing for a method that calculates a person’s age based on birth date. What should the negative test include?

A. Asset that a null value is accepted by the method.
B. Assert that past dates are accepted by the method.
C. Throwing a custom exception in the unit test.
D. Assert that future dates are rejected by the method. ( Ans )

A developer needs to avoid potential system problems that can arise in a multi-tenant architecture. Which requirement helps prevent poorly written applications from being deployed to a production environment?

A. All validation rules must be active before they can be deployed.
B. Unit tests must cover at least 75% of the application’s Apex code. ( Ans )
C. SOQL queries must reference sObjects with their appropriate namespace.
D. All Apex code must be annotated with the with sharing keyword.

A developer has a unit test that is failing. To identify the issue, the developer copies the code inside the test method and executes it via the Execute Anonymous Apex tool. The code then executes without failing. Why did the unit test fail, but not the Execute Anonymous?

A. The test method has a syntax error in the code.
B. The test method uses a try/catch block.
C. The test method relies on existing data in the database. ( Ans )
D. The test method calls an @future method.

What can a developer use to determine if the core Apex code exceeds any governor limits in a test class during bulk execution?

A. Test.getDMLStatement()
B. @TestVisible
C. Limits, startTest, stopTest ( Ans )
D. @TestSetup

A developer created a visualforce page and a custom controller with methods to handle different buttons and events that can occur on the page. What should the developer do to deploy to production?

A. Create a test page that provides coverage of the custom controller
B. Create a test class that provides coverage of the visualforce page
C. Create a test class that provides coverage of the custom controller ( Ans )
D. Create a test page that provides coverage of the visualforce page

A developer wrote a unit test to confirm that a custom exception works properly in a custom controller, but the test failed due to an exception being thrown. What steps should the developer take to resolve the issue and properly test the exception?

A. Use the finally block within the unit test to populate the exception
B. Use database methods with all or none set to False
C. Use try/catch within the unit test to catch the exception ( Ans )
D. Use Test.isRunningTest() within the custom Controller

How should a developer avoid hitting the governor limits in test methods?

A. Use Test.startTest() to reset governor limits ( Ans )
B. Use @TestVisible on methods that creates records
C. Use @IsTest (SeeAllData=true) to use existing data
D. Use Test.loadData() to load data from a static resource.

Comments