Skip to content
Configurations - Do Not Modify
Reset All Questions
Questions
3
Category
Dollar Amount
Question
Answer
Mark Question Incorrect
Mark Question Correct
Show Answer Button
Show Answer
Overall approach
5
$200
What is the AAA test structure?
Arrange - Action - Assert
Incorrect
Correct
Show Answer
$400
What is characterisation testing?
A characterization test is a means to describe the actual behavior of an existing piece of software, and therefore protect existing behavior of legacy code against unintended changes via automated testing (Wikipedia.org)
Incorrect
Correct
Show Answer
$600
What are the steps of TDD in developing new features?
Write test - run the test (red) - implement & design until test is green - refactor & repeat
Incorrect
Correct
Show Answer
$800
What is Tell-Don't-Ask principle in object-oriented programming?
Rather than asking an object for data and acting on that data, we should instead tell an object what to do. This encourages to move behaviour into an object to go with the data. ()
Incorrect
Correct
Show Answer
$1,000
What is the benefit of TDD?
TDD helps developers to design the logic in code efficiently, because it asks us to turn software requirements into test cases before software is developed. ( and Wikipedia.org)
Incorrect
Correct
Show Answer
Unit & component tests
5
$200
What is the difference between @Before and @BeforeAll in Mockito?
They are exactly the same thing. @BeforeAll is used in Junit5 and @Before in Junit4. But they are not @BeforeEach.
Incorrect
Correct
Show Answer
$400
What do @ValueSource and @CsvSource both do in Mockito?
They allow us to execute a single test method multiple times with different parameters (aka parameterised tests).
Incorrect
Correct
Show Answer
$600
What are @Mock and @InjectMocks in Mockito?
@Mock creates a mock, and @InjectMocks creates an instance of the class and injects the mocks that are created with the @Mock annotations into this instance.
Incorrect
Correct
Show Answer
$800
How to mock a void method in Mockito?
doNothing().when(mockObject).methodCalledDuringExecution(any());
Incorrect
Correct
Show Answer
$1,000
Why can’t I trust the test coverage % completely?
Because you only need to cover one branch in a private method to have it counted as covered in the report. Remember to step into private methods to check all branches.
Incorrect
Correct
Show Answer
Component orchestration tests & integration tests
5
$200
What is @MockBean in Mockito?
@MockBean adds mock objects to the Spring application context. The mock will replace any existing bean of the same type in the application context. This annotation is useful in integration tests where a particular bean, like an external service, needs to be mocked. When we use the annotation on a field, the mock will be injected into the field, as well as being registered in the application context.
If your test needs to rely on the Spring Boot container and you also want to add or mock one of the container beans then @MockBean from Spring Boot is the way.
Incorrect
Correct
Show Answer
$400
Which takes less effort to create - frontend or backend end-to-end test automation?
Backend
Incorrect
Correct
Show Answer
$600
Which paths should be covered in integration tests?
Only the critical paths (happy or sad) that cannot be fully tested in unit or component tests.
Incorrect
Correct
Show Answer
$800
Which paths should be covered in smoke tests?
Only 1-2 paths (usually happy) to check any major differences from what we see in earlier environments.
Incorrect
Correct
Show Answer
$1,000
What is a user journey and what are the benefits of testing user journeys?
A user journey is simply the specific steps a user has to perform to accomplish something on a your website.
User journey tests assure the correctness of your website by simply walking the same paths that your users already do. ()
Incorrect
Correct
Show Answer
Performance tests
5
$200
What is one of the goals of a stress test?
To find the breaking point or the critical point of the service when the service cannot deliver good performance to users anymore.
To find the root cause of the degraded performance at those points.
Incorrect
Correct
Show Answer
$400
What is one of the goals of a load test?
To find the performance metrics at a specific and realistic load.
To find out how to optimise the current performance if needed.
Incorrect
Correct
Show Answer
$600
What is one of the goals of a soak test?
To find the performance metrics when the service is stressed with a specific load for a period of time (e.g. X sec, X min or X hours) that is realistic in the user usage of the service.
To find out how to optimise the current performance if needed.
Incorrect
Correct
Show Answer
$800
What is think time?
The time elapsed between 2 user actions/ test steps (e.g. API calls, clicking of buttons) by 1 user. It is used only in load testing and not stress testing. Different test steps have different think times.
Incorrect
Correct
Show Answer
$1,000
What is pacing time?
The time span during which the peak load is spread out (e.g. 1000 requests spread out in 1 hour). This is used in load test to simulate a realistic peak time behaviour by all of your users of your business.
Incorrect
Correct
Show Answer
Frontend tests
5
$200
What is the goal of CDN?
to provide high availability and performance by distributing the service spatially relative to end users (Wikipedia.org)
Incorrect
Correct
Show Answer
$400
What is the range of a normal DNS lookup time?
20-120 msec for the 1st time the browser loads a website
Incorrect
Correct
Show Answer
$600
At what load time do users start to feel that a website is slow?
1 sec = 1000 msec
Incorrect
Correct
Show Answer
$800
What is the main benefit of contract testing between services?
Contract tests help to de-couple dependency during testing between services, so that each service can have its own pace of development without negatively impacting each other’s development or tests.
Incorrect
Correct
Show Answer
$1,000
Why is contract testing used in backend-frontend integration more often than integration with other 3rd party API’s?
Because contract tests require both sides of the integration to use the same contract test broker, who maintains the contracts for both sides. This is difficult to do if the dev teams for the provider side and the consumer side are not in the same organisation.
Incorrect
Correct
Show Answer
2
What is the difference between thenReturn() vs thenAnswer()?
Method thenReturn() needs a fixed object which will be returned everytime we call the method.
The method answer() will be invoked when we call mocked method from mocked object. It is used for dynamic/runtime response.
Incorrect
Correct
Show Answer
Incorrect
Correct
Show Answer

Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.