Home / CSE MCQs / JUnit MCQs :: JUnit Mastering JUnit

CSE MCQs :: JUnit MCQs

  1. Which Hamcrest matcher is just like the && operator?
  2. A.
    Is
    B.
    Anything
    C.
    sameInstance
    D.
    allOf

  3. ______________ Hamcrest matcher can be used to match absolutely everything.
  4. A.
    Is
    B.
    AnyOf
    C.
    Anything
    D.
    Not

  5. AOP forms a basis for __________
  6. A.
    Functional Development
    B.
    Object Oriented Programming
    C.
    Datafield Development
    D.
    Aspect Oriented Software Development

  7. The _________ rule can be used to test both exception type and message.
  8. A.
    Expected
    B.
    ExpectedException
    C.
    CatchException
    D.
    Catch

  9. In what order is multiple @Before annotated methods run?
  10. A.
    Oldest First
    B.
    Newest First
    C.
    Randomly
    D.
    According to argument list

  11. To avoid overdesigning an interface, usually ____________ is used.
  12. A.
    Agile Development
    B.
    Test Driven Development
    C.
    Base Design Development
    D.
    Waterfall Development

  13. Constructor-based DI is accomplished when the container invokes a class constructor with ____________
  14. A.
    A number of arguments
    B.
    No argument
    C.
    Just one argument
    D.
    Null objects

  15. Inversion of Control is used to increase __________ of the code.
  16. A.
    Functionality
    B.
    Cleanliness
    C.
    Effectiveness
    D.
    Modularity

  17. Timeout testing is ____________
  18. A.
    Software Dependent
    B.
    Hardware Dependent
    C.
    Software and Hardware Dependent
    D.
    Software and Hardware Independent

  19. The Timeout Rule implements which interface?
  20. A.
    Timeout
    B.
    Test
    C.
    TestingTimeout
    D.
    TestRule