fprime-component-unit-test
하는 일
컴포넌트의 요구사항, 포트, 이벤트, 명령에 대한 단위 테스트를 계획하고 작성하도록 AI 에이전트를 안내합니다. F Prime 비행 소프트웨어를 검증하는 엔지니어를 위한 스킬입니다.
사용하는 경우
- ✓F Prime 컴포넌트 구현이 준비되어 단위 테스트가 필요할 때.
- ✓테스트 우선 실천법에 따라 단위 테스트를 먼저 작성하고 싶을 때.
- ✓F Prime 컴포넌트의 코드 커버리지를 높게 원할 때.
스킬 링크
https://github.com/nasa/fprime/blob/devel/.github/skills/fprime-component-unit-test/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“이 F Prime 컴포넌트의 각 요구사항을 다루는 단위 테스트를 작성해 주실 수 있나요?”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
AI는 테스트 하네스를 설정하고, 각 요구사항과 인터페이스에 대한 테스트를 작성해 실행하며, 높은 커버리지를 목표로 하고, 적합한 곳에서는 규칙 기반 테스트를 사용합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Skill: F Prime Component Unit Testing
Unit tests verify each component requirement in isolation using the
autocoded test harness. This skill provides lifecycle context and
goals; for scaffolding, assertion macros, code patterns, and the full
implementation procedure, see fprime-unit-testing and the
unit testing guide.
Goals
- Verify all requirements with unit tests if possible.
- Verify all interfaces: ports, events, telemetry, commands.
- Prefer rule-based testing where possible — it provides broader
coverage than traditional tests. See
fprime-unit-testing§3 for criteria and constructs, and the rules-based testing guide for the full walkthrough. - Target 95% code coverage.
- You should be able to do most of this without user input, since requirements and the FPP model are already defined. However, ask the user for help with predicting edge cases you may have missed or for clarification on expected behavior.
Process
Follow fprime-unit-testing for the step-by-step procedure:
scaffold → implement → register → run. That skill covers Tester
class structure, TestMain layout, CMakeLists registration, assertion
macros, helper functions, and rules-based testing.
Key decisions within the lifecycle:
- Traditional vs. rule-based: Use the criteria table in
fprime-unit-testing§3. Default to rule-based for components with multiple ports or stateful behavior. - TDD: If following test-driven development (tests before implementation), see TDD guide. The FPP model is sufficient to write tests — implementation is not required.
- Coverage: Run
fprime-util check --coverageand review*_gcov.txt. Target 95%.
Anti-Patterns
- Testing only happy paths — off-nominal coverage is critical
- Forgetting
doDispatch()for async commands/ports - Asserting only on count (
SIZE) without checking values - Modifying component internals directly (test through the interface only)
- Guessing expected values — derive from requirements
자주 묻는 질문
커버리지 목표는 얼마인가요?
코드 커버리지 95퍼센트를 목표로 합니다.
규칙 기반 테스트가 무엇인가요?
가능하면 스킬이 선호하는 방식으로, 직접 작성한 개별 검사보다 더 넓게 검증할 수 있다고 설명합니다.
사용자의 입력이 필요한가요?
대체로 아닙니다. 다만 기대 동작과 놓칠 수 있는 경계 사례에 대해서는 도움을 요청합니다.
상세 정보
작성자의 원본 설명
Unit testing phase of F Prime component development. Provides lifecycle context, goals, and decision criteria for the unit testing phase. Defers to fprime-unit-testing for implementation details. Trigger when implementation is ready for testing or when following TDD (tests before implementation). Keywords: F Prime, unit test, GTest, TesterBase, GTestBase, Tester, fprime-util check, STest, rule-based testing.
repo: nasa/fprime
인기도
- GitHub 스타
- 12k
- 순위
- #11499
- 라이선스
- Apache-2.0
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
fprime-cmake-build-system
12k에이전트가 F Prime 비행 소프트웨어 프로젝트의 CMake 계층을 통해 모듈, 빌드 타깃, 플랫폼 설정을 추가하도록 돕습니다.
fprime-component-design-fpp
12k에이전트가 승인된 F Prime 컴포넌트 요구사항을 포트, 명령, 이벤트, 텔레메트리의 FPP 모델로 바꾸도록 돕습니다.
fprime-component-development
12k에이전트가 요구사항에서 통합 테스트까지, F Prime 컴포넌트를 각 개발 단계마다 안내하도록 돕습니다.
fprime-component-implementation
12k에이전트가 F Prime 컴포넌트의 자동 생성된 핸들러 함수에 들어갈 C++ 코드를 프로젝트 규칙에 맞춰 작성하도록 돕습니다.
비슷한 스킬
test-driven-development
311k에이전트가 기능이나 수정을 만들기 전에 실패하는 테스트를 먼저 쓰고, 그것을 통과시키는 가장 작은 코드를 작성하도록 가르칩니다.
verification-before-completion
311k에이전트가 작업, 수정, 빌드가 완료되었거나 통과했다고 말하기 전에 실제 점검을 실행하고 결과를 읽도록 가르칩니다.
migrate-to-shoehorn
310k테스트 파일의 위험한 타입 캐스팅을 shoehorn 라이브러리로 바꿔, 테스트가 일부 데이터만 써도 타입 검사를 통과하도록 돕습니다.