본문으로 건너뛰기
Skillpedia
테스트10k · #11937

testing-setup

하는 일

이 스킬은 Android 프로젝트가 지금 코드를 어떻게 테스트하는지 확인하고 테스트 구성을 계획합니다. 단위, UI, 스크린샷, 엔드 투 엔드 테스트를 위한 테스트 라이브러리와 하네스를 추가할 수 있습니다. 실용적인 테스트 전략을 원하는 Android 개발자를 위한 스킬입니다.

사용하는 경우

  • ✓Android 프로젝트에 테스트가 거의 없어서 테스트 구성이 필요할 때.
  • ✓Compose나 View 화면에 스크린샷 테스트를 추가하고 싶을 때.
  • ✓프로젝트가 이미 쓰고 있는 테스트 라이브러리와 모킹 도구가 무엇인지 알고 싶을 때.

스킬 링크

https://github.com/android/skills/blob/main/testing/testing-setup/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/android/skills/blob/main/testing/testing-setup/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“내 Android 프로젝트의 테스트 구성을 살펴보고 단위 테스트와 Compose UI 테스트용 라이브러리를 추가해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

이 스킬은 버전 카탈로그와 빌드 파일을 읽어 의존성 주입 프레임워크, 테스트 프레임워크, 모킹 도구, UI 유형을 찾습니다. 그다음 프로젝트에 맞는 누락된 라이브러리와 하네스를 추가합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Step 1: Analyze the current testing setup

To understand the testing setup of an existing project, look for these dependencies in the libs.versions.toml file, or build files:

  1. Dependency Injection framework used. For example, Hilt, Koin, Anvil, or vanilla Dagger.
  2. Unit (local) testing framework this project uses. For example, JUnit4 or JUnit5.
  3. Mocking framework (if any) used for unit tests, and for instrumented and UI tests. For example, Mockito or Mockk.
  4. Robolectric. Identify which of these three uses apply:
    1. Used in unit tests to have fakes for platform entities
    2. To run behavior UI tests without a device or emulator. For example, used to run Espresso or Compose tests.
    3. To do screenshot testing with Roborazzi
  5. Is the app 100% Compose, Views or hybrid?
  6. Behavior UI tests:
    1. Compose Tests (androidx.compose.ui:ui-test-*)
    2. Espresso Tests for Views. Check for wrappers such as Kaspresso. Dependencies: androidx.test.espresso:espresso-core, androidx.test:runner, androidx.test:rules.
  7. Screenshot tests. Identify which of these types the project uses:
    1. Instrumented (device-based). For example, using Dropshots.
    2. Based on Robolectric, so they run locally. For example, using Roborazzi.
    3. Based on LayoutLib, so they run locally. For example, Paparazzi, or the Compose Preview Screenshot Testing tool.
  8. End to end tests (also known as Release Candidate tests) always run on device and use high-level frameworks such as UIAutomator, Appium, or Robotium.
  9. Generate a Markdown report with the analysis

Step 2: Set up Dependency Injection frameworks for testing

If there is no Dependency Injection framework, install one: if it's a multiplatform application, ask the user whether they want to install Koin, or kotlin-inject. If it's not multiplatform, install Hilt.

Install the testing dependencies (for example com.google.dagger:hilt-compiler that should be applied with a kspAndroidTest configuration).

[!IMPORTANT] Important: Always consult the documentation of the applicable framework to learn about testing (for example: Hilt testing guide, Koin Instrumented tests).

For instrumented tests, create and configure (by adding testInstrumentationRunner to the build gradle files) a new test runner and apply the testing rules required by the framework (for example in Hilt, annotate your test classes with @HiltAndroidTest and apply the HiltAndroidRule). Other frameworks use other mechanisms, consult their documentation.

Step 3: Install frameworks

Unless otherwise specified, respect the current stack of testing frameworks.

If there are no testing frameworks, and the user didn't specify any preference, install the following:

  • JUnit4 for local and instrumented tests

  • JaCoCo for test coverage

  • For UI tests: if the project has views, Espresso. If it's fully Compose, use the Compose Testing APIs.

  • Robolectric to run UI Tests

  • Compose Preview Screenshot Testing tool for screenshot tests. Check the project's AGP version first, then pick the matching setup and follow it strictly:

    • AGP 9.5.0-alpha03 or higher (recommended): configure an AGP test suite using testOptions { screenshotTests.create(...) }, as described in Screenshot testing with test suites.
    • Lower AGP versions: use the legacy standalone plugin setup with com.android.compose.screenshot, and tell the user it's deprecated. Don't upgrade AGP as part of setting up screenshot tests. Mention that test suites are available on 9.5.0-alpha03 or higher, and leave the upgrade as a separate decision.

    Don't combine both setups in the same module. If the project already uses the standalone plugin and its AGP version supports test suites, offer to migrate it using the tasks and paths mapping table in Screenshot testing with test suites.

  • Dropshots for device screenshot tests

  • If a mocking framework is necessary, install Mockk (io.mockk:mockk). Do not install it unless it is clearly necessary.

If instrumented screenshot tests are requested, install Dropshots.

If end-to-end testing is requested, install

자주 묻는 질문

실제 테스트 케이스도 작성하나요?

스킬은 테스트 구성과 하네스에 집중합니다. 어떤 동작을 테스트할지는 여전히 직접 정합니다.

어떤 종류의 스크린샷 테스트를 알고 있나요?

기기 기반 스크린샷 테스트와 Robolectric 또는 LayoutLib 기반의 로컬 테스트를 인식합니다.

어떤 의존성 주입 도구를 인식하나요?

Hilt, Koin, Anvil, 바닐라 Dagger 같은 프레임워크를 인식합니다.

상세 정보

작성자의 원본 설명

Analyze and create a testing strategy for Android apps - install testing libraries, set up test infrastructure, create harnesses for unit tests, UI tests, screenshot tests, and end-to-end tests.

repo: android/skills

인기도

GitHub 스타
10k
순위
#11937
라이선스
Apache-2.0
업데이트
2026. 10. 29.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