MediaWikiIntegrationTestCase::$tablesUsed is used to specify what tables are used by a test class, and therefore need to be cleaned up when each test in that class ends. This has a number of issue. The most prominent one is that developers need to make sure that the property is always up-to-date with what the test does. Particularly problematic is the scenario where a table used by the test is not in $tablesUsed, because that table will never be cleared, and will remain available to subsequent tests (which could fail if they assume the table to be empty).
Instead, we could keep track of every query executed, make a list of tables that were changed, and reset those table. If needed, we could provide an overridable method for tests to specify that certain tables, even if used, should not be reset. I'm not sure if this would really be any useful, so I'd rather not do this unless there's a valid use case.