This type of test would perform a check such as a method addItem() updates a list correctly.
What is a unit test?
You are validating that your SQL queries actually execute correctly.
What is a real dependency (integration test)
This type of test fails intermittently without any changes to the code.
What is a flaky test?
In JUnit, this method is used to assert that a specific exception type is thrown.
What is assertThrows()?
A unit test that hits the real database has this type of leak
What is an integration leak?
This type of test might verify that a controller calls a business layer when a button is clicked.
What is an integration test?
You replace a database with a simple list-based implementation for testing.
What is a fake?
Seeding a random number generator with a fixed value helps ensure tests remain this.
What is deterministic?
Catching an exception inside a test without asserting anything about it often results in this testing problem.
What is a false positive? (and why did I see this on so many term tests)
A test that depends on another test being run first is this kind of test.
What is an order-dependent test?
This type of test might catch a JSON mismatch between persistence and business which causes a failure,
What is an integration test?
You need to confirm that a method was called with specific arguments.
What is a mock?
A test that fully controls its inputs, isolates side effects, and avoids reliance on shared mutable state is designed to be this.
What is deterministic?
A test that only verifies an exception was thrown, but not its message or state, may miss this important aspect of correctness.
What is validating error context (or exception details)?
A test that requires a sleep/wait for a fixed amount of time for asynchronous or front end behavior.
What is a flaky/time dependent test/smell?
This type of test will boot up an application on a phone, enter a username and password, click submit on the form and verify a confirmation page is shown.
What is an acceptance test?
This dependency always returns the same predictable result.
What is a stub?
A test that reliably passes when run alone but fails when executed as part of the full test suite due to implicit assumptions about prior state demonstrates this property.
What is flakiness?
A test suite can achieve 100% of this yet still fail to execute exception branches.
What is line coverage?
A test verifies private methods directly.
What is testing implementation details?
A business rule bug is detected only by an end-to-end test suggesting that this type of test level is missing.
What is the unit test level?
This common testing mistake assumes that replacing a dependency with a mock can still allow us to validate the real boundary and functionality between the business and persistence layer.
What is confusing unit and integration tests?
A test that has assumptions about iteration order of data in a data structure whose specification makes no guarantees of ordering results in this kind of test.
What is a flaky test?
If a test relies on a NullPointerException being thrown rather than asserting a deliberate IllegalArgumentException, it is tightly coupled to this.
What is implementation details?
A test contains 20 assertions covering multiple behaviors.
What is a god test?