Agent skill
testing-debugging
Testing and debugging for Zephyr RTOS. Covers the Ztest framework for unit and integration tests, the Twister test runner for automated HIL/SIM validation, and advanced tracing/debugging techniques (SystemView, Thread Analyzer, Stack analysis). Trigger when writing unit tests, setting up CI/CD pipelines, or analyzing system performance and latency.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/testing-debugging
SKILL.md
Zephyr Testing & Debugging
Ensure code quality and system reliability using Zephyr's comprehensive testing framework and observability tools.
Core Workflows
1. Ztest Framework
Write robust unit and integration tests for native simulation and real hardware.
- Reference: ztest_framework.md
- Key Tools:
ZTEST_SUITE,ZTEST,zassert_equal.
2. Twister Test Runner
Automate test execution across multiple platforms and generate professional reports.
- Reference: twister_testing.md
- Key Tools:
twisterscript,testcase.yaml, hardware mapping.
3. Tracing & Debugging
Analyze system behavior, timing, and memory usage with advanced tracing tools.
- Reference: tracing_debugging.md
- Key Tools:
CONFIG_TRACING, Segger SystemView, Thread Analyzer.
Quick Start (Ztest)
#include <zephyr/ztest.h>
ZTEST_SUITE(basic_test, NULL, NULL, NULL, NULL, NULL);
ZTEST(basic_test, test_pass) {
zassert_true(true, "Boolean evaluation failed");
}
Professional Patterns (Reliability)
- Continuous Integration: Integrate Twister reports (
twister.json) into CI/CD pipelines for automated regression testing. - HIL Validation: Use hardware maps to consistently run critical hardware tests on real devices during every release cycle.
- Stack Safety: Always enable
CONFIG_STACK_SENTINELand the Thread Analyzer during development to catch memory issues early.
Automation Tools
- twister_smoke.py: Run a small Twister suite and print result summary.
Examples & Templates
- testcase.yaml.template: Starter testcase metadata for Twister.
Validation Checklist
-
twisterexecutes selected test suites with no unexpected failures. - At least one
ZTESTsuite runs in simulation and reports pass/fail correctly. - Tracing or thread-analyzer output is captured and reviewed for hotspots.
- CI artifacts include machine-readable reports (for example
twister.json).
Resources
- References:
ztest_framework.md: Writing tests with expectations and suites.twister_testing.md: Using the test runner and metadata.tracing_debugging.md: Tracing, stack analysis, and debugging backends.
- Scripts:
twister_smoke.py: Lightweight Twister runner with summary output.
- Assets:
testcase.yaml.template: Reusable testcase metadata template.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?