Langsung ke konten
Skillpedia
Testing81k · #1701

tdd-workflow

Fungsinya

Skill ini memandu siklus pengembangan berbasis tes dengan gaya sekolah London, di mana dependensi di-mock terlebih dahulu. Skill ini cocok untuk developer yang ingin membangun fitur langkah demi langkah dengan tes sebagai penuntun.

Kapan dipakai

  • ✓Saat Anda ingin membangun fitur dengan tes-dulu, dari luar ke dalam.
  • ✓Saat Anda menginginkan rutinitas merah, hijau, refaktor yang jelas untuk perilaku baru.
  • ✓Saat Anda ingin hasil tes akhir diperiksa sebelum sebuah tugas dinyatakan selesai.

Link skill

https://github.com/ruvnet/ruflo/blob/main/plugins/ruflo-testgen/skills/tdd-workflow/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/ruvnet/ruflo/blob/main/plugins/ruflo-testgen/skills/tdd-workflow/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

“Bangun perhitungan diskon dengan pendekatan tes-dulu, mulai dengan tes yang gagal untuk layanan harga yang di-mock.”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Skill menulis tes yang gagal dengan dependensi yang di-mock, menjalankannya untuk memastikan gagal karena alasan yang benar, menulis kode paling sederhana agar lolos, lalu merefaktor. Sebelum melaporkan keberhasilan, skill menjalankan target dan tes regresi serta mencatat hasil yang sebenarnya.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.

Follow the TDD London School (mock-first) approach:

  1. Write the failing test first -- define expected behavior with mocked dependencies
  2. Run the test -- confirm it fails for the right reason
  3. Implement minimal code -- make the test pass with the simplest solution
  4. Refactor -- clean up while keeping tests green
  5. Repeat -- add the next behavior

Before starting: mcp__plugin_ruflo-core_ruflo__hooks_pre-task({ description: "TDD: FEATURE_NAME" }) Before reporting the outcome, run the final target tests and the regression suite after the last edit. Record the actual commands, exit codes, whether tests ran, and failing test names. The initial red test is expected during TDD; only the final validation determines success.

Call mcp__plugin_ruflo-core_ruflo__hooks_post-task with the observed result, including when the task is abandoned or validation is interrupted. Set completed, targetTestsRan, and regressionTestsRan to true only when observed; use null for missing exit codes. Skipped or unrun validation is not success. Never substitute an expected result for an observed one.

The following example maps those observations to the hook input (tool-call notation):

const success = completed && targetTestsRan && regressionTestsRan
  && targetExitCode === 0 && regressionExitCode === 0;
mcp__plugin_ruflo-core_ruflo__hooks_post-task({
  taskId: "tdd-FEATURE",
  success,
  storeResults: true,
  task: JSON.stringify({
    feature: "FEATURE",
    targetCommand, targetExitCode, targetTestsRan,
    regressionCommand, regressionExitCode, regressionTestsRan,
    failingTestNames,
    failureReason: success ? null : failureReason
  })
});

On failure, report success: false and the failing test names in task. If the runner failed before identifying tests, or the task was abandoned, state that reason instead of inventing test names.

Principles:

  • Mock external dependencies at boundaries
  • Test behavior, not implementation
  • One assertion per test when possible
  • Descriptive names: should [behavior] when [condition]
Pertanyaan umum

Apakah tes gagal di awal menjadi masalah?

Tidak. Sumber menyatakan tes merah pertama memang diharapkan dalam metode ini. Hanya validasi akhir yang menentukan keberhasilan.

Apa yang dianggap berhasil?

Tes target dan rangkaian regresi keduanya harus benar-benar berjalan dan lolos. Tes yang dilewati bukan keberhasilan.

Apakah hasilnya dicatat?

Bisa. Skill melaporkan hasil tugas ke hook memori beserta hasil yang diamati.

Detail

Deskripsi asli dari pembuat

TDD London School workflow -- mock-first, outside-in test development

repo: ruvnet/ruflo

Popularitas

Bintang GitHub
81k
Peringkat
#1701
Lisensi
MIT
Diperbarui
2/11/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa