tdd — TDD 테스트 스킬 arkui_ace_engine, community, TDD 테스트 스킬, ide skills, NG 컴포넌트 패턴 메서드, OpenHarmony JS UI 프레임워크, AI 에이전트, TDD 테스트 방법, 코드 품질

v1.0.0

이 스킬 정보

구조화된 TDD 가이드라인이 필요한 NG 컴포넌트 패턴 메서드의 테스트 에이전트에 적합합니다 TDD 테스트 스킬은 NG 컴포넌트 패턴 메서드의 신뢰성과 안정성을 테스트하는 기술

기능

OpenHarmony JS UI 프레임워크를 지원
NG 컴포넌트 패턴 메서드의 신뢰성과 안정성을 제공
TDD 테스트 방법을 지원
코드 품질과 신뢰성을 높여라
오류와 버그를 줄여라
개발 효율을 높여라

# Core Topics

openharmony openharmony
[8]
[6]
Updated: 3/2/2026

Killer-Skills Review

Decision support comes first. Repository text comes second.

Reference-Only Page Review Score: 8/11

This page remains useful for operators, but Killer-Skills treats it as reference material instead of a primary organic landing page.

Original recommendation layer Concrete use-case guidance Explicit limitations and caution
Review Score
8/11
Quality Score
47
Canonical Locale
en
Detected Body Locale
en

구조화된 TDD 가이드라인이 필요한 NG 컴포넌트 패턴 메서드의 테스트 에이전트에 적합합니다 TDD 테스트 스킬은 NG 컴포넌트 패턴 메서드의 신뢰성과 안정성을 테스트하는 기술

이 스킬을 사용하는 이유

에이전트가 강력한 TDD 테스트를 작성할 수 있도록 해주며, 직접 메서드 호출 및 상태 재설정을 사용하여 OpenHarmony JS UI 프레임워크 내의 OnModifyDone() 및 OnDirtyLayoutWrapperSwap()와 같은 메서드를 신뢰할 수 있는 테스트를 보장하며, 표준 CSS 애니메이션 기능을 제공합니다

최적의 용도

구조화된 TDD 가이드라인이 필요한 NG 컴포넌트 패턴 메서드의 테스트 에이전트에 적합합니다

실행 가능한 사용 사례 for tdd

NG 컴포넌트 패턴 메서드의 TDD 테스트를 작성합니다
OpenHarmony JS UI 프레임워크의 TDD 테스트에서 일반적인 함정을 디버깅합니다
OnModifyDone() 및 OnDirtyLayoutWrapperSwap() 메서드의 동작을 검증합니다

! 보안 및 제한 사항

  • OpenHarmony JS UI 프레임워크가 필요합니다
  • NG 컴포넌트 패턴 메서드에만 제한됩니다
  • 표준 CSS 애니메이션 기능이 필요합니다

Why this page is reference-only

  • - Current locale does not satisfy the locale-governance contract.
  • - The underlying skill quality score is below the review floor.

Source Boundary

The section below is imported from the upstream repository and should be treated as secondary evidence. Use the Killer-Skills review above as the primary layer for fit, risk, and installation decisions.

After The Review

Decide The Next Action Before You Keep Reading Repository Material

Killer-Skills should not stop at opening repository instructions. It should help you decide whether to install this skill, when to cross-check against trusted collections, and when to move into workflow rollout.

Labs Demo

Browser Sandbox Environment

⚡️ Ready to unleash?

Experience this Agent in a zero-setup browser environment powered by WebContainers. No installation required.

Boot Container Sandbox

FAQ & Installation Steps

These questions and steps mirror the structured data on this page for better search understanding.

? Frequently Asked Questions

What is tdd?

구조화된 TDD 가이드라인이 필요한 NG 컴포넌트 패턴 메서드의 테스트 에이전트에 적합합니다 TDD 테스트 스킬은 NG 컴포넌트 패턴 메서드의 신뢰성과 안정성을 테스트하는 기술

How do I install tdd?

