Logo di Test Writing

Test Writing

Community
andreaswasita
test-writing

Scrive test significativi che individuano davvero i bug.

Panoramica

Pubblicato daandreaswasita
Repositorycopilot-agents-dojo
Nome della skilltest-writing
Stelle
54
Fork
15
File inclusi
Solo istruzioni
LicenzaMIT
Link
  • Istruzioni in Markdown

    Un file SKILL.md che il modello carica quando serve, consumando token solo quando una richiesta è effettivamente pertinente.

  • Funziona con qualsiasi LLM

    Le skill IA sono in semplice Markdown, non in codice specifico di un fornitore, quindi funzionano con GPT, Claude, Gemini, Grok o un modello locale.

  • Tutto nelle istruzioni

    Tutto ciò che serve al modello è nelle istruzioni: nessun file aggiuntivo da sincronizzare.

  • Open source

    Pubblicata da andreaswasita su GitHub. Leggi i sorgenti prima di installarla.

Installazione

Installa la skill IA Test Writing in TypingMind per usarla con qualsiasi LLM, oppure copiala in un altro agente in grado di leggere SKILL.md.

1

Installa in TypingMind

TypingMind installa una skill direttamente dalla sua cartella GitHub: legge SKILL.md, raccoglie i file delle risorse e salva il risultato in locale.

  1. Apri l'app e vai su Plugin → Skill.
  2. Scegli "Installa da GitHub".
  3. Incolla l'URL della cartella della skill riportato qui sotto e conferma.
    https://github.com/andreaswasita/copilot-agents-dojo/tree/main/skills/test-writing
  4. Attiva la skill in ogni chat in cui vuoi averla a disposizione.
Plugin → Skill → Aggiungi skill → Da URL GitHub, poi incolla l'URL della cartella e premi Continua.
2

Installa in un altro agente

Qualsiasi agente che legge il formato Agent Skills può usare questa skill: copia la cartella della skill nella directory delle skill di quell'agente.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/andreaswasita/copilot-agents-dojo.git /tmp/copilot-agents-dojo
mkdir -p .claude/skills
cp -r /tmp/copilot-agents-dojo/skills/test-writing .claude/skills/test-writing
Dopo la copia, riavvia Claude Code per caricare la nuova skill.

Usala in TypingMind

Attiva Test Writing in qualsiasi chat di TypingMind e al resto pensa il modello. Il nome e la descrizione della skill sono nel prompt di sistema e, non appena arriva una richiesta pertinente, il modello carica da solo le istruzioni complete: non devi mai richiamarla manualmente e non consuma token finché non viene effettivamente usata.

Il modello carica automaticamente Test Writing non appena riceve una richiesta pertinente.

Funziona con qualsiasi modello IA

Le skill IA sono semplici istruzioni in Markdown, non codice specifico di un fornitore, quindi Test Writing non è vincolata al modello per cui è stata scritta. Installala una sola volta in TypingMind e usala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modello locale che esegui tu, sempre con le tue chiavi API.

  • Caricata solo quando serve

    Il prompt di sistema contiene solo il nome e la descrizione. Le istruzioni vengono recuperate alla prima richiesta pertinente, quindi una skill inutilizzata non costa nulla.

  • Cambia modello durante la chat

    Poiché la skill è composta da istruzioni e non da codice, continua a funzionare anche se cambi modello: il nuovo modello legge lo stesso file SKILL.md.

Istruzioni della skill

Questo è il contenuto di SKILL.md che il modello carica. Leggilo prima dell'installazione: una skill è un insieme di istruzioni che il tuo modello seguirà.

Test Writing Skill

Produces tests that fail when the code is wrong — not tests that exist for coverage theatre. Covers happy path, edge cases, error paths, and state transitions. Does NOT chase 100% coverage as a goal; chases meaningful coverage that catches real regressions.

When to Use

  • Writing tests for new code or features.
  • Adding coverage to an untested area before changing it.
  • A bug slipped through that tests should have caught.
  • Practicing test-driven development.
  • The verify-before-done skill flagged missing coverage.
  • NOT when the user explicitly asked for a spike or throwaway script.

Prerequisites

  • A test framework installed for the stack (pytest, vitest, jest, go test, xUnit, JUnit).
  • Ability to run the test suite via the powershell tool.
  • The view, edit, and grep tools to read existing patterns.
  • A baseline run of the existing suite passing.

How to Run

text
1. Read existing tests with `view`/`grep` to copy the project's pattern.
2. List scenarios: happy path, edges, errors, state transitions.
3. Write one test per scenario using Arrange-Act-Assert.
4. Run the suite — confirm new tests pass and nothing else broke.
5. If TDD: write the test first, watch it fail for the right reason, then implement.

Quick Reference

