47/ 50
+ 핵심 버그와 경계 예외를 간결하게 짚었다.
- LINQ 예시는 앞선 입력 검증을 포함하지 않는다.
검토할 코드를 넣으면 문법 오류, 논리 결함, 표준 준수, 최적화 기회를 분석하고 실행 가능한 피드백을 제공합니다.
| 분류 | 개발 › 코딩 |
|---|---|
| 태그 | 검토분석개발자코드 |
Act as a Code Review Specialist. You are an experienced software developer with a keen eye for detail and a deep understanding of coding standards and best practices. Your task is to review the code provided by the user. You will: - Analyze the code for syntax errors and logical flaws. - Evaluate the code's adherence to industry standards and best practices. - Identify opportunities for optimization and performance improvements. - Provide constructive feedback with actionable recommendations. Rules: - Maintain a professional tone in all feedback. - Focus on significant issues rather than minor stylistic preferences. - Ensure your feedback is clear and concise, facilitating easy implementation by the developer. - Use examples where necessary to illustrate points.
중요한 코드 문제를 간결하게 리뷰받을 때 쓰는 프롬프트다. 사소한 취향보다 의미 있는 이슈에 집중하고, 필요한 경우 예시로 설명하도록 한다.
ChatGPT가 가장 정확하고 간결하다. Gemini도 충실하지만 장황하며, [C]는 답변이 없어 평가가 불가능하다.
+ 핵심 버그와 경계 예외를 간결하게 짚었다.
- LINQ 예시는 앞선 입력 검증을 포함하지 않는다.
+ 사례와 두 가지 수정안을 구체적으로 제시했다.
- 지나치게 길고 LINQ 권장 표현이 다소 단정적이다.
| 기준 | ChatGPT | Gemini | 앞선 모델 |
|---|---|---|---|
| 지시 준수 | 10 | 10 | 동점 |
| 정확성 | 9 | 8 | ChatGPT +13% |
| 구체성 | 10 | 10 | 동점 |
| 구성·가독성 | 9 | 9 | 동점 |
| 분량 적정성 | 9 | 6 | ChatGPT +50% |
gpt-5.6-sol가 모델 이름을 가린 채 1~10점으로 채점했습니다 (2026-09-24). 측정값이 아니라 AI 심사 결과입니다.
같은 입력을 세 모델에 넣어 받은 답을 그대로 옮겼습니다. 각 CLI(에이전트 하네스)에서 실행했습니다. ChatGPT·Claude 앱이나 웹에서는 답이 다를 수 있습니다.
[붙여 넣은 자료]
C#으로 짠 페이징 로직인데 마지막 페이지에서 항목이 하나씩 빠진다는 버그 리포트가 있습니다.
```csharp
public List<string> GetPageItems(List<string> items, int page, int pageSize)
{
string log = "";
var result = new List<string>();
int start = page * pageSize;
int end = start + pageSize;
for (int i = start; i < end - 1; i++)
{
result.Add(items[i]);
log = log + "added index " + i + "\n";
}
return result;
}
```주요 버그는 반복문의 종료 조건입니다.
for (int i = start; i < end - 1; i++)
i < end - 1이므로 end - 1 인덱스를 제외합니다. 그 결과 마지막 페이지뿐 아니라 모든 페이지에서 최대 pageSize - 1개만 반환됩니다.
또한 마지막 페이지에 pageSize보다 적은 항목만 남아 있으면 items[i] 접근 중 예외가 발생할 수 있습니다.
수정 예시는 다음과 같습니다.
public List<string> GetPageItems(
List<string> items,
int page,
int pageSize)
{
if (items == null)
throw new ArgumentNullException(nameof(items));
if (page < 0)
throw new ArgumentOutOfRangeException(nameof(page));
if (pageSize <= 0)
throw new ArgumentOutOfRangeException(nameof(pageSize));
int start = checked(page * pageSize);
if (start >= items.Count)
return new List<string>();
int count = Math.Min(pageSize, items.Count - start);
return items.GetRange(start, count);
}
LINQ를 사용하면 더 간결하게 작성할 수도 있습니다.
return items
.Skip(page * pageSize)
.Take(pageSize)
.ToList();
추가로 검토할 사항:
page가 0부터 시작한다고 가정합니다. 1부터 시작하는 페이지 번호라면 page - 1을 사용해야 합니다.log는 생성만 되고 사용되지 않습니다. 필요하다면 StringBuilder를 사용하고, 불필요하면 제거하는 것이 좋습니다.page * pageSize의 정수 오버플로 가능성을 고려해야 합니다. 위 예시에서는 checked로 이를 감지합니다.| 방산 CV 12개월 로드맵 프롬프트 | |
| 2046 퍼즐 게임 제작 프롬프트 | |
| React 컴포넌트 통합 프롬프트 | |
| 3D 아바타 팩토리 요구 프롬프트 | |
| 3D FPS 게임 개발 프롬프트 |