**Priority:** P0 — High
**Context:** A testing audit identified these issues in the existing test suite:
- **Shallow coverage** — most shape tests only verify creation and bounds
- **No contract tests** — Shape interface has no tests verifying invariants across implementations
- **Inconsistent clone testing** — some tests verify deep copy, others do not
A parameterized contract test would catch violations across all Shape implementations at once.
**Scope:** All Shape implementations (SRectangle, SCircle, STriangle, SText, SCollection)
**Goal:** Verify Shape interface invariants across all implementations using `@ParameterizedTest` + `@MethodSource`:
- `clone()` returns independent copy
- `getBounds()` returns a copy (not internal state)
- `translate()` mutates in place
**Recommended pattern:**
```java
class ShapeContractTest {
@ParameterizedTest
@MethodSource("ovh.gasser.newshapes.shapes.ShapeFactory#allShapes")
void testCloneIsIndependent(Shape s) { ... }
@ParameterizedTest
@MethodSource("ovh.gasser.newshapes.shapes.ShapeFactory#allShapes")
void testGetBoundsReturnsCopy(Shape s) { ... }
@ParameterizedTest
@MethodSource("ovh.gasser.newshapes.shapes.ShapeFactory#allShapes")
void testTranslateMutatesInPlace(Shape s) { ... }
}
```
**Estimate:** 2 hours
**Dependencies:** None
Work in progress on branch issue-8/shape-contract-test. Commit 2ff811e adds parameterized contract tests for clone(), getBounds(), and translate() across all Shape implementations. All 15 new tests pass.
Work in progress on branch `issue-8/shape-contract-test`. Commit 2ff811e adds parameterized contract tests for clone(), getBounds(), and translate() across all Shape implementations. All 15 new tests pass.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Priority: P0 — High
Context: A testing audit identified these issues in the existing test suite:
A parameterized contract test would catch violations across all Shape implementations at once.
Scope: All Shape implementations (SRectangle, SCircle, STriangle, SText, SCollection)
Goal: Verify Shape interface invariants across all implementations using
@ParameterizedTest+@MethodSource:clone()returns independent copygetBounds()returns a copy (not internal state)translate()mutates in placeRecommended pattern:
Estimate: 2 hours
Dependencies: None
Work in progress on branch
issue-8/shape-contract-test. Commit2ff811eadds parameterized contract tests for clone(), getBounds(), and translate() across all Shape implementations. All 15 new tests pass.