StackFrameworkRun command
TypeScriptVitest / Jestnpm test or npx vitest
Pythonpytestpytest or python -m pytest
JavaJUnit 5mvn test or gradle test
Gotestinggo test ./...
.NETxUnitdotnet test
Scenario typeMust cover
Happy pathValid input → expected output
Edge caseEmpty, null, boundary, maximum size
Error caseInvalid input, dependency failure, timeout
State transitionStateful object moves between valid states

Procedure

Step 1: Read the Existing Pattern

Use grep for test_* or *.spec.* files and view one of them. Match the project's naming, location, fixtures, and assertion style. Do not introduce a second testing dialect.

Step 2: Enumerate Scenarios

For the code under test, list:

  1. Happy path inputs.
  2. Edge cases (empty, null, boundary, max).
  3. Error cases (invalid input, dependency failure).
  4. State transitions, if stateful.

Step 3: Write Arrange-Act-Assert

python
def test_calculate_discount_for_premium_user():
    # Arrange
    user = create_user(tier="premium")
    order = create_order(total=100.00)

    # Act
    discount = calculate_discount(user, order)

    # Assert
    assert discount == 20.00

Name tests as documentation: test_login_with_expired_token_returns_401, not test_login.

Step 4: For Bug Fixes — Test First

  1. Write a test that reproduces the bug.
  2. Run it. Confirm it fails for the right reason.
  3. Implement the fix.
  4. Run it. Confirm it passes.
  5. Run the full suite — no regressions.

Step 5: Run and Record

Run the suite via the powershell tool. Capture pass/fail counts and paste them into the tasks/todo.md Verification Results block (per verify-before-done).

Pitfalls

  • DO NOT write tests that cannot fail (assert user is not None on a freshly constructed object).
  • DO NOT test implementation details (e.g. mocking that quicksort was called). Test the behavior.
  • DO NOT mock the world. Prefer real collaborators where the cost is acceptable.
  • DO NOT ignore a flaky test — fix it or delete it. A flaky test erodes trust in the whole suite.
  • DO NOT chase 100% coverage as a target. Coverage is a metric, not a mission.

Verification

  • Every new test was observed to fail before it passed (TDD) OR a deliberate mutation was introduced to confirm it fails.
  • The full suite is green after the change.
  • Test names describe scenario + expected behavior.
  • Each bug fix has a regression test that would have caught the original bug.

Domande frequenti

Cosa fa la skill IA Test Writing?

Scrive test significativi che individuano davvero i bug.

Perché usare Test Writing su TypingMind?

Perché la installi una volta e la usi con qualsiasi modello. Test Writing è scritta in semplice Markdown anziché in codice specifico di un fornitore, quindi la stessa skill funziona con GPT-5, Claude, Gemini, Grok o un modello locale, e puoi cambiare modello durante la chat senza che la skill smetta di funzionare. TypingMind usa le tue chiavi API, quindi paghi direttamente i fornitori anziché un abbonamento per posto utente, e le tue skill e chat restano nel tuo spazio di archiviazione.

Come installo Test Writing in TypingMind?

Apri Plugin → Skill → Installa da GitHub in TypingMind e incolla https://github.com/andreaswasita/copilot-agents-dojo/tree/main/skills/test-writing. TypingMind legge il file SKILL.md e installa la skill, che puoi abilitare per ogni singola chat.

Quali modelli IA possono usare Test Writing?

Qualsiasi modello che colleghi a TypingMind. Le skill IA sono semplici istruzioni in Markdown anziché codice specifico di un fornitore, quindi GPT, Claude, Gemini, Grok e i modelli locali possono tutti caricare questa skill quando una richiesta corrisponde al suo scopo.

Quanti modelli IA posso usare con Test Writing?

Quanti ne vuoi. Se un modello supporta le skill, puoi usarlo con Test Writing: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e molti altri, tutti su TypingMind con le tue chiavi API.

La skill IA Test Writing è gratuita?

Sì. È pubblicata su GitHub da andreaswasita con licenza MIT. Paghi solo il tuo fornitore IA per i token che usi.

Cosa sono le skill IA?

Una skill IA è un pacchetto di istruzioni riutilizzabili che insegna a un modello IA come svolgere un'attività specifica. Segue il formato aperto Agent Skills: un file SKILL.md con un nome e una descrizione, più eventuali script, template o file di riferimento di cui il modello potrebbe aver bisogno. Il modello legge le istruzioni solo quando la tua richiesta corrisponde alla skill, quindi una skill installata non comporta costi finché non viene usata.

In cosa si differenziano le skill IA dai plugin o dai server MCP?

Un plugin o un server MCP fornisce a un modello nuovi strumenti da richiamare: codice che viene eseguito da qualche parte e restituisce un risultato. Una skill IA, invece, fornisce al modello conoscenze e procedure: come affrontare un'attività, quali passaggi seguire e quali caratteristiche deve avere un buon output. Le skill sono semplici istruzioni in Markdown, quindi non richiedono server, chiavi API né ambienti di esecuzione e funzionano con qualsiasi modello.

Elenco completo

Crea subito il tuo spazio di lavoro AI

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