> For the complete documentation index, see [llms.txt](https://coldbox.ortusbooks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://coldbox.ortusbooks.com/the-basics/testing-quick-start/tips-and-tricks.md).

# Tips & Tricks

Testing tips — use AppMapping-based paths, relocate(), querySim(), MockBox, and the cbDebugger module.

Here are some useful tips for you when doing testing with ColdBox Applications:

* If you are using relative paths in your application, you might encounter problems since the running application is different from the test application. Try to always use paths based on the application's `AppMapping`
* Always use `relocate()` for relocations so they can be mocked
* Leverage `querySim()` for query mocking
* Leverage [MockBox](https://testbox.ortusbooks.com/mocking/mockbox) for mocking and stubbing
* Integration tests are NOT the same as handler tests. Handler tests will just test the handler class in isolation, so it will be your job to mock everything around it.
* You can extend the `coldbox.system.testing.BaseModelTest` to test any domain object
* The [ColdBox source code testing folder](https://github.com/ColdBox/coldbox-platform/tree/master/tests) has over 5,000 tests, mocking scripts and more for you to learn from

## Debugging with cbDebugger

For development-time insight into requests, install the ColdBox Debugger module as a dev dependency:

```bash
box install cbdebugger --saveDev
```

It attaches a debug panel to the end of each request with timers, collections, WireBox info, and more. See the [cbdebugger module](https://github.com/coldbox-modules/cbdebugger) for configuration. Always use `--saveDev` — the debugger is a development tool, not for production.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://coldbox.ortusbooks.com/the-basics/testing-quick-start/tips-and-tricks.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
