.\" Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" ======================================================================== .\" .IX Title "Test::LectroTest::RegressionTesting 3pm" .TH Test::LectroTest::RegressionTesting 3pm "2018-01-14" "perl v5.26.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Test::LectroTest::RegressionTesting \- How to do regression testing (for free!) .SH "VERSION" .IX Header "VERSION" version 0.5001 .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 2 \& 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"; .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Say that LectroTest uncovers a bug in your software by finding a random test case that proves one of your properties to be false. If you apply a fix for the bug, how can you be sure that LectroTest will re-test the property using the exact same test case that \*(L"broke\*(R" it before, just to be certain the bug really is fixed? And how can you be sure that future changes to your code will not reintroduce the same bug without your knowing it? .PP 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. .PP The easiest way to take advantage of this feature is to set the \&\fIregressions\fR parameter when you \f(CW\*(C`use\*(C'\fR Test::LectroTest or Test::LectroTest::Compat: .PP .Vb 2 \& use Test::LectroTest \& regressions => "regressions.txt"; .Ve .PP This tells LectroTest to use the file \*(L"regressions.txt\*(R" for both recording and playing back failures. If you want to record and play back from separate files, use the \fIrecord_failures\fR and \&\fIplayback_failures\fR options: .PP .Vb 3 \& use Test::LectroTest::Compat \& playback_failures => "regression_suite_for_my_module.txt", \& record_failures => "failures_in_the_field.txt"; .Ve .PP Here is how it works: .IP "1." 4 When testing a property named \fIN\fR, LectroTest will check for a play-back file. If the file exists, LectroTest will search it for test cases associated with \fIN\fR. If any such test cases exist, LectroTest will play them back \fIbefore\fR and \fIin addition to\fR performing the usual, random testing of the property. .IP "2." 4 When performing the usual, random testing of a property named \fIN\fR, 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 name \fIN\fR. .PP \&\fB\s-1NOTE:\s0\fR If you pass any of the recording or playback parameters to Test::LectroTest::Compat, you must have version 0.3500 or greater of Test::LectroTest installed. (Module authors, update your modules' build dependencies accordingly.) The Test::LectroTest module itself, however, has always ignored unfamiliar parameters, and thus these options are backward compatible with older versions. .SH "SEE ALSO" .IX Header "SEE ALSO" Test::LectroTest gives a quick overview of automatic, specification-based testing with LectroTest. This module accepts failure recording and play-back options. .PP Test::LectroTest::Compat lets you mix LectroTest with the popular family of Test::Builder\-based modules such as Test::Simple and Test::More. This module accepts failure recording and play-back options. .SH "AUTHOR" .IX Header "AUTHOR" Tom Moertel (tom@moertel.com) .SH "COPYRIGHT and LICENSE" .IX Header "COPYRIGHT and LICENSE" Copyright (c) 2004\-13 by Thomas G Moertel. All rights reserved. .PP This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.