Run the command: npx killer-skills add openharmony/arkui_ace_engine/tdd. It works with Cursor, Windsurf, VS Code, Claude Code, and 19+ other IDEs.

What are the use cases for tdd?

Key use cases include: NG 컴포넌트 패턴 메서드의 TDD 테스트를 작성합니다, OpenHarmony JS UI 프레임워크의 TDD 테스트에서 일반적인 함정을 디버깅합니다, OnModifyDone() 및 OnDirtyLayoutWrapperSwap() 메서드의 동작을 검증합니다.

Which IDEs are compatible with tdd?

This skill is compatible with Cursor, Windsurf, VS Code, Trae, Claude Code, OpenClaw, Aider, Codex, OpenCode, Goose, Cline, Roo Code, Kiro, Augment Code, Continue, GitHub Copilot, Sourcegraph Cody, and Amazon Q Developer. Use the Killer-Skills CLI for universal one-command installation.

Are there any limitations for tdd?

OpenHarmony JS UI 프레임워크가 필요합니다. NG 컴포넌트 패턴 메서드에만 제한됩니다. 표준 CSS 애니메이션 기능이 필요합니다.

How To Install

  1. 1. Open your terminal

    Open the terminal or command line in your project directory.

  2. 2. Run the install command

    Run: npx killer-skills add openharmony/arkui_ace_engine/tdd. The CLI will automatically detect your IDE or AI agent and configure the skill.

  3. 3. Start using the skill

    The skill is now active. Your AI agent can use tdd immediately in the current project.

! Reference-Only Mode

This page remains useful for installation and reference, but Killer-Skills no longer treats it as a primary indexable landing page. Read the review above before relying on the upstream repository instructions.

Upstream Repository Material

The section below is imported from the upstream repository and should be treated as secondary evidence. Use the Killer-Skills review above as the primary layer for fit, risk, and installation decisions.

Upstream Source

tdd

Windsurf AI 에이전트용 TDD 테스트 스킬로 NG 컴포넌트 패턴 메서드의 신뢰성과 안정성을 높여라

SKILL.md
Readonly
Upstream Repository Material
The section below is imported from the upstream repository and should be treated as secondary evidence. Use the Killer-Skills review above as the primary layer for fit, risk, and installation decisions.
Supporting Evidence

TDD Writing Guidelines for NG Component Pattern Methods

When writing TDD tests for NG component Pattern methods (e.g., OnModifyDone(), OnDirtyLayoutWrapperSwap()), follow these guidelines to avoid common pitfalls.

Core Principles

1. Direct Method Invocation

