Refactor for readability without changing behavior
Proposes small, behavior-preserving refactorings for a function and lists the tests that must still pass.
此资源仅提供英文版本。
提示词是你复制到自己助手中的文本。KitLocal 不会运行它们。
填写变量
你输入的内容只保留在此浏览器中,不会添加到 URL、保存或发送到任何地方。
预览
仍需填写:Code to refactor, Language
Refactor this {{language}} code for readability WITHOUT changing behavior.
Give a list of small steps, each independently reviewable, with the resulting code for the
final step only. Call out any step that could change behavior (ordering, errors, side effects)
and the test that would reveal it. If the existing tests are missing or weak, say which
characterization tests to write first.
Code:
{{code}}
Existing tests:
用途
Improve structure while keeping behavior identical and verifiable.
适用场景
- A function is hard to read and you want safe, reviewable steps.
需要准备的内容
- The code and the tests that cover it, if any.
预期输出
Steps with risk notes, then the final code.
关于此目录
内置快照 · 发布于 2026年11月15日 06:05 · 目录修订版 5bc079fe355af2214bc0
正在显示应用内置的快照(未配置内容来源)。来源处可能已有更新的内容。