Unit Testing In Java

7 Questions | Total Attempts: 433

SettingsSettingsSettings
Please wait...
Unit Testing In Java

.


Questions and Answers
  • 1. 
    What is test-driven development (TDD)?
    • A. 

      Software testers do the development in TDD

    • B. 

      The code/implemented and then tests are written.

    • C. 

      The Tests are normally written before the Code

    • D. 

      TDD does not require unit tests to be written

  • 2. 
    Which class your Unit Test should extend to make it a JUnit Test?
    • A. 

      JUnitTest

    • B. 

      UnitTest

    • C. 

      JUnitCase

    • D. 

      TestCase

  • 3. 
    What annotations from the following do you use within your JUnit Test class?
    • A. 

      @Before, @After, @Test

    • B. 

      @BeforeTest, @AfterTest

    • C. 

      @TestTest, @TestThis

    • D. 

      @TestClass, @TestMethod

  • 4. 
    @Before gets executed before each test. True/False?
    • A. 

      True

    • B. 

      False

  • 5. 
    Who is expected to write Unit Tests?
    • A. 

      Software Tester

    • B. 

      Designer

    • C. 

      Developer

    • D. 

      Client

  • 6. 
    When should you write Unit Tests?
    • A. 

      When you start coding

    • B. 

      In Parallel with your coding

    • C. 

      Only when needed

    • D. 

      At the end when your application is ready

  • 7. 
    What is the smallest Unit you test/target in your Unit Testing?
    • A. 

      Constants and Variables

    • B. 

      Class

    • C. 

      Method and functions

    • D. 

      Package