{
"name": "embedded-debugging-strategy-selection",
"description": "Meta-cognitive strategy selection for embedded systems debugging",
"content": "# Embedded Debugging Strategy Selection\n\n## Context Assessment\n**Evaluate the debugging scenario:**\n- **Device type**: ESP32, Android, or other embedded system?\n- **Access level**: Full hardware access, remote only, or simulated?\n- **Time constraints**: Immediate fix needed or thorough analysis possible?\n- **Risk level**: Production system or development environment?\n- **Symptom severity**: System down, degraded performance, or minor issue?\n\n## Strategy Options\n\n### Scientific Debugging (Hypothesis-Driven)\n**When to use:**\n- Complex interactions between components\n- Good understanding of system architecture\n- Time available for systematic investigation\n- Root cause analysis required\n\n**ESP32 Application:**\n```\n# 1. Form hypothesis\n# \"WiFi disconnection caused by power supply noise\"\n\n# 2. Design test\n# Monitor voltage levels during disconnection events\n\n# 3. Execute test\nget_esp32_telemetry --sensor_types '[\"wifi_signal\", \"voltage\"]'\n\n# 4. Analyze results\nanalyze_telemetry_patterns --sensor_type voltage --analysis_type correlation\n```\n\n### Pattern Matching (Experience-Based)\n**When to use:**\n- Seen similar issues before\n- Time pressure for quick resolution\n- Familiar system or component\n- Standard troubleshooting steps exist\n\n**Android Application:**\n```\n# Recognize pattern: \"App crashes when clipboard accessed\"\n# Apply known solution: Check permissions\n\nget_android_device_info\n# Verify: android.permission.READ_CLIPBOARD granted\n```\n\n### Binary Search (Divide and Conquer)\n**When to use:**\n- Issue can be isolated to specific code paths\n- Reproducible test case available\n- Large codebase with clear boundaries\n- Version control available for bisecting\n\n**Cross-Device Application:**\n```\n# Use git bisect to find problematic commit\n# Test on both ESP32 and Android devices\n# Isolate platform-specific vs universal issues\n\ngit_analyze_history --file \"src/shared_lib.c\"\nexecute_cross_device_workflow --workflow_name \"bisect_test\"\n```\n\n### Exploratory Debugging (Trial and Error)\n**When to use:**\n- Unknown system behavior\n- Learning opportunity\n- No clear hypothesis\n- Time available for investigation\n\n**Embedded System Application:**\n```\n# Try different approaches systematically\n# Document each attempt and result\n\nanalyze_embedded_patterns --pattern_type telemetry\nmonitor_embedded_health --include_telemetry true\npredict_embedded_behavior --device_id \"esp32-001\" --prediction_type usage\n```\n\n### External Perspective (Documentation/Colleague Review)\n**When to use:**\n- Stuck on problem\n- Fresh viewpoint needed\n- Complex system interactions\n- Knowledge transfer opportunity\n\n**Implementation:**\n```\n# Document current findings\n# Share with team member\n# Review system architecture together\n# Consider alternative explanations\n\nget_embedded_context --include_history true\n# Share context with colleague for review\n```\n\n## Decision Framework\n\n### Quick Assessment Questions\n1. **How critical is the issue?**\n - System down → Scientific or Pattern Matching\n - Minor issue → Exploratory or Documentation\n\n2. **How much time is available?**\n - Immediate fix needed → Pattern Matching\n - Thorough analysis possible → Scientific or Binary Search\n\n3. **How familiar am I with the system?**\n - Very familiar → Pattern Matching\n - Learning system → Exploratory or External\n\n4. **How reproducible is the issue?**\n - Always reproducible → Binary Search\n - Intermittent → Scientific or Exploratory\n\n### Strategy Selection Matrix\n\n| Context | Time Available | Familiarity | Reproducibility | Recommended Strategy |\n|---------|---------------|-------------|----------------|---------------------|\n| Critical | Limited | High | Any | Pattern Matching |\n| Critical | Limited | Low | Any | External Perspective |\n| Critical | Available | Any | High | Binary Search |\n| Critical | Available | Any | Low | Scientific |\n| Minor | Any | High | Any | Pattern Matching |\n| Minor | Any | Low | Any | Exploratory |\n\n## Execution Guidelines\n\n### Strategy Switching\n**When to change strategies:**\n- Current approach not yielding results after 30 minutes\n- New information invalidates current hypothesis\n- Better approach becomes apparent\n- External constraints change (time pressure increases)\n\n### Documentation Requirements\n**Always document:**\n- Initial strategy selection rationale\n- Key findings from each approach\n- Why strategy was changed (if applicable)\n- Final resolution and lessons learned\n\n### Learning Opportunities\n**Capture for future use:**\n- Successful debugging approaches\n- Common failure patterns\n- Tool effectiveness in different scenarios\n- Strategy effectiveness metrics\n\n## Tool Selection Guide\n\n### ESP32-Specific Tools\n- **Serial Monitor**: Real-time logging and status\n- **GDB/OpenOCD**: Hardware debugging\n- **ESP-IDF Monitor**: Enhanced logging\n- **JTAG Debugger**: Full system inspection\n\n### Android-Specific Tools\n- **ADB**: Device communication and control\n- **Logcat**: System and application logging\n- **Android Studio Profiler**: Performance analysis\n- **Device Monitor**: System resource monitoring\n\n### Cross-Platform Tools\n- **MCP Coordinator**: Unified device management\n- **Cognitive Prompts**: Pattern recognition and analysis\n- **Workflow Orchestration**: Multi-device coordination\n- **Telemetry Aggregation**: Cross-device data analysis\n\n## Success Metrics\n\n### Effectiveness Measures\n- **Time to resolution**: How quickly issue was identified and fixed\n- **Accuracy**: Correctness of root cause identification\n- **Learning value**: Insights gained for future debugging\n- **System impact**: Minimal disruption during debugging process\n\n### Continuous Improvement\n- **Strategy effectiveness tracking**: Which strategies work best\n- **Tool effectiveness analysis**: Which tools provide most value\n- **Pattern database building**: Accumulation of debugging knowledge\n- **Process optimization**: Refinement of debugging workflows\n",
"arguments": [],
"tags": [
"embedded",
"debugging",
"strategy",
"meta-cognition",
"methodology"
],
"isTemplate": false,
"metadata": {
"layer": 5,
"domain": 1,
"abstractionLevel": 4
}
}