> For the complete documentation index, see [llms.txt](https://docs.drizz.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.drizz.dev/commands-reference/memory/best-practices-for-memory-usage.md).

# 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.
