본문으로 건너뛰기
Skillpedia
테스트12k · #11499

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가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/nasa/fprime/blob/devel/.github/skills/fprime-component-unit-test/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

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:

  1. 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.
  2. TDD: If following test-driven development (tests before implementation), see TDD guide. The FPP model is sufficient to write tests — implementation is not required.
  3. Coverage: Run fprime-util check --coverage and 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.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