--:--









Quiz for Unit Testing

Course: JAVA | Subject: Java | Topic: Other Key Subjects



Logo

Q1: What is the main purpose of unit testing?

Logo

Q2: Which Java framework is commonly used for unit testing?

Logo

Q3: Which annotation is used in JUnit to define a test method?

Logo

Q4: Which method is executed before every test case in JUnit?

Logo

Q5: What is test coverage?

Logo

Q6: Which assertion checks if two values are equal in JUnit?

Logo

Q7: What does mocking mean in unit testing?

Logo

Q8: Which tool is commonly used for mocking in Java?

Logo

Q9: Which annotation is used to run code before all test methods?

Logo

Q10: Which JUnit version introduced annotations like @Test, @Before, @After?

Logo

Q11: What does the assertTrue() method do?

Logo

Q12: Which annotation is used to disable a test method in JUnit 5?

Logo

Q13: What does TDD stand for in software development?

Logo

Q14: Which assertion checks if a value is null?

Logo

Q15: What does @AfterEach do in JUnit 5?

Logo

Q16: Which annotation is used to inject mocks in Mockito?

Logo

Q17: In unit testing, what is a test suite?

Logo

Q18: What does the assertNotNull() method verify?

Logo

Q19: Which tool can generate code coverage reports in Java?

Logo

Q20: What is the benefit of unit testing?

Are you ready to start test? Set your time limit