跳至主要內容
kitlocal.dev

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日 清晨6:05 · 目錄修訂版 5bc079fe355af2214bc0

正在顯示應用程式內建的快照(尚未設定內容來源)。來源處可能已有更新的內容。