Skip to content
affaan-m avatar

Perl Testing

Perl testing patterns with Test2::V0, Test::More, prove, mocking, and Devel::Cover coverage under TDD.

CCM score
73 of 100
skills.sh installs
11.4K
GitHub stars
312.6K
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers TDD red-green-refactor cycles, Test::More fundamentals, and Test2::V0 builders, subtests, and exception checks
  • Includes prove run modes, a recommended t/ directory layout, and a .proverc configuration example
  • Demonstrates Test::MockModule and Test::MockObject for controlled mocks that restore automatically after each subtest
  • Designed for Perl developers migrating from Test::More to Test2::V0 or measuring coverage with cover

Install

$ npx -y skills add affaan-m/ecc --skill perl-testing -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Perl Testing Patterns

Comprehensive testing strategies for Perl applications using Test2::V0, Test::More, prove, and TDD methodology.

When to Activate

  • Writing new Perl code (follow TDD: red, green, refactor)
  • Designing test suites for Perl modules or applications
  • Reviewing Perl test coverage
  • Setting up Perl testing infrastructure
  • Migrating tests from Test::More to Test2::V0
  • Debugging failing Perl tests

TDD Workflow

Always follow the RED-GREEN-REFACTOR cycle.

# Step 1: RED — Write a failing test
# t/unit/calculator.t
use v5.36;
use Test2::V0;

use lib 'lib';
use Calculator;

subtest 'addition' => sub {
    my $calc = Calculator->new;
    is($calc->add(2, 3), 5, 'adds two numbers');
    is($calc->add(-1, 1), 0, 'handles negatives');
};

done_testing;

# Step 2: GREEN — Write minimal implementation
# lib/Calculator.pm
package Calculator;
use v5.36;
use Moo;

sub add($self, $a, $b) {
    return $a + $b;
}

1;

# Step 3: REFACTOR — Improve while tests stay green
# Run: prove -lv t/unit/calculator.t

Test::More Fundamentals

The standard Perl testing module — widely used, ships with core.

Basic Assertions

use v5.36;
use Test::More;

Details

Repository
github.com/affaan-m/ecc
Categories
Testing & QA, Python
First seen
Jul 14, 2026

Questions

What does the perl-testing skill do?

The perl-testing skill gives the agent Perl testing patterns covering Test2::V0 and Test::More assertions, the prove runner, mocking, coverage with Devel::Cover, and TDD. It is meant for writing Perl tests with Test2::V0 or Test::More and for measuring coverage.

How do I install the perl-testing skill?

Run npx -y skills add affaan-m/ecc --skill perl-testing -y in your project. Once installed, the agent can write Perl tests with Test2::V0 or Test::More, run them with prove, and check coverage.

Where does perl-testing rank in its category?

It sits in the Testing & QA category and ranks in the top 100 there. Other skills in the category include tdd, test-driven-development, webapp-testing and break-ui.

Who should use the perl-testing skill?

It suits developers writing or migrating Perl tests from Test::More to Test2::V0, designing Perl test suites, or debugging failing Perl tests. It also covers the red-green-refactor TDD cycle for new Perl code.

More from affaan-m/ecc

All 257

Similar to Perl Testing

More Testing & QA