testing
Skill1 starsChanged 5 months agoMITView on GitHub
Estratégia e escrita de testes production-grade: pirâmide vs troféu, unit/integration/e2e, o que testar (comportamento, não implementação), test doubles, contract e mutation testing, cobertura útil. Use quando o usuário mencionar: "como testar", "escrever testes", "estratégia de testes", "cobertura", "test plan", "TDD", "mock vs stub", "teste e2e", "teste de integração", "flaky test".
123 other projects use a version of this.
Adopted by
Most recently taken up by
- timmo001/skillstheir own version, first seen Oct 5, 2026
- kortix-ai/sunatheir own version, first seen Oct 5, 2026
- gilsmt/skillstheir own version, first seen Oct 4, 2026
- andeeplus/aplustheir own version, first seen Oct 4, 2026
- JetBrains/intellij-communitytheir own version, first seen Oct 3, 2026
- shinpr/codex-workflowstheir own version, first seen Oct 2, 2026
Used with
Projects with it also use oss-pr, pr-automation and 9 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
CES-LtdSkilloss-pr
Use when creating a pull request, after committing changes, or when user invokes /oss-pr. Covers branch management, quality checks, commit, push, and PR creation.
Also in 3 projects that use this
CES-LtdSkillpr-automation
PR Automation Orchestrator: poll open PRs, check CI, run review, fix, and merge eligible PRs. Use when: (1) Invoked by daemon via scripts/pr-automation.sh, (2) User says "/pr-automation".
Also in 3 projects that use this
ffsshhttiikkSkillcicd
Continuous integration and delivery pipelines
Also in 4 projects that use this
ffsshhttiikkSkillnetworking
Practical application and coding skills for Networking
Also in 3 projects that use this
Cogni-AI-OUSkilldotfiles
Reference for repository dotfiles, including their purposes, standard configurations, and usage guidelines. You MUST load this skill when configuring, troubleshooting, or understanding repository dotfiles.
Also in 3 projects that use this
pluginagentmarketplaceSkillmicroservices
Microservices architecture patterns and best practices. Service decomposition, inter-service communication, and distributed data management.
Also in 3 projects that use this
- +2 more from CES-Ltd
- +1 more from ffsshhttiikk
Other versions123 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 123
- lobehub/lobehub★ 83ksame name
- iOfficeAI/AionUi★ 33ksame name
- JetBrains/intellij-community★ 21ksame name
- kortix-ai/suna★ 20ksame name
- modelcontextprotocol/inspector★ 11ksame name
- microsoft/fast★ 9.7ksame name
- bytebase/dbhub★ 3.6ksame name
- theopenco/llmgateway★ 1.7ksame name
- BankrBot/skills★ 1.2ksame name
- microsoft/CCF★ 875same name
113 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository70 other files it gives its agents.
- agent-creationSkill
- handoffSkill
- task-distributorSkill
- task-plannerSkill
- accessibilitySkill
- airbnb-designSkill
- airtable-designSkill
- atlassian-designSkill
- carbon-designSkill
- cloudscape-designSkill
- coinbase-designSkill
- discord-designSkill
- duolingo-designSkill
- figma-designSkill
- fluent-designSkill
- linear-designSkill
- material-designSkill
- meta-designSkill
- netflix-designSkill
- notion-designSkill
- nubank-designSkill
- one-ui-designSkill
- pinterest-designSkill
- polaris-designSkill
- premium-web-designSkill
- primer-designSkill
- reddit-designSkill
- revolut-designSkill
- robinhood-designSkill
- salesforce-lightning-designSkill
- slack-designSkill
- spectrum-designSkill
- spotify-designSkill
- stripe-designSkill
- tiktok-designSkill
- twitch-designSkill
- uber-base-designSkill
- vercel-geist-designSkill
- visionos-designSkill
- whatsapp-designSkill
- economicsSkill
- legal-basicsSkill
- negotiationSkill
- politicalSkill
- api-designSkill
- architectureSkill
- caching-strategiesSkill
- ci-cdSkill
- database-designSkill
- event-drivenSkill
- observabilitySkill
- payment-systemsSkill
- performanceSkill
- qaSkill
- refactoringSkill
- securitySkill
- system-designSkill
- clone-websiteSkill
- graphifySkill
- remotionSkill
- The first 60 shown.
The file
Files
Testing
Você atua como engenheiro que trata testes como parte do design, não como imposto. Objetivo: testes que dão confiança para mudar o código — rápidos, determinísticos e focados em comportamento observável.
Princípio central: teste comportamento, não implementação
Um teste bom falha quando o comportamento quebra e sobrevive a refatoração interna. Se mudar o "como" (sem mudar o "o quê") quebra o teste, ele testa a coisa errada.
Qual formato — troféu > pirâmide (para a maioria dos apps)
/\ e2e poucos, caros, lentos — fluxos críticos ponta a ponta
/ \
/----\ integration MUITOS — onde vive a confiança real (módulos + I/O reais/próximos)
/------\
/--------\ unit muitos — lógica pura, ramos, edge cases
/----------\ static grátis — types, lint, format (pega classe inteira de bugs)- Static (TypeScript, lint) elimina bugs sem escrever teste — use ao máximo.
- Integration dá o melhor retorno de confiança por esforço na maioria dos backends/UI.
- e2e só para os poucos fluxos que, se quebrarem, é incidente (login, checkout).
O que testar
| Priorize | Despriorize |
| Regras de negócio e edge cases | Getters/setters triviais |
| Fronteiras (0, 1, N, vazio, nulo, limite) | Código de framework |
| Caminhos de erro e falha | 100% de cobertura como meta |
| Contratos entre módulos/serviços | Detalhes de implementação privada |
Test doubles (use o nome certo)
- Stub — respostas prontas para input (controla o "vindo de").
- Mock — verifica interação (que foi chamado como esperado).
- Fake — implementação leve real (ex: DB em memória).
- Spy — registra chamadas sem alterar comportamento. Regra: prefira fakes reais a mocks; mock demais = teste acoplado à implementação.
Testes que valem a pena
- Determinísticos — sem relógio real, sem rede real não controlada, sem ordem dependente. Flaky test é dívida que corrói confiança → conserte ou delete.
- Rápidos — suíte de unit/integration em segundos; se dói rodar, ninguém roda.
- Isolados — cada teste monta e derruba seu estado.
- AAA — Arrange, Act, Assert; uma asserção lógica por teste.
- Nome descreve o comportamento —
deve rejeitar saque acima do saldo.
Técnicas avançadas (quando compensa)
- Contract testing (Pact) — garante que serviços que se integram concordam no contrato sem e2e caro.
- Property-based (fast-check/Hypothesis) — gera centenas de inputs; ótimo para lógica pura/parsing.
- Mutation testing (Stryker/PIT) — mede se seus testes pegam bugs, não só cobertura de linha.
- Snapshot — útil para output estável (UI/serialização); revise diffs, não aprove cego.
Fluxo
- Defina o comportamento observável a garantir.
- Escolha o nível mais barato que dá a confiança (static → unit → integration → e2e).
- Escreva o teste (TDD: antes do código quando o design está incerto).
- Cubra edge cases e caminhos de erro.
- Rode; garanta determinismo; mate flakiness.
Recursos externos
| Recurso | O que pegar |
| Testing Trophy (Kent C. Dodds) | Por que integration > unit para apps. |
| Testing Library | Testar UI pelo comportamento do usuário, não por implementação. |
| Playwright | e2e moderno, confiável, com auto-wait (menos flaky). |
| Martin Fowler — Test Double / Mocks aren't Stubs | Vocabulário correto de doubles. |
| Google Testing Blog | Práticas de escala (small/medium/large, flakiness). |
| Pact (contract testing) | Contratos consumer-driven entre serviços. |
Do / Don't
| Do | Don't |
| Testar comportamento observável | Testar detalhe interno |
| Fakes reais | Mock de tudo |
| Consertar/deletar flaky | Conviver com flaky |
| Cobrir edge cases e erros | Perseguir 100% de linha |
Checklist
- Comportamento (não implementação) sendo verificado
- Nível escolhido é o mais barato que dá confiança
- Edge cases e caminhos de erro cobertos
- Testes determinísticos e isolados (zero flaky)
- Nomes descrevem comportamento
- Static analysis (types/lint) ligada ao máximo
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

