Unit testing Flashcards

1
Q

What is JUnit?
What principle does it follow?
What idea does it support?

A

It’s an open-source testing framework for Java applications.

Follows TDD principle, where tests are written before the actual code implementation.

It supports the creation of test cases defining expected result & validating the actual result against the expected one.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What features does Junit provide?

A
  • framework for org & executing tests
  • annotations to identify test methods
  • assertions for testing exp. results
  • test runners for running tests
  • can be org into test suites
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Unit test case
What does it require to achieve the desired res quickly?

A

Part of code which ensures that another part of code (method) works as expected.

Requires test framework (ex: JUnit)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is Unit Test Case characterized by?

A

By a known input & expected output, which is worked out before the test is executed.
The known input should test a pre-condition and the output tests the post-condition

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Unit Test

A

A type of software testing where individual units / components of a sw system are tested to ensure proper functionality.

__ are designed to verify that each unit of code performs as expected & produces the desired output given specific input

How well did you know this?
1
Not at all
2
3
4
5
Perfectly