> For the complete documentation index, see [llms.txt](https://docs.docbits.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.docbits.com/chinese/guan-li-yu-she-zhi/settings/global-settings/document-types/script/testing-scripts.md).

# 测试脚本

## 在受控环境中全面测试脚本，是将其部署到实际文档处理工作流之前的关键步骤。以下是这样做的重要原因。

### 错误预防：

* 脚本可能包含错误，例如语法错误、逻辑错误或未预见到的边缘情况。
* 在受控环境中测试，可以在脚本部署到实际工作流之前发现并修复这些错误。
* 这有助于避免潜在问题和停机。

### 数据安全：

* 在实际工作流中使用有缺陷的脚本，可能导致数据丢失或数据损坏，从而引发严重的安全问题。
* 在受控环境中测试，可以在敏感数据受到影响之前发现并修复潜在的安全漏洞。

### 确保功能正常：

* 脚本旨在自动执行特定任务或改进流程。
* 全面测试有助于确保脚本正确执行预期功能，并产生预期结果。
* 这有助于提高文档处理的效率和质量。

### 适应不同环境：

* 受控测试环境允许你在不同条件下测试脚本，并确保它在不同环境中稳定运行。
* 当脚本部署在不同的系统配置中或使用不同的数据集时，这一点尤其重要。

### 易用性：

* 在受控环境中测试，还可以检查脚本的易用性，并确保它易于使用和理解。
* 测试过程中的反馈有助于在必要时调整脚本，从而改善用户体验。

总之，在受控环境中全面测试脚本，有助于确保文档处理的可靠性、安全性和有效性。在将脚本部署到实际工作流之前，识别潜在问题并确保脚本以最佳状态运行，是不可或缺的一步。


---

# 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://docs.docbits.com/chinese/guan-li-yu-she-zhi/settings/global-settings/document-types/script/testing-scripts.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.
