Unit testing Flashcards
What is JUnit?
What principle does it follow?
What idea does it support?
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.
What features does Junit provide?
- 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
Unit test case
What does it require to achieve the desired res quickly?
Part of code which ensures that another part of code (method) works as expected.
Requires test framework (ex: JUnit)
What is Unit Test Case characterized by?
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
Unit Test
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