사전으로 돌아가기

테스트 자동화

Test Automation
개발자 도구

테스트 자동화는 소프트웨어 테스트를 코드로 작성해 사람이 개입하지 않아도 실행되게 만드는 방식이다. 보통 CI/CD 파이프라인에서 커밋마다 돌아간다. 목적은 이번 변경이 기존 동작을 깨뜨렸는지 빠르고 반복 가능하게 확인하는 것이다. 수동 테스트로는 요즘 배포 빈도를 따라갈 수 없다. 테스트는 대개 층으로 나눈다. 단위 테스트는 함수 하나를 떼어 밀리초 단위로 검증하고, 통합 테스트는 여러 구성 요소를 실제 데이터베이스와 함께 묶어 확인하며, E2E 테스트는 사용자가 쓰는 화면을 그대로 조작한다. 자바스크립트 진영에서는 Jest와 Vitest가 앞의 두 층을, Playwright와 Cypress가 브라우저 테스트를 맡고 파이썬에서는 pytest가 같은 자리를 차지한다. 실행은 GitHub Actions나 GitLab CI에서 이뤄지며 실패하면 병합을 막는다. AI 코딩 도구가 기존 코드에서 테스트 케이스를 뽑아 주면서 커버리지는 빨리 오르지만 품질까지 오르지는 않는다. 가장 큰 함정은 간헐적으로 실패하는 불안정한 테스트다. 개발자가 원인을 보지 않고 재실행하는 습관이 들면 통과한 빌드가 아무 의미도 없어진다.

Test Automation is the practice of writing software tests as code so they run without human intervention, usually on every commit in a CI/CD pipeline. The goal is a fast, repeatable signal about whether a change broke existing behavior, which manual testing cannot deliver at the frequency modern teams deploy. Tests are normally layered. Unit tests check a single function in isolation and run in milliseconds; integration tests exercise several components together, often against a real database; and end-to-end tests drive the actual interface the way a user would. Jest and Vitest cover the unit and integration layers in JavaScript projects, pytest does the same in Python, and Playwright or Cypress drive browsers for end-to-end runs. GitHub Actions and GitLab CI are where these suites typically execute, blocking a merge when something fails. AI coding assistants now generate test cases from existing code, which raises coverage quickly but not necessarily quality. The pitfall is the flaky test: a suite that fails intermittently trains developers to rerun rather than investigate, and a green build stops meaning anything. Coverage percentage is likewise a weak proxy, since tests that assert nothing meaningful still count.

사용 예시

  • Vitest로 단위 테스트를, Playwright로 E2E 테스트를 나눠 CI에서 함께 돌린다
  • AI가 생성한 테스트 케이스로 커버리지는 올랐지만 실질 검증력은 따로 점검해야 했다
  • 간헐적으로 실패하는 테스트를 방치하다 결국 배포 차단 규칙을 다시 세웠다

관련 용어