Skip to main content

Analyze and optimize iOS XCUITest projects - find orphaned tests, inconsistent naming, overused identifiers, and more

Project description

XCUITest Goblin

Tests PyPI version Python 3.10+ License: MIT

Find orphaned tests, inconsistent naming, overused identifiers, bloated test files, and more — in under 1 second.

A zero-dependency CLI tool that analyzes your iOS XCUITest suite and surfaces actionable recommendations to keep your tests healthy.

📊 View Sample Report — See what XCUITest Goblin finds in a real project

Why Use This?

Your test suite grows organically. Tests get added, renamed, skipped, forgotten. Before you know it:

  • 431 tests aren't in any test plan (they never run in CI)
  • 16 files don't follow your naming convention
  • 3 files have 30+ tests and are impossible to maintain
  • 61 accessibility IDs are defined but never used in tests
  • 5 test methods don't follow your naming convention

This tool finds these issues instantly and tells you exactly what to fix.

Quick Start

pip install xcuitest-goblin
xcuitest-goblin analyze /path/to/your/ios-project

That's it. In under a second, you get a full analysis report.

Example Output

✓ Analysis complete!

Results:
  - 58 test files
  - 505 test methods
  - 84 accessibility IDs
  - 15 test plans

Output: ./analysis/
Time: 0.15s

Sample Recommendations

## Recommendations

- **Split Large Test Files:** 3 file(s) contain more than 30 tests
- **Standardize File Naming:** 71.9% consistent, 16 non-compliant files
- **Standardize Method Naming:** 99.0% consistent (camelCase expected)
- **Refine Generic Accessibility IDs:** Done (150 uses), Cancel (58 uses)
- **Remove Unused Accessibility IDs:** 61 IDs defined but never used
- **Add Orphaned Tests to Plans:** 431 tests never run in CI

Use in Your PR Workflow

Add to your CI pipeline to catch test hygiene issues before they merge:

- name: Analyze Test Suite
  run: |
    xcuitest-goblin analyze . --quiet
    # Fails if critical issues found (coming soon)

Keep your test suite healthy with every PR.

Configurable Thresholds

Customize what triggers recommendations via thresholds.json:

Section Threshold Default Triggers When...
test_inventory large_file_threshold 30 File has more than 30 tests
test_file_naming pattern [Feature]Tests.swift Expected naming pattern (null to skip)
test_file_naming consistency_threshold 90% File naming consistency below 90%
test_method_naming pattern camelCase Expected style (camelCase/snake_case/BDD)
test_method_naming consistency_threshold 85% Method naming consistency below 85%
accessibility_ids generic_id_usage_threshold 50 ID used 50+ times
accessibility_ids unused_ids_threshold 0 Any ID defined but unused
test_plans orphaned_tests_threshold 0 Any test not in a plan
xcuitest-goblin analyze /path/to/project --config ./my-thresholds.json

See Configuration Guide for all options.

Output Files

File Contents
ANALYSIS_REPORT.html Interactive HTML report with recommendations
test_inventory.json All test files, classes, methods
accessibility_ids.json ID usage patterns and definitions
test_plans.json Plan analysis, orphaned tests, overlaps
screen_graph.json Navigation patterns (if detected)

Installation

From PyPI (recommended)

pip install xcuitest-goblin

From Source

git clone https://github.com/jmcy9999/xcuitest-goblin.git
cd xcuitest-goblin
pip install -e .

Requires Python 3.10+. No external dependencies.

Documentation

Try It Out

Give XCUITest Goblin a spin on your project and let us know what you think! We'd love your feedback — open an issue with suggestions, bug reports, or feature requests.

More features coming soon: CI integration with exit codes, test coverage analysis, flaky test detection, and more.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xcuitest_goblin-2.2.1.tar.gz (58.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xcuitest_goblin-2.2.1-py3-none-any.whl (48.4 kB view details)

Uploaded Python 3

File details

Details for the file xcuitest_goblin-2.2.1.tar.gz.

File metadata

  • Download URL: xcuitest_goblin-2.2.1.tar.gz
  • Upload date:
  • Size: 58.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for xcuitest_goblin-2.2.1.tar.gz
Algorithm Hash digest
SHA256 425af41ef42397a92968411fab52e350cb80f16222bbeef86b199682aa15189b
MD5 5a168af2ec68022c8052bc4ac5737149
BLAKE2b-256 2aa13c9ec36adf9a140d74ae8955e0e35876fe05abee880b3d2ba45b7104163d

See more details on using hashes here.

File details

Details for the file xcuitest_goblin-2.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for xcuitest_goblin-2.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cb3bed197e107b5b6c9ea388da05c0cfa89434fa066434423b26cb4b746ec9eb
MD5 0acd591f0fd6c775b658e0c40b19c011
BLAKE2b-256 1d5560101c92b5a7276c7abe64db21c350604a093dda87f2612830ca66702092

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page