Resetting the database between tests by truncating every table costs a statement per table per test, which on forty tables and four hundred tests is sixteen thousand statements.…
A common table expression reads like a named intermediate result, and in MySQL 8.0 it may be merged into the outer query or materialised into a temporary table…
EXPLAIN shows the plan the optimiser chose and its estimates, and the estimates are frequently wrong — a query planned for 40 rows that reads 400,000 looks fine…
A repository test against a mocked connection asserts that the code calls the methods you expected, which is a restatement of the code rather than a check on…