Skip to main content

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

Project description

XCUITest Goblin

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-0.1.0.tar.gz (53.2 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-0.1.0-py3-none-any.whl (48.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for xcuitest_goblin-0.1.0.tar.gz
Algorithm Hash digest
SHA256 711d203442f718ce5251bdcbf1537aa721bc301a95d3a07780bbdc4b295b3e8c
MD5 8814cf63d0a309ef25f5aa40344097ba
BLAKE2b-256 79687c08dc87875102c972861ed569e15ef598bd66570ae83a88666ccfe20d12

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for xcuitest_goblin-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1da841a1f348f76407d7be4ac53c4dabe56c2fd157e7ae3638057fb98f6cd21e
MD5 276040a4fe2666812b3cc7db4b6bec65
BLAKE2b-256 dcd0a04bafba1b90dbacc511a2f48eec4f516d7795b873c53e8b3b844fc16544

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