# Best Practices for Memory Usage

Memory variables in Drizz allow tests to store, reuse, and validate dynamic values such as OTPs, IDs, prices, and references generated during execution. Proper memory management ensures accuracy across steps, eliminates hardcoding, and supports data-driven flows. This section outlines best practices to maintain clarity, prevent variable conflicts, and ensure predictable behavior throughout the test.

### Recommended Best Practices for Writing Memory Commands:

1. Use clear, descriptive variable names\
   **Example:** otp\_details, order\_id, ref\_code<br>
2. Validate stored values when critical to the flow\
   **Example:** Validating the order ID on the success screen.<br>
3. Use memory for all dynamic values\
   Prevents hardcoding and increases test reliability.<br>

> Avoid overwriting the same variable unintentionally\
> Use new variable names when storing different values throughout the 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://docs.drizz.dev/commands-reference/memory/best-practices-for-memory-usage.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.
