Zum Hauptinhalt springen
kitlocal.dev

Refactor for readability without changing behavior

Proposes small, behavior-preserving refactorings for a function and lists the tests that must still pass.

Diese Ressource ist nur auf Englisch verfügbar.

Prompts sind Text, den du in deinen eigenen Assistenten kopierst. KitLocal führt sie nicht aus.

Variablen ausfüllen

Was du eingibst, bleibt in diesem Browser. Es wird weder zur URL hinzugefügt noch gespeichert oder irgendwohin gesendet.

Vorschau

Noch erforderlich: 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:

Zweck

Improve structure while keeping behavior identical and verifiable.

Wann man es einsetzt

  • A function is hard to read and you want safe, reviewable steps.

Was du vorbereiten solltest

  • The code and the tests that cover it, if any.

Erwartete Ausgabe

Steps with risk notes, then the final code.

Über diesen Katalog

Mitgelieferter Snapshot · veröffentlicht 15.11.2026, 06:05 · Katalogversion 5bc079fe355af2214bc0

Es wird der mit der App gelieferte Snapshot angezeigt (keine Inhaltsquelle konfiguriert). An der Quelle könnten neuere Inhalte vorliegen.