New Year Sale 2026! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Adobe AD0-E134 Exam - Topic 6 Question 16 Discussion

Actual exam question for Adobe's AD0-E134 exam
Question #: 16
Topic #: 6
[All AD0-E134 Questions]

A developer is on an AEM application that is being used to calculate an employee's salary. The calculation is done in an OSGi service called CalculationService. This service class has a dependency on one other service, called the EmployeeService.

How should the developer make sure that the critical code in the CalculationService has a high unit test coverage?

Show Suggested Answer Hide Answer

Contribute your Thoughts:

0/2000 characters
Josphine
3 months ago
Not sure if C is the best option, what if the mock doesn't cover all scenarios?
upvoted 0 times
...
Gail
3 months ago
B is just not practical, you need mocks for unit tests!
upvoted 0 times
...
Maryrose
3 months ago
Wait, why would you disable calls to EmployeeService? That sounds risky.
upvoted 0 times
...
Leota
4 months ago
I think A could work too, but C seems more effective.
upvoted 0 times
...
Leatha
4 months ago
C is definitely the way to go! Mocking the EmployeeService makes sense.
upvoted 0 times
...
Chuck
4 months ago
I wonder if using a feature flag to disable calls to the EmployeeService would really help with unit testing. It seems like it could complicate things more than necessary.
upvoted 0 times
...
Kerry
4 months ago
Instantiating the EmployeeService directly seems risky since it could lead to integration issues. I feel like mocking is safer, but I can't recall the exact details.
upvoted 0 times
...
Tamekia
4 months ago
I remember a similar question where we had to mock dependencies to isolate the service being tested. Option C sounds familiar to that practice.
upvoted 0 times
...
Lashawnda
5 months ago
I think using a mock framework to inject the EmployeeService makes sense, but I'm not entirely sure if that's the best approach for unit testing.
upvoted 0 times
...
Ranee
5 months ago
I'm leaning towards option C. Mocking the EmployeeService seems like the most straightforward way to ensure high unit test coverage for the CalculationService, without having to worry about the dependencies.
upvoted 0 times
...
Lorriane
5 months ago
Hmm, option D with the feature flag seems interesting, but I'm not sure if that's the best approach. Wouldn't that just disable the calls to the EmployeeService, rather than actually testing the CalculationService in isolation?
upvoted 0 times
...
Edison
5 months ago
I think option A is the way to go. Using a mock framework to inject the CalculationService directly seems like the cleanest and most reliable way to test the critical code without any external dependencies.
upvoted 0 times
...
Ettie
5 months ago
I'm a bit confused here. Wouldn't option B also work, where I instantiate the EmployeeService and pass it to the CalculationService constructor? I'm not sure if that's the best approach, but it might be worth considering.
upvoted 0 times
...
Lisbeth
5 months ago
This seems like a straightforward question. I'd go with option C - using a mock framework to inject the EmployeeService. That way, I can test the CalculationService in isolation without having to worry about the dependencies.
upvoted 0 times
...
Ryan
5 months ago
Hmm, I'm a bit unsure about this one. The options seem to cover different aspects of security controls. I'll need to carefully read through each choice and think about which one best matches the description.
upvoted 0 times
...
Caitlin
5 months ago
I'd go with option D. Giving upper management an executive summary and evaluation of overall quality performance is the most concise and impactful way to communicate the audit results. The other options are too detailed or narrow in focus.
upvoted 0 times
...
Marnie
5 months ago
This question seems pretty straightforward. I think I can handle it if I just focus on the key details.
upvoted 0 times
...
Nelida
5 months ago
Hmm, I'm a bit unsure about this one. I know it's a normal distribution, but I'm not sure how to approach finding the probability given the mean and variance.
upvoted 0 times
...
Jolanda
10 months ago
Option A? Really? Mocking the CalculationService itself? That's like trying to test a calculator by mocking the calculator. *chuckles* I think we all know what the right answer is here.
upvoted 0 times
Taryn
9 months ago
C) Use a mock framework in the unit test to inject the EmployeeService
upvoted 0 times
...
Shenika
9 months ago
B) Instantiate the EmployeeService in the unit test and pass it to the constructor of the CalculationService
upvoted 0 times
...
Jaclyn
9 months ago
A) Use a mock framework in the unit test to inject the CalculationService
upvoted 0 times
...
...
Blossom
10 months ago
Option D? Seriously? Disabling the calls to the EmployeeService? That's like trying to fix a leaky faucet by turning off the water supply. Not a good solution.
upvoted 0 times
Katlyn
8 months ago
C) Use a mock framework in the unit test to inject the EmployeeService
upvoted 0 times
...
Salome
9 months ago
B) Instantiate the EmployeeService in the unit test and pass it to the constructor of the CalculationService
upvoted 0 times
...
Roxanne
9 months ago
A) Use a mock framework in the unit test to inject the CalculationService
upvoted 0 times
...
...
Scarlet
10 months ago
Option B might work, but it's not the most efficient. Instantiating the EmployeeService in the test and passing it to the CalculationService constructor seems like a lot of extra work.
upvoted 0 times
...
Nikita
10 months ago
I agree with Alesia. Mocking the EmployeeService is the best approach to ensure high unit test coverage for the critical code in the CalculationService.
upvoted 0 times
Berry
9 months ago
C) Use a mock framework in the unit test to inject the EmployeeService
upvoted 0 times
...
Truman
10 months ago
B) Instantiate the EmployeeService in the unit test and pass it to the constructor of the CalculationService
upvoted 0 times
...
Valda
10 months ago
A) Use a mock framework in the unit test to inject the CalculationService
upvoted 0 times
...
...
Fidelia
11 months ago
But using a mock framework allows for better isolation of the code being tested, making it easier to control the behavior of the EmployeeService.
upvoted 0 times
...
Roxanne
11 months ago
I disagree, I believe instantiating the EmployeeService in the unit test and passing it to the constructor of the CalculationService is more reliable.
upvoted 0 times
...
Alesia
11 months ago
Option C is the way to go. Mocking the EmployeeService will help us isolate the CalculationService and focus on testing its core logic without any external dependencies.
upvoted 0 times
Lai
9 months ago
Using a mock framework in the unit test for the EmployeeService is definitely the way to go for high unit test coverage.
upvoted 0 times
...
Delmy
9 months ago
Mocking the EmployeeService will allow us to control its behavior and focus on testing the CalculationService's logic.
upvoted 0 times
...
Fausto
9 months ago
Agreed, using a mock framework to inject the EmployeeService in the unit test will make it easier to test the critical code.
upvoted 0 times
...
Fatima
9 months ago
I think option C is the best choice. Mocking the EmployeeService will help us isolate the CalculationService for testing.
upvoted 0 times
...
...
Fidelia
11 months ago
I think using a mock framework to inject the CalculationService is the best option.
upvoted 0 times
...
Timothy
11 months ago
But using a mock framework allows for better isolation and control over the test environment.
upvoted 0 times
...
Nathalie
11 months ago
I disagree, I believe instantiating the EmployeeService in the unit test is more reliable.
upvoted 0 times
...
Timothy
11 months ago
I think using a mock framework to inject the CalculationService is the best option.
upvoted 0 times
...

Save Cancel