# Framework Testing

This page is for developers who are working on AndHow and need to write tests for AndHow itself. If you are writing tests for an application *using* AndHow, see the User Guild [Testing](/user-guide/testing.md) section.

* AndHow ties into the Java compiler as an annotation processor so testing requires running the javac compiler and verifying compilation results in some places.
* At runtime, the main AndHow class is an immutable singleton, however, for good testing we want to put that immutable singleton into lots of different states to ensure it works correctly - Those two things cannot both (easily) be true
* Never hold a reference to the AndHow singleton object in a way that survives beyond a single test (This would be the object returned from `AndHow.instance()` ) or the even more hidden AndHowCore (referenced inside the AndHow class). The AndHow testing framework 'cheats' and actually destroys the AndHow and AndHowCore singleton instances, allowing it to be recreated. Thus, any reference to an AndHow instance held by test code has the potential to be pointing to an old instance left from a previous test.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.andhowconfig.org/developer-guide/framework-testing.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
