{"id":51583520,"url":"https://github.com/gay00ung/diff2test-android","last_synced_at":"2026-07-11T08:03:52.084Z","repository":{"id":346532992,"uuid":"1190262641","full_name":"gay00ung/diff2test-android","owner":"gay00ung","description":"Diff-driven Android ViewModel test generation CLI with AI-assisted planning, generation, and Gradle verification.","archived":false,"fork":false,"pushed_at":"2026-03-25T09:03:49.000Z","size":1973,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-25T10:51:36.888Z","etag":null,"topics":["ai-tools","android","android-testing","cli","code-generation","developer-tools","gradle","kotlin","llm","test-generation","unit-testing","viewmodel"],"latest_commit_sha":null,"homepage":"https://github.com/gay00ung/diff2test-android/releases","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gay00ung.png","metadata":{"files":{"readme":"README.ko.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":"docs/roadmap-1.0.md","authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-24T05:38:55.000Z","updated_at":"2026-03-25T09:04:03.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/gay00ung/diff2test-android","commit_stats":null,"previous_names":["gay00ung/diff2test-android"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/gay00ung/diff2test-android","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gay00ung%2Fdiff2test-android","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gay00ung%2Fdiff2test-android/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gay00ung%2Fdiff2test-android/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gay00ung%2Fdiff2test-android/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gay00ung","download_url":"https://codeload.github.com/gay00ung/diff2test-android/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gay00ung%2Fdiff2test-android/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35355118,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-11T02:00:05.354Z","response_time":104,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-tools","android","android-testing","cli","code-generation","developer-tools","gradle","kotlin","llm","test-generation","unit-testing","viewmodel"],"created_at":"2026-07-11T08:03:51.436Z","updated_at":"2026-07-11T08:03:52.078Z","avatar_url":"https://github.com/gay00ung.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003ch1\u003ediff2test-android\u003c/h1\u003e\n  \u003cp\u003e\u003cstrong\u003e코드 diff 기반 Android ViewModel 테스트 생성 CLI\u003c/strong\u003e\u003c/p\u003e\n  \u003cp\u003e변경된 ViewModel을 감지하고, 테스트 계획을 만들고, local unit test 후보를 생성한 뒤, Gradle로 검증합니다.\u003c/p\u003e\n  \u003cp\u003e\n    \u003ca href=\"https://github.com/gay00ung/diff2test-android/stargazers\"\u003e\n      \u003cimg alt=\"GitHub stars\" src=\"https://img.shields.io/github/stars/gay00ung/diff2test-android?style=flat-square\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/gay00ung/diff2test-android/releases\"\u003e\n      \u003cimg alt=\"Release\" src=\"https://img.shields.io/github/v/release/gay00ung/diff2test-android?style=flat-square\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/gay00ung/diff2test-android/releases\"\u003e\n      \u003cimg alt=\"Homebrew\" src=\"https://img.shields.io/badge/install-Homebrew-fbbf24?style=flat-square\u0026logo=homebrew\"\u003e\n    \u003c/a\u003e\n    \u003cimg alt=\"CLI 1.0\" src=\"https://img.shields.io/badge/cli-1.0.0-2563eb?style=flat-square\"\u003e\n    \u003cimg alt=\"MCP experimental\" src=\"https://img.shields.io/badge/mcp-experimental-f97316?style=flat-square\"\u003e\n    \u003cimg alt=\"Kotlin 1.9.25\" src=\"https://img.shields.io/badge/kotlin-1.9.25-7f52ff?style=flat-square\"\u003e\n    \u003cimg alt=\"Java 17\" src=\"https://img.shields.io/badge/java-17-437291?style=flat-square\"\u003e\n  \u003c/p\u003e\n  \u003cp\u003e\n    \u003ca href=\"./README.md\"\u003eEnglish\u003c/a\u003e\n    ·\n    \u003ca href=\"./README.ko.md\"\u003e한국어\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"./docs/assets/readme-hero.png\" alt=\"d2t workflow banner\" width=\"960\"\u003e\n\u003c/p\u003e\n\n\u003e `d2t` 1.0은 한 가지에 집중합니다. 변경된 Android ViewModel을 검증 가능한 local unit test로 바꾸는 일입니다. 제품의 중심은 CLI이며, MCP 앱은 여전히 experimental 단계입니다.\n\n## 왜 d2t인가요\n\nAndroid 테스트 생성 도구는 대체로 두 가지 문제를 가집니다.\n\n- 실제 diff를 보지 않고 너무 많은 테스트를 만듭니다.\n- 테스트 코드는 생성하지만, 검증 단계에서 멈춥니다.\n\n`d2t`는 이 흐름을 더 좁고 실용적으로 가져갑니다.\n\n1. `git diff`에서 변경된 `*ViewModel.kt`를 찾습니다.\n2. 변경된 ViewModel 표면과 collaborator를 분석합니다.\n3. 시나리오 중심 `TestPlan`을 만듭니다.\n4. local unit test 후보 코드를 생성합니다.\n5. 생성된 테스트를 Gradle로 바로 검증합니다.\n\n즉, 단순 코드 생성기가 아니라 개발 워크플로우 도구로 설계되어 있습니다.\n\n## 1.0에서 포함하는 범위\n\n`d2t` 1.0은 의도적으로 범위를 좁게 잡았습니다.\n\n- diff 기반 Android ViewModel local unit test 생성\n- 생성된 테스트의 Gradle 검증\n- 사용자 소유 API 키 사용\n- OpenAI Responses API 지원\n- Anthropic Messages API 지원\n- Gemini GenerateContent API 지원\n- custom `responses-compatible` endpoint 지원\n- custom `chat-completions` endpoint 지원\n- 릴리스 ZIP 및 Homebrew 배포\n\n## 1.0에서 약속하지 않는 범위\n\n- transport가 연결된 정식 MCP 서버\n- instrumented `androidTest` 생성\n- Compose UI test 생성\n- 완전한 end-to-end 자동 repair 루프\n- 모든 Android 빌드 그래프에서 완벽한 외부 classpath symbol resolution\n\n## 설치 방법\n\n### Homebrew\n\n```bash\nbrew install gay00ung/diff2test-android/d2t\n```\n\n원하면 tap을 먼저 등록한 뒤 짧은 이름으로 설치하실 수도 있습니다.\n\n```bash\nbrew tap gay00ung/diff2test-android\nbrew install d2t\n```\n\n### 릴리스 ZIP\n\n최신 릴리스의 `d2t.zip`을 내려받아 아래처럼 실행해주세요.\n\n```bash\nunzip d2t.zip\ncd d2t\n./bin/d2t help\n```\n\n### 소스에서 실행\n\n```bash\ngit clone https://github.com/gay00ung/diff2test-android.git\ncd diff2test-android\n./gradlew test\n./d2t help\n```\n\n## 빠른 시작\n\n### 1. 설정 파일 만들기\n\n```bash\nd2t init\n```\n\n### 2. AI provider 연결하기\n\n```toml\n[ai]\nenabled = true\nprovider = \"custom\"\nprotocol = \"chat-completions\"\napi_key_env = \"LLM_API_KEY\"\nmodel = \"qwen3-coder-next-mlx\"\nbase_url = \"http://127.0.0.1:12345/v1\"\nconnect_timeout_seconds = 30\nrequest_timeout_seconds = 300\n```\n\n### 3. 설정 확인하기\n\n```bash\nd2t doctor\n```\n\n### 4. 현재 변경분 기준으로 생성 + 검증 실행하기\n\n```bash\nd2t auto --ai\n```\n\n소스에서 직접 실행하는 경우에는 `d2t` 대신 `./d2t`를 사용해주세요.\n\n## 지원하는 AI 프로토콜\n\n`~/.config/d2t/config.toml`에는 실제 비밀키를 넣지 않고, 비밀키가 들어 있는 환경변수 이름만 저장합니다.\n\n현재 지원하는 provider/protocol 조합은 아래와 같습니다.\n\n- `provider = \"openai\"` + `protocol = \"responses-compatible\"`\n- `provider = \"anthropic\"` + `protocol = \"anthropic-messages\"`\n- `provider = \"gemini\"` + `protocol = \"gemini-generate-content\"`\n- `provider = \"custom\"` + `protocol = \"responses-compatible\"`\n- `provider = \"custom\"` + `protocol = \"chat-completions\"`\n\n예:\n\n```bash\nsource ~/.zshrc\nd2t doctor\nd2t auto --ai\n```\n\n## 동작 방식\n\n전체 흐름은 아래와 같습니다.\n\n```text\ngit diff\n  -\u003e 변경된 ViewModel 감지\n  -\u003e ViewModel 분석\n  -\u003e TestPlan 생성\n  -\u003e AI 또는 deterministic 코드 생성\n  -\u003e quality gate\n  -\u003e Gradle 검증\n```\n\n핵심 포인트는 이렇습니다.\n\n- 모델에게 레포 전체를 던지고 막 생성하게 하지 않습니다.\n- 먼저 diff와 ViewModel 분석 결과로 생성 범위를 좁힙니다.\n- 생성된 테스트는 quality gate를 통과해야 합니다.\n- `auto`는 기본적으로 생성과 검증을 함께 수행합니다.\n- `--repair`를 주면 import 및 coroutine-test utility 관련 공통 오류에 대해 bounded repair를 1회 시도합니다.\n\n## 명령어\n\n```bash\nd2t init [--force]\nd2t doctor\nd2t scan\nd2t plan path/to/SomeViewModel.kt\nd2t generate path/to/SomeViewModel.kt --write [--ai|--no-ai] [--strict-ai]\nd2t auto [--ai|--no-ai] [--strict-ai] [--model model-name] [--no-verify] [--repair]\nd2t verify :module:testTask\n```\n\n## 문제 해결\n\n### `No changed ViewModel files were detected`\n\n- 현재 working tree에 수정된 `*ViewModel.kt`가 있는지 먼저 확인해주세요.\n- 아니면 `plan`이나 `generate`에 파일 경로를 직접 넘겨주세요.\n\n### AI 요청이 timeout 됩니다\n\n- `request_timeout_seconds`를 늘려주세요.\n- 더 빠른 모델로 바꿔주세요.\n- 게이트웨이가 그 경로를 더 안정적으로 처리한다면 `protocol = \"chat-completions\"`를 우선 사용해주세요.\n\n### 생성된 테스트가 quality gate에서 막힙니다\n\n- 생성된 결과가 너무 취약하거나 불완전하다는 뜻입니다.\n- 보통은 Gradle 문제가 아니라 생성 품질 문제입니다.\n- 더 강한 모델로 다시 시도하거나, 검증까지 포함할 때 `--repair`를 같이 사용해주세요.\n\n### 생성은 됐는데 verify에서 실패합니다\n\n- `src/test/kotlin/...GeneratedTest.kt` 파일을 먼저 확인해주세요.\n- CLI가 출력한 Gradle 검증 명령을 직접 실행해보세요.\n- import나 coroutine utility 관련 문제라면 `d2t auto --ai --repair`로 다시 시도해주세요.\n\n## 레포 구조\n\n- `apps/cli`: 메인 CLI 앱\n- `apps/mcp-server`: experimental MCP 카탈로그 스캐폴딩\n- `modules/*`: 엔진 모듈\n- `prompts/*`: 프롬프트 템플릿과 정책\n- `fixtures/*`: 샘플 앱과 검증용 fixture\n- `docs/*`: 아키텍처와 배포 문서\n\n## 배포 경로\n\n이 레포에는 아래가 포함되어 있습니다.\n\n- Homebrew formula: [`packaging/homebrew/d2t.rb`](./packaging/homebrew/d2t.rb)\n- 릴리스 자동화: [`.github/workflows/release.yml`](./.github/workflows/release.yml)\n- 태그 자동화: [`.github/workflows/tag-release.yml`](./.github/workflows/tag-release.yml)\n- 배포 ZIP 생성: `./gradlew :apps:cli:distZip`\n\n생성된 ZIP은 아래 경로에 저장됩니다.\n\n```bash\napps/cli/build/distributions/d2t.zip\n```\n\n## 제품 범위\n\n안정화된 제품 표면은 CLI입니다.\n\nMCP 앱은 아직 experimental입니다.\n\n- 카탈로그 스캐폴딩 용도로는 의미가 있습니다.\n- 하지만 production용 transport-bound MCP 서버로 포지셔닝하지는 않습니다.\n\n자세한 릴리스 기준과 로드맵은 아래 문서를 참고해주세요.\n\n- [`docs/release-gate-1.0.md`](./docs/release-gate-1.0.md)\n- [`docs/roadmap-1.0.md`](./docs/roadmap-1.0.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgay00ung%2Fdiff2test-android","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgay00ung%2Fdiff2test-android","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgay00ung%2Fdiff2test-android/lists"}