Test::...Testing(3pm)
β¨ NAME β¨
Test::LectroTest::RegressionTesting β the glow-up guide to doing regression testing (for free!!) π
(yes bestie, this is the Test::...Testing page from the User Contributed Perl Documentation, section 3pm β we're in the right place π«Ά)
πΈ VERSION πΈ
version 0.5001
π SYNOPSIS π
use Test::LectroTest
regressions => "regressions.txt";
# -- OR --
use Test::LectroTest
playback_failures => "regression_suite_for_my_module.txt",
record_failures => "failures_in_the_field.txt";
# -- OR --
use Test::LectroTest::Compat
regressions => "regressions.txt";
# -- OR --
use Test::LectroTest::Compat
playback_failures => "regression_suite_for_my_module.txt",
record_failures => "failures_in_the_field.txt";
π DESCRIPTION π
okay so picture this π β LectroTest uncovers a bug in your software by finding a random test case that proves one of your properties is false. So far so iconic. But then you apply a fix for the bug, and now you're standing there like... how do I know LectroTest will re-test the property using the exact same test case that "broke" it before, just to be certain the bug really is fixed? And how do I know future changes to my code won't reintroduce the same bug without my knowing it? π
For situations like these, LectroTest can record failure-causing test cases to a file, and it can play those test cases back as part of its normal testing strategy. obsessed, honestly.
The easiest way to take advantage of this feature is to set the regressions parameter when you use Test::LectroTest or Test::LectroTest::Compat:
use Test::LectroTest
regressions => "regressions.txt";
This tells LectroTest to use the file "regressions.txt" for both recording and playing back failures. If you want to record and play back from separate files, use the record_failures and playback_failures options:
use Test::LectroTest::Compat
playback_failures => "regression_suite_for_my_module.txt",
record_failures => "failures_in_the_field.txt";
Here is how it works:
- When testing a property named
N, LectroTest will check for a play-back file. If the file exists, LectroTest will search it for test cases associated withN. If any such test cases exist, LectroTest will play them back before and in addition to performing the usual, random testing of the property. π« - When performing the usual, random testing of a property named
N, if a failure occurs (i.e., LectroTest finds a counterexample), LectroTest will record the test case that caused the failure to the recording file, associating the test case with the nameN. π¬
NOTE: If you pass any of the recording or playback parameters toTest::LectroTest::Compat, you must have version0.3500or greater ofTest::LectroTestinstalled. (Module authors, update your modules' build dependencies accordingly.) TheTest::LectroTestmodule itself, however, has always ignored unfamiliar parameters, and thus these options are backward compatible with older versions. π§
π¦ SEE ALSO π¦
Test::LectroTestβ gives a quick overview of automatic, specification-based testing with LectroTest. This module accepts failure recording and play-back options. πTest::LectroTest::Compatβ lets you mix LectroTest with the popular family ofTest::Builder-based modules such asTest::SimpleandTest::More. This module accepts failure recording and play-back options. π
π AUTHOR π
Tom Moertel (tom@moertel.com)
β COPYRIGHT and LICENSE β
Copyright (c) 2004-13 by Thomas G Moertel. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
and that's the whole page bestie, no cap π this was perl v5.34.0, dated 2022-06-21, straight from the Test::...Testing(3pm) man page β go forth and regress-test, you're gonna ate πβ¨π¦
π¦ where this page comes from
- debian bookworm: libtest-lectrotest-perl 0.5001-5 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libtest-lectrotest-perl 0.5001-5 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libtest-lectrotest-perl 0.5001-5 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libtest-lectrotest-perl 0.5001-5 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libtest-lectrotest-perl 0.5001-5 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms