Langsung ke konten
Skillpedia
Testing12k Β· #11499

fprime-component-unit-test

Fungsinya

Skill ini memandu AI melalui perencanaan dan penulisan tes unit untuk persyaratan, port, event, dan perintah komponen. Skill ini untuk insinyur yang memverifikasi perangkat lunak penerbangan F Prime.

Kapan dipakai

  • βœ“Saat implementasi komponen F Prime sudah siap dan memerlukan tes unit.
  • βœ“Saat Anda ingin tes unit ditulis lebih dulu, mengikuti praktik test-first.
  • βœ“Saat Anda menginginkan cakupan kode yang tinggi untuk komponen F Prime.

Link skill

https://github.com/nasa/fprime/blob/devel/.github/skills/fprime-component-unit-test/SKILL.md

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/nasa/fprime/blob/devel/.github/skills/fprime-component-unit-test/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit β†’

Contoh permintaan ke AI

β€œBisakah Anda menulis tes unit untuk komponen F Prime ini yang mencakup setiap persyaratan?”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

AI menyiapkan harness tes, menulis tes untuk setiap persyaratan dan antarmuka, menjalankannya, dan menargetkan cakupan tinggi dengan tes berbasis aturan jika sesuai.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari 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
Pertanyaan umum

Target cakupan apa yang ditetapkan?

Targetnya cakupan kode 95 persen.

Apa itu tes berbasis aturan?

Itu adalah pendekatan yang diutamakan skill ini jika memungkinkan, karena cakupannya lebih luas daripada tes manual satu per satu.

Apakah skill ini memerlukan masukan saya?

Sebagian besar tidak, tetapi skill ini meminta bantuan Anda terkait perilaku yang diharapkan dan kasus tepi yang mungkin terlewat.

Detail

Deskripsi asli dari pembuat

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

Popularitas

Bintang GitHub
12k
Peringkat
#11499
Lisensi
Apache-2.0
Diperbarui
2/11/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa