Two classes or interfaces with substantial shared structure (fields, methods); the agent verifying changes must update both consistently.
Shared structure lives on the parent with one declaration; queries about either subclass load the parent's contract once instead of paying the cost of loading N near-identical subclass declarations.
Before the refactoring
class Employee { name; id; salary; }class Department { name; id; budget; }
After the refactoring
class Party { name; id; }class Employee extends Party { salary; }class Department extends Party { budget; }
Bug fixes must land in both types; the agent's reasoning about shared invariants must verify they hold identically across both.
Inheritance is inflexible; for shallow duplication, the agent's downstream changes are constrained by the parent in ways composition (Extract Class) would have avoided.
Shared behavior lives on the parent with one definition; edits to the shared method land once and propagate to every subclass through inheritance, removing the N-copy synchronization cost.
Extracting superclasses for shallow duplication locks the agent into inheritance constraints when composition would have left both classes free to diverge.