# Refactoring safely — AI Coding Assistants

Source: https://www.geekswithgeeks.com/en/ai-coding-assistants/ai-coding-assistants-16

> Apply Refactoring safely with clear evidence.

## Understand Refactoring safely

For **Refactoring safely**, begin with the problem it solves. Identify the inputs, constraints, and observable outcome before choosing an implementation.

## See the workflow

Use this path while practising **Refactoring safely**: understand, act, verify, and improve.

![Workflow for Refactoring safely.](assets/figures/ai-coding-assistants/section-4-map.svg) — Figure 4.1 — A repeatable workflow.

## A useful comparison

**Refactoring safely** is like a route plan: it keeps each step connected to a destination.

Check your reasoning.

**Quiz:** What is the best first step for Refactoring safely?

- [x] Define the goal and constraints.
- [ ] Copy an unverified example.
- [ ] Skip measurement.

*Answer:* Define the goal and constraints.. A clear goal and constraints make decisions reviewable.
