affaan-m/ECC

springboot-tdd

Test-driven development for Spring Boot using JUnit 5, Mockito, MockMvc, Testcontainers, and JaCoCo. Use when adding features, fixing bugs, or refactoring.

71Collecting
See how to use itView GitHub source
npx skills add https://github.com/affaan-m/ECC --skill "docs/ja-JP/skills/springboot-tdd"
Automated source guide

Source checked Jul 28, 2026·Refresh due Oct 26, 2026

Reorganized from the pinned upstream SKILL.md

Turn springboot-tdd's source instructions into a guide you can follow

According to the pinned SKILL.md from affaan-m/ECC: 80%以上のカバレッジ(ユニット+統合)を持つSpring Bootサービスのためのテスト駆動開発ガイダンス。

npx skills add https://github.com/affaan-m/ECC --skill "docs/ja-JP/skills/springboot-tdd"
Check the pinned source

Best fit

  • Use when adding features, fixing bugs, or refactoring.
  • Test-driven development for Spring Boot using JUnit 5, Mockito, MockMvc, Testcontainers, and JaCoCo. Use when adding features, fixing bugs, or refactoring.

Bring this context

  • A concrete task that matches the documented purpose of springboot-tdd.
  • The files, examples, or context the task depends on.
  • Your constraints, target environment, and definition of done.

Expected outputs

  • A result that follows the pinned springboot-tdd instructions.
  • A concise record of assumptions, inputs used, and unresolved questions.
  • A final check against the source workflow and relevant permission signals.

Key source sections

Read springboot-tdd through these 5 source sections

Sections are extracted automatically from the pinned SKILL.md and link back to the source.

01

いつ使用するか

新機能やエンドポイント

SKILL.md · いつ使用するか
新機能やエンドポイントバグ修正やリファクタリングデータアクセスロジックやセキュリティルールの追加
02

ワークフロー

1) テストを最初に書く(失敗すべき) 2) テストを通すための最小限のコードを実装 3) テストをグリーンに保ちながらリファクタリング 4) カバレッジを強制(JaCoCo)

SKILL.md · ワークフロー
テストを最初に書く(失敗すべき)テストを通すための最小限のコードを実装テストをグリーンに保ちながらリファクタリング
03

ユニットテスト(JUnit 5 + Mockito)

パターン: - Arrange-Act-Assert - 部分モックを避ける。明示的なスタビングを優先 - バリエーションに@ParameterizedTestを使用

SKILL.md · ユニットテスト(JUnit 5 + Mockito)
Arrange-Act-Assert部分モックを避ける。明示的なスタビングを優先バリエーションに@ParameterizedTestを使用
04

Webレイヤーテスト(MockMvc)

Review the “Webレイヤーテスト(MockMvc)” section in the pinned source before continuing.

SKILL.md · Webレイヤーテスト(MockMvc)
Review and apply the “Webレイヤーテスト(MockMvc)” source section.
05

統合テスト(SpringBootTest)

Review the “統合テスト(SpringBootTest)” section in the pinned source before continuing.

SKILL.md · 統合テスト(SpringBootTest)
Review and apply the “統合テスト(SpringBootTest)” source section.

SkillSignal prompt templates

Provide the task, context, and acceptance criteria

These prompts were written by SkillSignal from the source structure; they are not upstream text.

Task-start prompt

Confirm source fit, inputs, and outputs before acting.

Use springboot-tdd to help me with: [specific task]. Context: [files, data, or background]. Constraints: [environment, scope, and prohibited actions]. Before acting, check the pinned SKILL.md and explain which sections apply, what inputs are still missing, and what you will deliver.

Source-guided execution

Make the Agent explicitly follow the key extracted sections.

Apply the pinned springboot-tdd source to [task]. Pay particular attention to these source sections: “いつ使用するか”, “ワークフロー”, “ユニットテスト(JUnit 5 + Mockito)”, “Webレイヤーテスト(MockMvc)”, “統合テスト(SpringBootTest)”. Preserve the important decision at each step. Mark facts not covered by the source as “needs confirmation” instead of inventing them. Then verify the result against my acceptance criteria: [criteria].

Result-review prompt

Check omissions, permissions, and source drift before delivery.

Review the current springboot-tdd result: (1) does it satisfy the original task; (2) were any applicable steps or limits in the pinned SKILL.md missed; (3) did it perform any unauthorized file, command, network, or data action; and (4) which conclusions remain unverified? List issues first, then fix only what the source or user authorization supports.

Output checklist

Verify each item before delivery

The task matches the purpose documented in the SKILL.md.

The source section “いつ使用するか” has been checked.

The source section “ワークフロー” has been checked.

The source section “ユニットテスト(JUnit 5 + Mockito)” has been checked.

The source section “Webレイヤーテスト(MockMvc)” has been checked.

Inputs, constraints, and acceptance criteria are explicit.

Unverified facts, compatibility, and outcome claims are clearly marked.

Any file, command, network, or data action has been reviewed.

Choose a different workflow

When another Skill is the better fit

FAQ

What does springboot-tdd do?

80%以上のカバレッジ(ユニット+統合)を持つSpring Bootサービスのためのテスト駆動開発ガイダンス。

How do I start using springboot-tdd?

