Group tests by category