wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

junit

Total questions: 20

Worksheet time: 10mins

Name
Class
Date
1.

which of the following are framework of testings (testing frameworks)

a)

JUNIT

b)

JUNIT and WordPress

c)

Selenium

d)

Selenium and REST

2.

MAVEN needs

a)

web.xml

b)

manifest.yml

c)

pom.xml

d)

all of them

3.

@Test(expected = RuntimeException.class)

...

Assert.assertEquals(calculadora.suma(null, "2"), 3);

a)

Assert OK

b)

Assert Failure

c)

Assert Exception

4.

Assert.assertNotEquals(calculadoraSimple.suma("5", "2"), 3);

a)

Assert OK

b)

Assert Failure

c)

Assert Exception

5.

Assert.assertEquals(calculadoraSimple.suma(null, "2"), 5);

a)

Assert OK

b)

Assert Failure

c)

Assert Exception

6.

Assert.assertEquals(calculadoraSimple.suma("1", "2"), 5);

a)

Assert OK

b)

Assert Failure

c)

Assert Exception

7.
The best way to avoid problems is to write the program before writing the algorithm.
a)
True
b)
False
8.

What is the most basic type of developer level test?

a)

Integration Test

b)

Universal Test

c)

Unit Test

d)

Basic Test

9.

Is JUnit only report the first failure in a single test ?

a)

Yes

b)

No

10.

Is it necessary to write the test case for every logic?

a)

Yes

b)

No

11.

What is the use of Junit

a)

To increase code coverage

b)

To test unit of code thoroughly

c)

To integrate with other units of code

12.

What does assertSame() method use for assertion?

a)

equals() method

b)

isEqual() method

c)

==

d)

compare() method

13.

Which of the below is an incorrect annotation with respect to JUnits?

a)

@Junit

b)

@AfterEach

c)

@Test

d)

@BeforeClass

14.

Which method is used to verify the actual and expected results in Junits?

a)

equals()

b)

isEqual()

c)

==

d)

assert()

15.

JUnits are used for which type of testing?

a)

Blackbox Testing

b)

Unit Testing

c)

System Testing

d)

Integration Testing

16.

Assert contains a set of assert methods.

a)

A - true

b)

B - false

17.

@RunWith and @Suite annotation are used to run the suite test.

a)

A - false

b)

B - true

18.

Which of the following method of Assert class checks that an object is null?

a)

A - void assert(Object object, boolean toCheckAsNull)

b)

B - void assertCheck(Object object, boolean toCheckAsNull)

c)

C - void assertNull(Object object)

d)

D - void assertChecks(Object object, boolean toCheckAsNull)

19.

Which of the following annotation causes that method run once after all tests have finished?

a)

A - @Test

b)

B - @After

c)

C - @BeforeClass

d)

D - @AfterClass

20.

Which of the following describes Testing correctly?

a)

A - Testing is the process of checking the functionality of the application whether it is working as per requirements.

b)

B - Testing is the testing of single entity (class or method).

c)

C - Both of the above.

d)

D - None of the above.