> For the complete documentation index, see [llms.txt](https://docs.walnutai.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.walnutai.ai/overview-and-tracking/action-item/ai-driven-requirement-enhancement-and-test-generation.md).

# AI-Driven Requirement Enhancement & Test Generation

**Using AI to Enhance the Story**

The Chat with AI option is useful for identifying and filling gaps within your User Story. Whether you missed a specific step, overlooked an edge case, or feel the acceptance criteria are incomplete, you can use the chat to refine and strengthen the requirement before it moves to development.

**You can use it to:**

* **Improve Clarity:** It rewrites unclear or ambiguous descriptions into precise, implementation-ready statements that are easy for developers to follow.
* **Enhance Criteria:** It defines acceptance criteria to make them specific, measurable, and testable.
* **Add Edge Cases:** It identifies missing scenarios, validations, and boundary conditions that may have been overlooked during initial planning.
* **Suggest Points:** It evaluates the scope and complexity of the requirements to recommend appropriate story points for better sprint estimation.

When the AI suggests enhancements, click **Apply Changes** to automatically update the story with the refined version. It replaces existing content with the AI-enhanced updates, ensuring changes are saved and immediately reflected in the User Story.

<figure><img src="/files/zX4x68f9X1logYe35nCT" alt=""><figcaption></figcaption></figure>

**Generating Test Cases**

You can bridge the gap between requirements and validation by leveraging automated test generation.

* **Initiate Generation:** Click **AI Generate** within the User Story interface.

<figure><img src="/files/DFmkgJxh6xuYoLgSBK5S" alt=""><figcaption></figcaption></figure>

* **Automated Creation:** The system automatically creates both positive and negative test cases based on the provided story details and criteria.

<figure><img src="/files/FGh5SCY1xHBzprVoyylx" alt=""><figcaption></figcaption></figure>

* **Review and Refinement:** Review the generated test cases for accuracy, then click **Confirm** & **Save** to finalize them.

<figure><img src="/files/gYnr3PFQMFNxpGOLSMKz" alt=""><figcaption></figcaption></figure>

* On saving, the test cases are linked to the User Story.

<figure><img src="/files/e2xVfTE9Vcvdfx5pUsZx" alt=""><figcaption></figcaption></figure>


---

# 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 dynamically by asking a question.

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

```
GET https://docs.walnutai.ai/overview-and-tracking/action-item/ai-driven-requirement-enhancement-and-test-generation.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