The catalog detected this source-specific install command: npx skills add https://github.com/affaan-m/ECC --skill "docs/ja-JP/skills/springboot-tdd". Inspect the command and pinned source before running it.

Which Agent platforms does it declare?

No dedicated Agent platform is declared in the pinned source record.

Repository stars
234,327
Repository forks
35,711
Quality
71/100
Source repository last pushed

Quality breakdown

Based on traceable docs and repository signals; stars are not treated as quality.

71/100
Documentation21/30
Specificity20/25
Maintenance18/20
Trust signals12/25

Compare before choosing

Related Agent Skills and source variants

These links are selected from shared tasks, functions, stacks, platforms, and same-name variants. Compare the source owner, documentation, permissions, and maintenance signals.

View original Skill.mdThis page is parsed directly from the repository SKILL.md without editorial rewriting. Collected: Jul 28, 2026 · about 1 min

Spring Boot TDD ワークフロー

80%以上のカバレッジ(ユニット+統合)を持つSpring Bootサービスのためのテスト駆動開発ガイダンス。

いつ使用するか

  • 新機能やエンドポイント
  • バグ修正やリファクタリング
  • データアクセスロジックやセキュリティルールの追加

ワークフロー

  1. テストを最初に書く(失敗すべき)
  2. テストを通すための最小限のコードを実装
  3. テストをグリーンに保ちながらリファクタリング
  4. カバレッジを強制(JaCoCo)

ユニットテスト(JUnit 5 + Mockito)

@ExtendWith(MockitoExtension.class)
class MarketServiceTest {
  @Mock MarketRepository repo;
  @InjectMocks MarketService service;

  @Test
  void createsMarket() {
    CreateMarketRequest req = new CreateMarketRequest("name", "desc", Instant.now(), List.of("cat"));
    when(repo.save(any())).thenAnswer(inv -> inv.getArgument(0));

    Market result = service.create(req);

    assertThat(result.name()).isEqualTo("name");
    verify(repo).save(any());
  }
}

パターン:

  • Arrange-Act-Assert
  • 部分モックを避ける。明示的なスタビングを優先
  • バリエーションに@ParameterizedTestを使用

Webレイヤーテスト(MockMvc)

@WebMvcTest(MarketController.class)
class MarketControllerTest {
  @Autowired MockMvc mockMvc;
  @MockBean MarketService marketService;

  @Test
  void returnsMarkets() throws Exception {
    when(marketService.list(any())).thenReturn(Page.empty());

    mockMvc.perform(get("/api/markets"))
        .andExpect(status().isOk())
        .andExpect(jsonPath("$.content").isArray());
  }
}

統合テスト(SpringBootTest)

@SpringBootTest
@AutoConfigureMockMvc
@ActiveProfiles("test")
class MarketIntegrationTest {
  @Autowired MockMvc mockMvc;

  @Test
  void createsMarket() throws Exception {
    mockMvc.perform(post("/api/markets")
        .contentType(MediaType.APPLICATION_JSON)
        .content("""
          {"name":"Test","description":"Desc","endDate":"2030-01-01T00:00:00Z","categories":["general"]}
        """))
      .andExpect(status().isCreated());
  }
}

永続化テスト(DataJpaTest)

@DataJpaTest
@AutoConfigureTestDatabase(replace = AutoConfigureTestDatabase.Replace.NONE)
@Import(TestContainersConfig.class)
class MarketRepositoryTest {
  @Autowired MarketRepository repo;

  @Test
  void savesAndFinds() {
    MarketEntity entity = new MarketEntity();
    entity.setName("Test");
    repo.save(entity);

    Optional<MarketEntity> found = repo.findByName("Test");
    assertThat(found).isPresent();
  }
}

Testcontainers

  • 本番環境を反映するためにPostgres/Redis用の再利用可能なコンテナを使用
  • @DynamicPropertySource経由でJDBC URLをSpringコンテキストに注入

カバレッジ(JaCoCo)

Mavenスニペット:

<plugin>
  <groupId>org.jacoco</groupId>
  <artifactId>jacoco-maven-plugin</artifactId>
  <version>0.8.14</version>
  <executions>
    <execution>
      <goals><goal>prepare-agent</goal></goals>
    </execution>
    <execution>
      <id>report</id>
      <phase>verify</phase>
      <goals><goal>report</goal></goals>
    </execution>
  </executions>
</plugin>

アサーション

  • 可読性のためにAssertJ(assertThat)を優先
  • JSONレスポンスにはjsonPathを使用
  • 例外には: assertThatThrownBy(...)

テストデータビルダー

class MarketBuilder {
  private String name = "Test";
  MarketBuilder withName(String name) { this.name = name; return this; }
  Market build() { return new Market(null, name, MarketStatus.ACTIVE); }
}

CIコマンド

  • Maven: mvn -T 4 test または mvn verify
  • Gradle: ./gradlew test jacocoTestReport

覚えておいてください: テストは高速で、分離され、決定論的に保ちます。実装の詳細ではなく、動作をテストします。

Source repo
affaan-m/ECC
Skill path
docs/ja-JP/skills/springboot-tdd/SKILL.md
Commit SHA
4e973d3eaf92
Repository license
MIT
Data collected