Java Test Automation / Scenario

The Shared BaseTest Breaks Under Parallelism

Refactor a shared Java base class whose global state and mixed responsibilities make parallel tests fragile and changes dangerous.

Difficulty
Hard
Format
Scenario
Points
200
Estimate
18 min

// MISSION BRIEF

Your Mission

One inherited class now controls browser sessions, database cleanup, API calls, screenshots, data creation, and reporting. A parallelization attempt exposed the coupling. Review the class and call graph, then define a safer migration without halting the suite.

// FIRST CONTACT

Battle teaser

First artifact

BaseTest.java

Which root problems are directly supported by the artifacts? (Select all that apply.)

  1. AInheritance forces tests to acquire expensive collaborators they do not use
  2. BStatic mutable fields become isolated automatically for each parallel test worker, so they cannot overwrite one another
  3. CThe failure proves Java cannot execute tests in parallel
  4. DThe base class violates single responsibility by mixing lifecycle, UI, database, HTTP, data, and reporting concerns
Answers, scoring, hints, and the full battle stay sealed.

// SKILL TAGS

java-refactoringsingle-responsibilitytest-fixturesjava-testing