diff --git a/core/modules/simpletest/src/Form/SimpletestTestForm.php b/core/modules/simpletest/src/Form/SimpletestTestForm.php
index f954546eb1..ae185f1b60 100644
--- a/core/modules/simpletest/src/Form/SimpletestTestForm.php
+++ b/core/modules/simpletest/src/Form/SimpletestTestForm.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\simpletest\Form;
 
+use Drupal\Core\Extension\ExtensionDiscovery;
 use Drupal\Core\Form\FormBase;
 use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Render\RendererInterface;
@@ -21,6 +22,16 @@ class SimpletestTestForm extends FormBase {
   protected $renderer;
 
   /**
+   * Path to the application root.
+   *
+   * We need this so that we can do discovery of extensions, and show the user
+   * which tests belong with which extension.
+   *
+   * @var string
+   */
+  protected $appRoot;
+
+  /**
    * The test discovery service.
    *
    * @var \Drupal\simpletest\TestDiscovery
@@ -33,7 +44,8 @@ class SimpletestTestForm extends FormBase {
   public static function create(ContainerInterface $container) {
     return new static(
       $container->get('renderer'),
-      $container->get('test_discovery')
+      $container->get('test_discovery'),
+      (string) $container->get('app.root')
     );
   }
 
@@ -45,9 +57,10 @@ public static function create(ContainerInterface $container) {
    * @param \Drupal\simpletest\TestDiscovery $test_discovery
    *   The test discovery service.
    */
-  public function __construct(RendererInterface $renderer, TestDiscovery $test_discovery) {
+  public function __construct(RendererInterface $renderer, TestDiscovery $test_discovery, $app_root) {
     $this->renderer = $renderer;
     $this->testDiscovery = $test_discovery;
+    $this->appRoot = $app_root;
   }
 
   /**
@@ -61,24 +74,24 @@ public function getFormId() {
    * {@inheritdoc}
    */
   public function buildForm(array $form, FormStateInterface $form_state) {
-    $form['actions'] = ['#type' => 'actions'];
-    $form['actions']['submit'] = [
+    $form['actions'] = array('#type' => 'actions');
+    $form['actions']['submit'] = array(
       '#type' => 'submit',
       '#value' => $this->t('Run tests'),
       '#tableselect' => TRUE,
       '#button_type' => 'primary',
-    ];
-    $form['clean'] = [
+    );
+    $form['clean'] = array(
       '#type' => 'fieldset',
       '#title' => $this->t('Clean test environment'),
       '#description' => $this->t('Remove tables with the prefix "simpletest" and temporary directories that are left over from tests that crashed. This is intended for developers when creating tests.'),
       '#weight' => 200,
-    ];
-    $form['clean']['op'] = [
+    );
+    $form['clean']['op'] = array(
       '#type' => 'submit',
       '#value' => $this->t('Clean environment'),
-      '#submit' => ['simpletest_clean_environment'],
-    ];
+      '#submit' => array('simpletest_clean_environment'),
+    );
 
     // Do not needlessly re-execute a full test discovery if the user input
     // already contains an explicit list of test classes to run.
@@ -88,43 +101,43 @@ public function buildForm(array $form, FormStateInterface $form_state) {
     }
 
     // JavaScript-only table filters.
-    $form['filters'] = [
+    $form['filters'] = array(
       '#type' => 'container',
-      '#attributes' => [
-        'class' => ['table-filter', 'js-show'],
-      ],
-    ];
-    $form['filters']['text'] = [
+      '#attributes' => array(
+        'class' => array('table-filter', 'js-show'),
+      ),
+    );
+    $form['filters']['text'] = array(
       '#type' => 'search',
       '#title' => $this->t('Search'),
       '#size' => 30,
       '#placeholder' => $this->t('Enter test name…'),
-      '#attributes' => [
-        'class' => ['table-filter-text'],
+      '#attributes' => array(
+        'class' => array('table-filter-text'),
         'data-table' => '#simpletest-test-form',
         'autocomplete' => 'off',
         'title' => $this->t('Enter at least 3 characters of the test name or description to filter by.'),
-      ],
-    ];
+      ),
+    );
 
-    $form['tests'] = [
+    $form['tests'] = array(
       '#type' => 'table',
       '#id' => 'simpletest-form-table',
       '#tableselect' => TRUE,
-      '#header' => [
-        ['data' => $this->t('Test'), 'class' => ['simpletest-test-label']],
-        ['data' => $this->t('Description'), 'class' => ['simpletest-test-description']],
-      ],
+      '#header' => array(
+        array('data' => $this->t('Test'), 'class' => array('simpletest-test-label')),
+        array('data' => $this->t('Description'), 'class' => array('simpletest-test-description')),
+      ),
       '#empty' => $this->t('No tests to display.'),
-      '#attached' => [
-        'library' => [
+      '#attached' => array(
+        'library' => array(
           'simpletest/drupal.simpletest',
-        ],
-      ],
-    ];
+        ),
+      ),
+    );
 
     // Define the images used to expand/collapse the test groups.
-    $image_collapsed = [
+    $image_collapsed = array(
       '#theme' => 'image',
       '#uri' => 'core/misc/menu-collapsed.png',
       '#width' => '7',
@@ -132,8 +145,8 @@ public function buildForm(array $form, FormStateInterface $form_state) {
       '#alt' => $this->t('Expand'),
       '#title' => $this->t('Expand'),
       '#suffix' => '<a href="#" class="simpletest-collapse">(' . $this->t('Expand') . ')</a>',
-    ];
-    $image_extended = [
+    );
+    $image_extended = array(
       '#theme' => 'image',
       '#uri' => 'core/misc/menu-expanded.png',
       '#width' => '7',
@@ -141,66 +154,80 @@ public function buildForm(array $form, FormStateInterface $form_state) {
       '#alt' => $this->t('Collapse'),
       '#title' => $this->t('Collapse'),
       '#suffix' => '<a href="#" class="simpletest-collapse">(' . $this->t('Collapse') . ')</a>',
-    ];
+    );
     $form['tests']['#attached']['drupalSettings']['simpleTest']['images'] = [
       (string) $this->renderer->renderPlain($image_collapsed),
       (string) $this->renderer->renderPlain($image_extended),
     ];
 
+    // Get a list of all available extension names.
+    $extension_discovery = new ExtensionDiscovery($this->appRoot);
+    $extension_names = [];
+    $extension_types = ['module', 'theme', 'profile', 'theme engine'];
+    foreach($extension_types as $type) {
+      $extension_names[$type] = array_keys($extension_discovery->scan($type, TRUE));
+    }
     // Generate the list of tests arranged by group.
     $groups = $this->testDiscovery->getTestClasses();
     foreach ($groups as $group => $tests) {
-      $form['tests'][$group] = [
-        '#attributes' => ['class' => ['simpletest-group']],
-      ];
+      // Add the extension type to group names which are also extension names.
+      foreach ($extension_types as $type) {
+        if (in_array($group, $extension_names[$type], TRUE)) {
+          $group = $group . ' ' . $type;
+        }
+      }
+
+      $form['tests'][$group] = array(
+        '#attributes' => array('class' => array('simpletest-group')),
+      );
 
       // Make the class name safe for output on the page by replacing all
       // non-word/decimal characters with a dash (-).
-      $group_class = 'module-' . strtolower(trim(preg_replace("/[^\w\d]/", "-", $group)));
+      $group_class = 'group-' . strtolower(trim(preg_replace("/[^\w\d]/", "-", $group)));
 
       // Override tableselect column with custom selector for this group.
       // This group-select-all checkbox is injected via JavaScript.
-      $form['tests'][$group]['select'] = [
-        '#wrapper_attributes' => [
+      $form['tests'][$group]['select'] = array(
+        '#wrapper_attributes' => array(
           'id' => $group_class,
-          'class' => ['simpletest-group-select-all'],
-        ],
-      ];
-      $form['tests'][$group]['title'] = [
+          'class' => array('simpletest-group-select-all'),
+        ),
+      );
+      $form['tests'][$group]['title'] = array(
         // Expand/collapse image.
         '#prefix' => '<div class="simpletest-image" id="simpletest-test-group-' . $group_class . '"></div>',
         '#markup' => '<label for="' . $group_class . '-group-select-all">' . $group . '</label>',
-        '#wrapper_attributes' => [
-          'class' => ['simpletest-group-label'],
-        ],
-      ];
-      $form['tests'][$group]['description'] = [
+        '#wrapper_attributes' => array(
+          'class' => array('simpletest-group-label'),
+        ),
+      );
+      $form['tests'][$group]['description'] = array(
         '#markup' => '&nbsp;',
-        '#wrapper_attributes' => [
-          'class' => ['simpletest-group-description'],
-        ],
-      ];
+        '#wrapper_attributes' => array(
+          'class' => array('simpletest-group-description'),
+        ),
+      );
 
       // Cycle through each test within the current group.
       foreach ($tests as $class => $info) {
-        $form['tests'][$class] = [
-          '#attributes' => ['class' => [$group_class . '-test', 'js-hide']],
-        ];
-        $form['tests'][$class]['title'] = [
+        $form['tests'][$class] = array(
+          '#attributes' => array('class' => array($group_class . '-test', 'js-hide')),
+        );
+        $form['tests'][$class]['title'] = array(
           '#type' => 'label',
           '#title' => '\\' . $info['name'],
-          '#wrapper_attributes' => [
-            'class' => ['simpletest-test-label', 'table-filter-text-source'],
-          ],
-        ];
-        $form['tests'][$class]['description'] = [
+          '#wrapper_attributes' => array(
+            'class' => array('simpletest-test-label', 'table-filter-text-source'),
+          ),
+        );
+        $form['tests'][$class]['description'] = array(
           '#prefix' => '<div class="description">',
           '#plain_text' => $info['description'],
           '#suffix' => '</div>',
-          '#wrapper_attributes' => [
-            'class' => ['simpletest-test-description', 'table-filter-text-source'],
-          ],
-        ];
+          '#wrapper_attributes' => array(
+            'class' => array('simpletest-test-description', 'table-filter-text-source'),
+          ),
+        );
       }
     }
 
@@ -233,7 +260,7 @@ public function submitForm(array &$form, FormStateInterface $form_state) {
       $test_id = simpletest_run_tests($tests_list, 'drupal');
       $form_state->setRedirect(
         'simpletest.result_form',
-        ['test_id' => $test_id]
+        array('test_id' => $test_id)
       );
     }
   }
