بنقرة واحدة
testing-best-practices
Comprehensive testing strategies and best practices for software development
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Comprehensive testing strategies and best practices for software development
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
This skill should be used when the user wants to validate or run GitHub Actions or GitLab CI workflows locally, test CI before pushing, debug a failing action without burning CI minutes, check ".github/workflows" or ".gitlab-ci.yml" files, or use wrkflw (an `act` alternative). Also triggers before pushing changes that touch workflow files. Provides subcommand selection (validate/run/watch/tui/trigger/list), runtime-mode guidance (docker/podman/emulation), copy-paste recipes, and the tool's known limitations so expectations are set correctly.
Analytical framework for writing style analysis and voice profile construction. Use when analyzing writing samples, building voice profiles, comparing styles, synthesizing metavoice descriptions, or understanding stylistic dimensions. Triggers on "analyze style", "style profile", "voice analysis", "writing fingerprint", "metavoice", "style comparison", "what makes my writing distinctive".
This skill should be used when the user asks to "generate an image", "create a picture", "make an illustration", "edit this image", "upscale", or any request involving AI image generation, nanobanana, nano banana, visual grounding, prompt engineering, or image editing. Provides model selection guidance (Flash/NB2/Pro), prompt engineering techniques, visual grounding best practices, resolution and cost optimization, and multi-image editing workflows for the Nano Banana MCP server (Gemini image models).
This skill should be used when the user asks to "update documentation", "generate README", "audit docs", "add CHANGELOG", "fix outdated docs", "create CONTRIBUTING.md", "add API documentation", "check documentation coverage", or mentions documentation gaps, stale docs, or missing project documentation. Detects project type from manifest files, scores existing documentation quality, generates or updates README, CHANGELOG, CONTRIBUTING, and code documentation for any repository type.
This skill should be used when the user asks about "Android project setup", "new Android app", "MVVM", "Clean Architecture", "Android architecture", "Hilt", "dependency injection", "Room database", "Retrofit", "data layer", "repository pattern", "Android project structure", "Kotlin Android", "Jetpack libraries", or mentions starting a new Android project, choosing an architecture pattern, or setting up dependency injection. Provides opinionated architecture guidance for Kotlin/Compose Android apps.
This skill should be used when the user asks about "Android permissions", "runtime permissions", "camera permission", "storage permission", "notifications", "Photo Picker", "Credential Manager", "Predictive Back", "per-app language", "Baseline Profiles", "Android 16", "adaptive layouts", "Android crash", "Gradle sync fails", "build error", "ANR", "ProGuard", "R8", "Android emulator", or mentions requesting permissions, using platform APIs, troubleshooting Android errors, or dealing with crashes and build failures. Provides permissions guidance, modern platform features, and troubleshooting for Android development.
| name | testing-best-practices |
| description | Comprehensive testing strategies and best practices for software development |
| version | 1.0.0 |
| tags | ["testing","quality-assurance","tdd","unit-tests"] |
This skill provides expert knowledge on software testing methodologies, patterns, and best practices.
def test_user_registration():
# Arrange: Set up test data and dependencies
user_data = {"email": "test@example.com", "password": "secure123"}
user_service = UserService()
# Act: Execute the behavior being tested
result = user_service.register(user_data)
# Assert: Verify the outcome
assert result.success is True
assert result.user.email == "test@example.com"
Mocks: Verify interactions
mock_email_service = Mock()
user_service.register(user_data)
mock_email_service.send_welcome_email.assert_called_once()
Stubs: Provide predetermined responses
stub_database = StubDatabase()
stub_database.get_user.returns(None) # Simulate user not found
Fakes: Working implementations with shortcuts
fake_cache = InMemoryCache() # Instead of Redis for testing
# Good: Describes what and why
def test_registration_fails_when_email_already_exists():
pass
# Bad: Generic, unclear
def test_registration():
pass
# Good: Focused test
def test_user_email_is_stored_lowercase():
user = User(email="Test@Example.COM")
assert user.email == "test@example.com"
def test_user_email_is_validated():
with pytest.raises(ValueError):
User(email="invalid-email")
# Bad: Tests depend on execution order
def test_create_user():
global created_user
created_user = User.create(...)
def test_update_user():
created_user.update(...) # Depends on previous test
# Good: Each test is independent
def test_update_user():
user = User.create(...) # Create locally
user.update(...)
@pytest.fixture
def authenticated_user():
user = User.create(email="test@example.com")
user.login()
yield user
user.delete() # Cleanup
def test_user_can_access_dashboard(authenticated_user):
response = authenticated_user.get_dashboard()
assert response.status_code == 200
When this skill is active: