المهارات unit-testing-test-generate
📦

unit-testing-test-generate

آمن

Generate comprehensive unit tests automatically

Writing unit tests manually is time-consuming and error-prone. This skill automates test generation across multiple languages and frameworks with edge case coverage and proper mocking.

يدعم: Claude Codex Code(CC)
🥉 74 برونزي
1

تنزيل ZIP المهارة

2

رفع في Claude

اذهب إلى Settings → Capabilities → Skills → Upload skill

3

فعّل وابدأ الاستخدام

اختبرها

استخدام "unit-testing-test-generate". Generate pytest tests for a calculator module with add, subtract, multiply functions

النتيجة المتوقعة:

Test file with TestCalculator class containing parametrized tests for each operation, edge cases for zero and negative numbers, and type error handling

استخدام "unit-testing-test-generate". Create Jest tests for an async API client with mock fetch

النتيجة المتوقعة:

Test suite with mocked fetch responses, tests for success and error states, proper async/await patterns, and timeout handling

التدقيق الأمني

آمن
v1 • 2/25/2026

Static analysis detected 31 patterns but all are false positives. The skill is documentation-only containing code examples in markdown format. The subprocess.run pattern is legitimate test coverage functionality. Cryptographic warnings are Jest describe() functions. No executable code poses security risks.

1
الملفات التي تم فحصها
322
الأسطر التي تم تحليلها
0
النتائج
1
إجمالي عمليات التدقيق
لا توجد مشكلات أمنية
تم تدقيقه بواسطة: claude

درجة الجودة

38
الهندسة المعمارية
100
قابلية الصيانة
87
المحتوى
50
المجتمع
100
الأمان
91
الامتثال للمواصفات

ماذا يمكنك بناءه

Rapid test suite creation for new projects

Quickly bootstrap comprehensive test coverage when starting a new codebase or adding tests to legacy code without existing tests.

Maintain test coverage during refactoring

Regenerate tests after significant code changes to ensure coverage remains high and edge cases are still validated.

Learn testing best practices by example

Study generated tests to understand proper mocking strategies, assertion patterns, and test organization for your framework.

جرّب هذه الموجهات

Basic Python test generation
Generate pytest unit tests for the Python module at ./src/utils.py. Include tests for all public functions with happy path and error cases.
JavaScript Jest test suite
Create Jest tests for the functions in ./helpers/validation.js. Use proper mocking for external API calls and include edge cases for null and undefined inputs.
React component testing
Generate React component tests for ./components/UserProfile.tsx using Testing Library. Test rendering, props handling, and user interactions like button clicks.
Coverage gap analysis and test generation
Analyze coverage report from ./coverage/coverage.json and generate targeted tests for all uncovered lines in the src/models/ directory. Focus on boundary conditions and exception handling.

أفضل الممارسات

  • Always review generated tests to ensure assertions validate correct expected behavior
  • Add domain-specific edge cases that automated analysis may not detect
  • Run generated tests immediately to verify they pass before committing

تجنب

  • Do not commit generated tests without reviewing and understanding each assertion
  • Avoid generating tests for code that is rapidly changing - wait for stability
  • Do not rely solely on generated tests for security-critical or financial calculations

الأسئلة المتكررة

Which programming languages are supported?
Primary support for Python (pytest), JavaScript and TypeScript (Jest). Also covers Java (JUnit) and Go (testing package) with framework-specific patterns.
Can this skill test private methods?
The skill focuses on public API testing. Private methods should be tested indirectly through public method tests. Direct private method testing is generally not recommended.
How do I handle database dependencies in generated tests?
The skill generates mock fixtures for database connections. For integration tests requiring real databases, you will need to add database setup and teardown manually.
Will the generated tests work with my existing CI pipeline?
Yes, generated tests use standard framework conventions compatible with common CI tools like GitHub Actions, Jenkins, and GitLab CI.
How can I verify the quality of generated tests?
Run your coverage tool after executing generated tests. Aim for high statement and branch coverage. Review that assertions check meaningful conditions.
Can this skill update existing test files?
The skill generates new test code. You can manually merge generated tests with existing files or create separate test modules for new functionality.

تفاصيل المطور

بنية الملفات

📄 SKILL.md