मुख्य सामग्री पर जाएँ
Skillpedia
टेस्टिंग12k · #11499

fprime-component-unit-test

यह क्या करती है

यह AI को कंपोनेंट की आवश्यकताओं, पोर्ट, इवेंट और कमांड के लिए यूनिट टेस्ट की योजना बनाने और लिखने के चरण समझाती है। यह F Prime फ़्लाइट सॉफ़्टवेयर को सत्यापित करने वाले इंजीनियरों के लिए है।

कब इस्तेमाल करें

  • ✓जब किसी F Prime कंपोनेंट का इम्प्लीमेंटेशन तैयार हो और उसे यूनिट टेस्ट चाहिए।
  • ✓जब आप चाहते हैं कि पहले टेस्ट लिखे जाएँ, टेस्ट-फ़र्स्ट अभ्यास के अनुसार।
  • ✓जब आप F Prime कंपोनेंट के लिए उच्च कोड कवरेज चाहते हैं।

Skill का लिंक

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

इसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।

कैसे इस्तेमाल करें

सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/nasa/fprime/blob/devel/.github/skills/fprime-component-unit-test/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

AI से क्या माँगें: उदाहरण

“क्या आप इस F Prime कंपोनेंट के लिए ऐसे यूनिट टेस्ट लिख सकते हैं जो हर आवश्यकता कवर करें?”

हर हफ़्ते 5 नई skills, 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
अपडेट की गई
2/11/2026

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस repository की और skills

fprime-cmake-build-system

12k

यह आपके एजेंट को F Prime फ़्लाइट सॉफ़्टवेयर प्रोजेक्ट की CMake लेयर के ज़रिए मॉड्यूल, बिल्ड टार्गेट और प्लेटफ़ॉर्म सेटिंग जोड़ने में मदद करती है।

कोडिंगसामान्य कोडिंग

fprime-component-design-fpp

12k

यह आपके एजेंट को स्वीकृत F Prime कंपोनेंट की आवश्यकताओं को उसके पोर्ट, कमांड, इवेंट और टेलीमेट्री के FPP मॉडल में बदलने में मदद करती है।

कोडिंगAPI और सर्वर (backend)

fprime-component-development

12k

यह आपके एजेंट को F Prime कंपोनेंट को आवश्यकताओं से लेकर इंटीग्रेशन टेस्टिंग तक हर विकास चरण में आगे बढ़ाने में मदद करती है।

कोडिंगAPI और सर्वर (backend)

fprime-component-implementation

12k

यह आपके एजेंट को F Prime कंपोनेंट के जनरेट हुए हैंडलर फ़ंक्शन के पीछे का C++ कोड प्रोजेक्ट के नियमों के अनुसार लिखने में मदद करती है।

कोडिंगAPI और सर्वर (backend)

मिलती-जुलती skills