Skip to main content

testing-debugging

Write tests, debug failures, and implement quality strategies across unit, integration, and E2E layers.

소스 정보

저장소
glayph/Agent
최근 소스 활동
2026년 9월 19일 22:39
감지된 SKILL.md 언어
영어
스타
0
포크
0

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
name
testing-debugging
description
Write tests, debug failures, and implement quality strategies across unit, integration, and E2E layers.
version
1.0.0
author
Miki
license
MIT
platforms
["linux","macos","windows"]
metadata
{"Miki":{"tags":["testing","debugging","qa","tdd","quality"],"related_skills":["javascript","frontend-frameworks"]}}
# Testing & Debugging ## Test pyramid ``` E2E (10%) — Playwright, Cypress Integration (20%) — supertest, Testing Library Unit (70%) — Vitest, Jest ``` ## TDD cycle 1. Write failing test (red) 2. Write minimal code to pass (green) 3. Refactor (clean) 4. Repeat ## Unit testing patterns ```ts describe("calculateTotal", () => { it("sums item prices with tax", () => { expect(calculateTotal([{ price: 10 }, { price: 20 }], 0.1)) .toBe(33); // (10+20) * 1.1 }); it("handles empty cart", () => { expect(calculateTotal([], 0.1)).toBe(0); }); it("throws on negative tax", () => { expect(() => calculateTotal([], -1)).toThrow("invalid tax"); }); }); ``` ## Debugging protocol 1. **Reproduce**: exact steps, input, environment 2. **Isolate**: binary search (comment half, test, repeat) 3. **Read errors**: first line of stack trace = where it broke 4. **Check assumptions**: verify input types, null checks, async order 5. **Check logs**: structured logger > console.log 6. **Fix + add test**: prove fix works, prevent regression ## Common bug patterns | Symptom | Likely cause | |---------|-------------| | "undefined is not a function" | Import failure / wrong this binding | | Infinite loop | Missing base case in recursion / useEffect deps | | Stale state | Closure over old value / missing deps array | | Off-by-one | `<` vs `<=`, index vs length | | Silent fail | Uncaught async error / empty catch block | ## Debugging tools - `node --inspect` + Chrome DevTools - VS Code: breakpoints, watch, call stack - `console.table()`, `console.trace()`, `console.time()` - Network tab: request/response, timing, cookies - React DevTools: component tree, state, props, profiler
GitHub에서 보기