diff --git a/core/modules/simpletest/src/Form/SimpletestTestForm.php b/core/modules/simpletest/src/Form/SimpletestTestForm.php
index c325a8a..c86f37c 100644
--- a/core/modules/simpletest/src/Form/SimpletestTestForm.php
+++ b/core/modules/simpletest/src/Form/SimpletestTestForm.php
@@ -10,6 +10,7 @@
 use Drupal\Core\Form\FormBase;
 use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Render\RendererInterface;
+use Drupal\simpletest\TestDiscovery;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
 /**
@@ -25,11 +26,19 @@ class SimpletestTestForm extends FormBase {
   protected $renderer;
 
   /**
+   * The test discovery service.
+   *
+   * @var \Drupal\simpletest\TestDiscovery
+   */
+  protected $testDiscovery;
+
+  /**
    * {@inheritdoc}
    */
   public static function create(ContainerInterface $container) {
     return new static(
-      $container->get('renderer')
+      $container->get('renderer'),
+      $container->get('test_discovery')
     );
   }
 
@@ -39,8 +48,9 @@ public static function create(ContainerInterface $container) {
    * @param \Drupal\Core\Render\RendererInterface $renderer
    *   The renderer.
    */
-  public function __construct(RendererInterface $renderer) {
+  public function __construct(RendererInterface $renderer, TestDiscovery $test_discovery) {
     $this->renderer = $renderer;
+    $this->testDiscovery = $test_discovery;
   }
 
   /**
@@ -141,15 +151,22 @@ public function buildForm(array $form, FormStateInterface $form_state) {
     ];
 
     // Generate the list of tests arranged by group.
-    $groups = simpletest_test_get_all();
+    $groups = $this->testDiscovery->getTestClasses();
     foreach ($groups as $group => $tests) {
+      // The convention is that groups based on namespaces are capitalized,
+      // and groups based on module names are not. In order to provide clarity,
+      // we add 'module' to module group names.
+      if (strtolower($group) == $group) {
+        $group = $group . ' module';
+      }
+
       $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.
@@ -206,7 +223,7 @@ public function buildForm(array $form, FormStateInterface $form_state) {
   public function submitForm(array &$form, FormStateInterface $form_state) {
     global $base_url;
     // Test discovery does not run upon form submission.
-    simpletest_classloader_register();
+    $this->testDiscovery->registerTestNamespaces();
 
     // This form accepts arbitrary user input for 'tests'.
     // An invalid value will cause the $class_name lookup below to die with a
