Aller au contenu principal
kitlocal.dev

Refactor for readability without changing behavior

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

Cette ressource n’est disponible qu’en anglais.

Les prompts sont du texte que vous copiez dans votre propre assistant. KitLocal ne les exécute pas.

Renseigner les variables

Ce que vous saisissez reste dans ce navigateur. Cela n’est ni ajouté à l’URL, ni enregistré, ni envoyé.

Aperçu

Encore requis : 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:

Objectif

Improve structure while keeping behavior identical and verifiable.

Quand l’utiliser

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

Ce qu’il faut préparer

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

Résultat attendu

Steps with risk notes, then the final code.

À propos de ce catalogue

Instantané intégré · publié 15 nov. 2026, 06:05 · Révision du catalogue 5bc079fe355af2214bc0

Affichage de l’instantané intégré à l’application (aucune source de contenu n’est configurée). Du contenu plus récent peut exister à la source.