Self-tests → used as an additional check in the system complementary to the test suite
Assertions
- A boolean expression at a specific point in a program.
- In java asserts can be enabled or disabled (then they will never throw an error)
- In intelliJ these are automatically enabled. Otherwise add -ea (enable assertions)
- However these do no replace unit tests
- Assert
- Assertion Error
- Example
Pre & Post Conditions
- Hoare Triples
- Pre-Conditions
- Post-Conditions
Invariants
These are conditions that always need to hold, before and after a method's execution.