NEW
Font size
WorksheetsTest Driven Development
Total questions: 14
Worksheet time: 7mins
What is the most basic type of developer level test?
Integration Test
Universal Test
Unit Test
Basic Test
Which of the following does not help you write a unit test?
JUnit
Mockito
Lombok
PowerMock
Which of the following is not a desirable quality of "a unit test"?
Tests one property at one time
Fast
I/O or File Operations
Covering a small portion of code
What does @InjectMocks do?
Create an instance of test class
Create an instance of test class and inject any dependencies as Mocks
Inject Mocks in already created objects
None of the above
Which of the following will help you identify unused dependencies in the code?
Unit Testing
Integration Testing
Static Code analysis
All of the above
Which of the following is first stage of TDD?
Write Code
Write Test
Refactor
Execute Test
What is the significance of writing a failing test?
We should not. We should focus on writing a test that passes
A failing test shows that some code change is required in our program. If it is not failing, no change required.
A failing test shows that the previous developer didn't do a good job.
A failing test gives you an opportunity to enhance code coverage
What is a test?
A measure to check if the code meets the defined specifications
A measure to check if the code is visually beautiful
A measure to check if the code contains security vulnerabilities?
A measure to increase code coverage
What's true about Mocking in a unit test?
Making fun of a unit test.
Mocking is a way of dependencies injection, without worrying about the behaviour
Mocking allows us to change the behaviour of the class under test
Mocking is discouraged in unit testing
How can we create a dummy environment for testing REST Apis using SpringBoot?
JUnit
environment.properties
MockServer
MockMvc
At what stage should I refactor my code as per TDD?
Whenever you like
After writing a failing test case
At the time of writing a test case
After the test case is green
Which of the following is not a stage in TDD?
Red
Green
Refactor
Commit
I need to test if I am able to access data from an API. What type of test am I going to write?
Unit Test
Mocked Unit Test
Integration Test
Functional test
I need to test if a service method is fine or not. What type of test do I need to write?
Unit Test
Integration Test
Selenium Test
Black Box Test
