# Decide if test code, test frameworks and page objects are public API or not

**URL:** <https://forum.xwiki.org/t/decide-if-test-code-test-frameworks-and-page-objects-are-public-api-or-not/18946>\
**Category:** Development\
**Tags:** proposal\
**Created:** [October 8, 2026, 4:38pm UTC](https://forum.xwiki.org/t/decide-if-test-code-test-frameworks-and-page-objects-are-public-api-or-not/18946 "2026-10-08T16:38:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![vmassol](https://forum.xwiki.org/user_avatar/forum.xwiki.org/vmassol/32/6_2.png) [@vmassol](https://forum.xwiki.org/u/vmassol)\
**Post date:** [October 8, 2026, 4:38pm UTC](https://forum.xwiki.org/t/decide-if-test-code-test-frameworks-and-page-objects-are-public-api-or-not/18946/1 "2026-10-08T16:38:37Z")

</div>

Hi devs,

While reviewing some LLM guidance, @MichaelHamann pointed out that `CKEditor` (page object) has carried `@Unstable` for 9 years and `ForgotUsernameCompletePage` has `@Unstable` methods that are 5 years old. Nothing fails because Checkstyle (and thus `UnstableAnnotationCheck`) is skipped in those modules. I checked and we never decided what test code is regarding API rules. The only discussion I found is [Support retro-compatibility for page objects](https://lists.xwiki.org/hyperkitty/list/xwiki-devs@xwiki.org/thread/35LER6SGKP6SKECO6HZZI3I25AVYUYLY/) (Jan 2016): Guillaume proposed to treat POs as API, Marius found it too much of a burden, Thomas suggested to rather take better care of `TestUtils` and friends. It ended without a vote.

## Current state (inconsistent)

- Test modules in platform (`*-test` parents): 57 of 69 skip both Revapi and Checkstyle (“we don’t consider them as public APIs”), 9 page-object modules skip Revapi but run Checkstyle (so the `@Unstable` check).
- `xwiki-platform-test-*` (test-ui, test-docker, etc.): Revapi skipped, Checkstyle runs.
- `xwiki-commons-tool-test-*`: Revapi skipped (all of `xwiki-commons-tools` skips it), Checkstyle runs.
- `xwiki-rendering-test`: Revapi and Checkstyle both run, i.e. it’s treated as API today.
- `src/test`: no `@Unstable` today (only the checker’s own test fixtures). However 34 modules publish their `src/test` as a `test-jar` used by other modules, e.g. `MockitoOldcore` lives in oldcore’s `src/test`.
- JIRA: there’s a “Test Framework” component in XWIKI and a “Test” one in XCOMMONS/XRENDERING, but none for page objects, and we don’t strictly create issues for test framework changes.
- Usage outside our core repos is real: among the contrib repos I have locally, 36 use the platform test frameworks and 23 import page objects from platform.

## Proposal

1. **Test code (`src/test`, including code published as a `test-jar`) is never API.** No `@Unstable`, no deprecation/legacy cycle, no JIRA issue required for changing it. This is mostly writing down what we already do. Reusable test code that is meant to be a test framework (shared by several modules) should be extracted into its own module, under `src/main`, rather than stay in `src/test` and be shared as a `test-jar`; it then falls under 2.
2. **Test frameworks (`src/main` of `xwiki-commons-tool-test-*`, `xwiki-rendering-test`, `xwiki-platform-test-*`, etc.) are not API.** Same rules as 1. Rationale: most usage is ours, a break only affects developers at build time when they upgrade their parent version (never users at runtime), and the cost of the full API process (Revapi ignores, `@Unstable`, deprecation, legacy modules) isn’t worth it. Best effort is still expected: prefer deprecating over removing when it’s cheap, since contrib extensions use them.
3. **Page objects (`src/main` of `*-test-pageobjects`) are not API.** Same rules and rationale as 2.

For 2 and 3, I propose that we keep requiring `@since` on new public classes and methods, since it’s cheap and it tells contrib developers which parent version they need.

## Consequences if agreed

- Remove the existing `@Unstable` annotations on page objects (7 classes today).
- Align the poms: skip Revapi on all test framework and page-object modules (`xwiki-rendering-test` included). I’d rather enable Checkstyle on all of them (we lose all style checks on POs today, not just the `@Unstable` one), which would also catch any new `@Unstable`.
- JIRA: no issue required for changes to 1-3. Keep using the “Test Framework” component for changes worth announcing to extension developers (new features of the test framework), but it’s optional.
- Document this on [https://dev.xwiki.org/xwiki/bin/view/Community/DevelopmentPractices#H40UnstableAnnotation](https://dev.xwiki.org/xwiki/bin/view/Community/DevelopmentPractices#H40UnstableAnnotation)

Here’s my +1 for 1, 2 and 3.

WDYT?

Thanks

---

<div class="post-metadata">

**Author:** ![mflorea](https://forum.xwiki.org/user_avatar/forum.xwiki.org/mflorea/32/49_2.png) [@mflorea](https://forum.xwiki.org/u/mflorea)\
**Post date:** [October 9, 2026, 8:04am UTC](https://forum.xwiki.org/t/decide-if-test-code-test-frameworks-and-page-objects-are-public-api-or-not/18946/2 "2026-10-09T08:04:11Z")

</div>

+1 for 1, 2 and 3

Thanks,  
Marius

---

<div class="post-metadata">

**Author:** ![tmortagne](https://forum.xwiki.org/user_avatar/forum.xwiki.org/tmortagne/32/4930_2.png) [@tmortagne](https://forum.xwiki.org/u/tmortagne)\
**Post date:** [October 9, 2026, 10:06am UTC](https://forum.xwiki.org/t/decide-if-test-code-test-frameworks-and-page-objects-are-public-api-or-not/18946/3 "2026-10-09T10:06:30Z")

</div>

OK for keeping the current practice of not seeing test tools as APIs.

Just note that as long as we do that, it makes impossible to run the same integration tests on several versions of XWiki (which was the main subject of the old discussion), which is something that would be very interesting for extensions.

> [@vmassol](#):
>
> 1. Reusable test code that is meant to be a test framework (shared by several modules) should be extracted into its own module

That’s what we do when we can, but sometimes it’s not that easy. A good example is [xwiki-platform/xwiki-platform-core/xwiki-platform-oldcore/src/test/java/com/xpn/xwiki/test at master · xwiki/xwiki-platform · GitHub](https://github.com/xwiki/xwiki-platform/tree/master/xwiki-platform-core/xwiki-platform-oldcore/src/test/java/com/xpn/xwiki/test) which contains among the most used unit tests tools, but they are also needed by oldcore tests themself. And there are quite a few other similar cases (reusable test tool which are also needed by the module which contains the classes manipulated by the test tool).

---

<div class="post-metadata">

**Author:** ![mleduc](https://forum.xwiki.org/user_avatar/forum.xwiki.org/mleduc/32/2328_2.png) [@mleduc](https://forum.xwiki.org/u/mleduc)\
**Post date:** [October 12, 2026, 7:56am UTC](https://forum.xwiki.org/t/decide-if-test-code-test-frameworks-and-page-objects-are-public-api-or-not/18946/4 "2026-10-12T07:56:50Z")

</div>

> [@vmassol](#):
>
> 1. **Test code (`src/test`, including code published as a `test-jar`) is never API.** No `@Unstable`, no deprecation/legacy cycle, no JIRA issue required for changing it. This is mostly writing down what we already do. Reusable test code that is meant to be a test framework (shared by several modules) should be extracted into its own module, under `src/main`, rather than stay in `src/test` and be shared as a `test-jar`; it then falls under 2.
> 2. **Test frameworks (`src/main` of `xwiki-commons-tool-test-*`, `xwiki-rendering-test`, `xwiki-platform-test-*`, etc.) are not API.** Same rules as 1. Rationale: most usage is ours, a break only affects developers at build time when they upgrade their parent version (never users at runtime), and the cost of the full API process (Revapi ignores, `@Unstable`, deprecation, legacy modules) isn’t worth it. Best effort is still expected: prefer deprecating over removing when it’s cheap, since contrib extensions use them.
> 3. **Page objects (`src/main` of `*-test-pageobjects`) are not API.** Same rules and rationale as 2.

+1, thanks

---

<div class="post-metadata">

**Author:** ![vmassol](https://forum.xwiki.org/user_avatar/forum.xwiki.org/vmassol/32/6_2.png) [@vmassol](https://forum.xwiki.org/u/vmassol)\
**Post date:** [November 11, 2026, 5:29pm UTC](https://forum.xwiki.org/t/decide-if-test-code-test-frameworks-and-page-objects-are-public-api-or-not/18946/5 "2026-11-11T17:29:48Z")

</div>

Thanks all. Conclusion: **accepted** (+1 from @mflorea, @mleduc and myself, OK from @tmortagne, no objection).

It’s now implemented and documented:

- **Documentation:**
  - New [Code That Is Not API](https://dev.xwiki.org/xwiki/bin/view/Community/DevelopmentPractices#HCodeThatIsNotAPI) section in the Development Practices (under Backward Compatibility): test code, test frameworks and page objects aren’t API (no `@Unstable`, no Revapi check, no deprecation/legacy cycle, no JIRA issue required), with best effort still expected for test frameworks and page objects, and `@since` still required on their new public classes and methods.
  - The [@Unstable Annotation](https://dev.xwiki.org/xwiki/bin/view/Community/DevelopmentPractices#HUnstableAnnotation) section now points to it.
  - The [“Don’t create unnecessary issues”](https://dev.xwiki.org/xwiki/bin/view/Community/IssueTracker/JIRA/#HRule:Don27tcreateunnecessaryissues) JIRA rule now clarifies that the “affect any user or any extension developer” question doesn’t cover test code, test frameworks or page objects.
  - The [Testing](https://dev.xwiki.org/xwiki/bin/view/Community/Testing/) page now mentions that the test frameworks and their page objects aren’t API.

- **Code:**
  - [[Misc] Don't run Revapi on the rendering test framework since test code is not API by vmassol · Pull Request #463 · xwiki/xwiki-rendering · GitHub](https://github.com/xwiki/xwiki-rendering/pull/463) : Revapi is no longer run on `xwiki-rendering-test`.
  - [[Misc] Stop treating test frameworks and page objects as API by vmassol · Pull Request #7429 · xwiki/xwiki-platform · GitHub](https://github.com/xwiki/xwiki-platform/pull/7429) :
    - Removed `@Unstable` from the page objects and test frameworks (9 classes and 4 methods; 9 classes and not 7 as I wrote above).
    - Revapi is now skipped on the 7 page object modules that still ran it.
    - Checkstyle is now enabled on 28 page object and test utility modules (8 were already clean, violations fixed in the 20 others).

- **LLM configuration:** [[Misc] Record in the KB that test code, test frameworks and page objects are not API by vmassol · Pull Request #384 · xwiki/xwiki-dev-llm · GitHub](https://github.com/xwiki/xwiki-dev-llm/pull/384) : the XWiki knowledge base of our LLM plugin now records the rule.

Follow-up: 21 page object modules with more than 10 Checkstyle violations still skip Checkstyle (administration 183, panels 103, user-profile 83, invitation 77, tour 57, appwithinminutes 51, repository 45, wiki 45, annotation 44, flamingo-theme 39, extension 37, ckeditor 32, image-lightbox 28, office 27, pagetemplate 27, scheduler 24, livedata 22, index 20, export-pdf 15, mail 14, tag 11). They can be fixed progressively, module by module.

Thanks

Co-written with Claude Code
