backend-test-coverage

Analyze Django backend coverage gaps and implement targeted pytest tests.

1|Updated Sep 6, 2024
One-click install
npx skills add https://github.com/carlos18bp/gym_project --skill backend-test-coverage-carlos18bp
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: backend-test-coverage
Source: https://github.com/carlos18bp/gym_project/tree/main/.agents/skills/backend-test-coverage
Command: npx skills add https://github.com/carlos18bp/gym_project --skill backend-test-coverage-carlos18bp

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It helps you systematically identify low-coverage backend areas and write targeted pytest tests that improve coverage fastest without sacrificing test quality.

Core Features & Use Cases

  • Coverage-driven prioritization: Focuses on Models, Serializers, Views, Utils, and Tasks starting from the lowest coverage and highest miss counts.
  • Quality-standard compliant tests: Enforces deterministic, isolated tests with clear naming and consistent AAA assertions plus controlled mocks.
  • Batch execution workflow: Limits work per run (20 tests per batch, 3 commands per cycle) and produces a structured coverage improvement report.

Quick Start

Run the backend coverage workflow by reading your coverage report, selecting the lowest-coverage highest-impact files, following docs/TESTING_QUALITY_STANDARDS.md, then adding and running only the modified pytest test files to move coverage toward 100%.

Frequently Asked Questions about backend-test-coverage

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I increase pytest coverage for a Django backend?

Increase pytest coverage by analyzing reports to prioritize the lowest-coverage Django models, serializers, views, utils, and tasks, then writing targeted unit, integration, and contract tests to close measurable gaps.

What is the best way to prioritize backend test coverage gaps?

Prioritize backend test coverage gaps by ranking files by lowest coverage percentage and highest miss counts, targeting areas where adding tests yields the fastest measurable coverage improvements.

How do I write pytest tests that meet backend quality standards?

Write pytest tests meeting backend quality standards by ensuring deterministic, isolated execution, clear naming, AAA-structured assertions, and controlled mocks to validate Django models, serializers, views, utils, and tasks.

Does this test strategy support contract testing for Django views and serializers?

Yes, this test strategy supports contract testing for Django views and serializers alongside unit and integration testing, systematically validating backend components to push overall pytest coverage toward 100%.

Can I run only modified pytest test files to check coverage deltas?

Yes, you can run only modified pytest test files to check coverage deltas using a batch workflow that limits execution to 20 tests per batch and 3 commands per cycle, producing a structured coverage improvement report.