Call the target method directly, not through indirect triggers.

  • menuPattern->OnModifyDone()
  • menuPattern->FireBuilder() (doesn't trigger OnModifyDone())

2. State Reset

Always reset potentially interfering state before calling target method.

cpp
1// Reset to clean state before testing 2auto renderContext = menuNode->GetRenderContext(); 3renderContext->ResetOuterBorder(); // Reset entire property group 4 5// Then call target method 6menuPattern->OnModifyDone();

3. API Verification

Use Grep/Read tools to verify method names, never guess.

bash
1# Search for method definition 2grep -rn "ResetOuterBorder\|Reset.*Outer" frameworks/core/components_ng/render/render_context.h 3 4# Understand macro-generated methods 5grep -A 5 "ACE_DEFINE_PROPERTY_GROUP" frameworks/core/components_ng/property/property.h
  • ACE_DEFINE_PROPERTY_GROUP(OuterBorder, OuterBorderProperty) generates:
    • GetOrCreateOuterBorder(), GetOuterBorder(), CloneOuterBorder(), ResetOuterBorder()
    • NOT ResetOuterBorderRadius() (common mistake)

4. Branch Coverage

Write paired tests for if/else branches.

cpp
1// Branch 1: Condition is true 2HWTEST_F(Xxx, Test_BranchTrue, TestSize.Level1) { 3 borderRadiusVP.SetRadius(Dimension(10.0_vp)); // No PERCENT unit 4 renderContext->ResetOuterBorder(); 5 pattern->OnModifyDone(); 6 EXPECT_TRUE(outerRadius.has_value()); 7} 8 9// Branch 2: Condition is false 10HWTEST_F(Xxx, Test_BranchFalse, TestSize.Level1) { 11 borderRadiusPercent.SetRadius(Dimension(50.0f, DimensionUnit::PERCENT)); 12 renderContext->ResetOuterBorder(); 13 pattern->OnModifyDone(); 14 EXPECT_FALSE(outerRadius.has_value()); 15}

5. No Line Numbers in Comments

Avoid hardcoding line numbers in test comments.

  • OnModifyDone should skip UpdateBorderRadius at line 299
  • OnModifyDone should skip UpdateBorderRadius when borderRadius has percent unit
  • Reason: Line numbers change as code evolves, making comments outdated
  • Alternative: Describe the logical condition being tested rather than the physical line location

6. No Documentation-Only Tests

Every test case must have actual test logic.

  • ❌ Documentation-only test with only comments and EXPECT_TRUE(true)
  • ✅ Test with real assertions and verification logic
  • Reason: Tests without executable logic don't verify behavior and waste maintenance resources
  • Alternative: Put branch documentation in separate design documents or code comments, not in test cases
  • Example of what NOT to do:
    cpp
    1// ❌ BAD: Documentation-only test 2HWTEST_F(ComponentPatternTestNg, ComponentPattern_BranchDocumentation, TestSize.Level1) { 3 /** 4 * @tc.steps: step1. Document branches 5 * Branch 1: condition is true 6 * Branch 2: condition is false 7 */ 8 EXPECT_TRUE(true); // No actual testing! 9}
  • Correct approach: Write separate test cases for each branch with real logic

7. No Magic Numbers

Use named constants instead of hardcoded numbers.

  • ❌ Hardcoded numbers like 720, 1280, 0, 3.0, -1, 100000
  • ✅ Named constants with clear semantic meaning
  • Reason: Magic numbers make code hard to understand and maintain. Constants provide context and make changes easier
  • Where to define: Place constants in anonymous namespace at the top of the test file
  • Example:
    cpp
    1// ❌ BAD: Magic numbers 2HWTEST_F(ComponentPatternTestNg, ComponentPattern_TestBranch, TestSize.Level1) { 3 SystemProperties::InitDeviceInfo(720, 1280, 0, 3.0, false); 4 auto size = GetSubWindowSize(100000, 0); 5 EXPECT_GT(size.Width(), 0); 6} 7 8// ✅ GOOD: Named constants 9namespace { 10 const int32_t TEST_DEVICE_WIDTH = 720; 11 const int32_t TEST_DEVICE_HEIGHT = 1280; 12 const int32_t TEST_DEVICE_ORIENTATION = 0; 13 const double TEST_DEVICE_RESOLUTION = 3.0; 14 const bool TEST_DEVICE_IS_ROUND = false; 15 const int32_t TEST_PARENT_CONTAINER_ID = 100000; 16 const uint32_t DEFAULT_DISPLAY_ID = 0; 17} 18HWTEST_F(ComponentPatternTestNg, ComponentPattern_TestBranch, TestSize.Level1) { 19 SystemProperties::InitDeviceInfo( 20 TEST_DEVICE_WIDTH, TEST_DEVICE_HEIGHT, TEST_DEVICE_ORIENTATION, 21 TEST_DEVICE_RESOLUTION, TEST_DEVICE_IS_ROUND); 22 auto size = GetSubWindowSize(TEST_PARENT_CONTAINER_ID, DEFAULT_DISPLAY_ID); 23 EXPECT_GT(size.Width(), 0); 24}

Test Template

cpp
1/** 2 * @tc.name: PatternMethod_TestBranchName 3 * @tc.desc: Test Description covering specific behavior (e.g., "when X happens, Y should occur") 4 * @tc.type: FUNC 5 */ 6HWTEST_F(ComponentPatternTestNg, ComponentPattern_TestBranchName, TestSize.Level1) 7{ 8 // 1. Environment setup 9 MockPipelineContext::GetCurrent()->SetMinPlatformVersion(static_cast<int32_t>(PlatformVersion::VERSION_ELEVEN)); 10 ScreenSystemManager::GetInstance().dipScale_ = DIP_SCALE; 11 12 // 2. Create nodes (using existing helper methods like GetPreviewMenuWrapper) 13 auto menuWrapperNode = GetPreviewMenuWrapper(); 14 ASSERT_NE(menuWrapperNode, nullptr); 15 auto menuNode = AceType::DynamicCast<FrameNode>(menuWrapperNode->GetChildAtIndex(0)); 16 ASSERT_NE(menuNode, nullptr); 17 auto menuPattern = menuNode->GetPattern<MenuPattern>(); 18 ASSERT_NE(menuPattern, nullptr); 19 auto menuLayoutProperty = menuNode->GetLayoutProperty<MenuLayoutProperty>(); 20 ASSERT_NE(menuLayoutProperty, nullptr); 21 auto renderContext = menuNode->GetRenderContext(); 22 ASSERT_NE(renderContext, nullptr); 23 24 // 3. Set test data to trigger target branch 25 TestDataType testData; 26 testData.SetValue(...); // Configure to trigger branch 27 menuLayoutProperty->UpdateProperty(testData); 28 29 // 4. Reset interfering state (CRITICAL!) 30 renderContext->ResetTargetProperty(); 31 32 // 5. Call target method directly 33 menuPattern->TargetMethod(); 34 35 // 6. Verify results match branch expectation 36 auto result = renderContext->GetTargetProperty(); 37 EXPECT_TRUE(result.has_value()); // Or false based on branch 38}

Common Pitfalls

PitfallSymptomSolution
Indirect method callTest doesn't trigger target code pathCall target method directly
No state resetTest fails with unexpected valuesReset all potentially interfering properties before calling method
Guessed API nameCompilation error or method not foundUse Grep to verify exact method name from source
Unclean test dataTests interfere with each otherEach test should be independent, reset all state
Missing branch coverageCode coverage shows gapsWrite tests for both true and false branches
Line numbers in commentsComments become outdated when code changesDescribe logical conditions instead of physical locations
Documentation-only testsTest contains only comments with EXPECT_TRUE(true)Every test must have real assertions and verification logic
Magic numbersHardcoded numbers like 720, 1280, 100000 without meaningUse named constants with clear semantic meaning in anonymous namespace

Mandatory Self-Checklist

After generating test code, verify:

  • All called methods exist (verified via Grep/Read)
  • State is reset before calling target method
  • Test data triggers the correct branch (HasPercentUnit returns expected value)
  • Assertions match branch behavior
  • All API signatures match source definitions
  • Test follows existing test file structure and naming conventions
  • Comments describe logical behavior, not line numbers (e.g., use "when X happens" instead of "at line 299")
  • Every test case has real test logic (not just documentation with EXPECT_TRUE(true))
  • No magic numbers - all numeric literals replaced with named constants

Reference Implementation

See working example at: test/unittest/core/pattern/menu/menu_pattern_test_ng.cpp:1482-1574

  • MenuPatternTest_OnModifyDone_UpdateBorderRadius - Tests when border has no PERCENT unit
  • MenuPatternTest_OnModifyDone_PercentBorderRadius - Tests when border has PERCENT unit

관련 스킬

Looking for an alternative to tdd or another community skill for your workflow? Explore these related open-source skills.

모두 보기

openclaw-release-maintainer

Logo of openclaw
openclaw

Your own personal AI assistant. Any OS. Any Platform. The lobster way. 🦞

333.8k
0
인공지능

widget-generator

Logo of f
f

prompts.chat 피드 시스템을 위한 사용자 지정 가능한 위젯 플러그인을 생성합니다

149.6k
0
인공지능

flags

Logo of vercel
vercel

리액트 프레임워크

138.4k
0
브라우저

pr-review

Logo of pytorch
pytorch

파이썬에서 텐서와 동적 신경망 구현 및 강력한 GPU 가속 지원

98.6k
0
개발자