1Test::LectroTest::RegreUssseironCToensttriinbgu(t3e)d PeTrelstD:o:cLuemcetnrtoaTteisotn::RegressionTesting(3)
2
3
4
6 Test::LectroTest::RegressionTesting - How to do regression testing (for
7 free!)
8
10 version 0.5001
11
13 use Test::LectroTest
14 regressions => "regressions.txt";
15
16 # -- OR --
17
18 use Test::LectroTest
19 playback_failures => "regression_suite_for_my_module.txt",
20 record_failures => "failures_in_the_field.txt";
21
22 # -- OR --
23
24 use Test::LectroTest::Compat
25 regressions => "regressions.txt";
26
27 # -- OR --
28
29 use Test::LectroTest::Compat
30 playback_failures => "regression_suite_for_my_module.txt",
31 record_failures => "failures_in_the_field.txt";
32
34 Say that LectroTest uncovers a bug in your software by finding a random
35 test case that proves one of your properties to be false. If you apply
36 a fix for the bug, how can you be sure that LectroTest will re-test the
37 property using the exact same test case that "broke" it before, just to
38 be certain the bug really is fixed? And how can you be sure that
39 future changes to your code will not reintroduce the same bug without
40 your knowing it?
41
42 For situations like these, LectroTest can record failure-causing test
43 cases to a file, and it can play those test cases back as part of its
44 normal testing strategy.
45
46 The easiest way to take advantage of this feature is to set the
47 regressions parameter when you "use" Test::LectroTest or
48 Test::LectroTest::Compat:
49
50 use Test::LectroTest
51 regressions => "regressions.txt";
52
53 This tells LectroTest to use the file "regressions.txt" for both
54 recording and playing back failures. If you want to record and play
55 back from separate files, use the record_failures and playback_failures
56 options:
57
58 use Test::LectroTest::Compat
59 playback_failures => "regression_suite_for_my_module.txt",
60 record_failures => "failures_in_the_field.txt";
61
62 Here is how it works:
63
64 1. When testing a property named N, LectroTest will check for a play-
65 back file. If the file exists, LectroTest will search it for test
66 cases associated with N. If any such test cases exist, LectroTest
67 will play them back before and in addition to performing the usual,
68 random testing of the property.
69
70 2. When performing the usual, random testing of a property named N, if
71 a failure occurs (i.e., LectroTest finds a counterexample),
72 LectroTest will record the test case that caused the failure to the
73 recording file, associating the test case with the name N.
74
75 NOTE: If you pass any of the recording or playback parameters to
76 Test::LectroTest::Compat, you must have version 0.3500 or greater of
77 Test::LectroTest installed. (Module authors, update your modules'
78 build dependencies accordingly.) The Test::LectroTest module itself,
79 however, has always ignored unfamiliar parameters, and thus these
80 options are backward compatible with older versions.
81
83 Test::LectroTest gives a quick overview of automatic, specification-
84 based testing with LectroTest. This module accepts failure recording
85 and play-back options.
86
87 Test::LectroTest::Compat lets you mix LectroTest with the popular
88 family of Test::Builder-based modules such as Test::Simple and
89 Test::More. This module accepts failure recording and play-back
90 options.
91
93 Tom Moertel (tom@moertel.com)
94
96 Copyright (c) 2004-13 by Thomas G Moertel. All rights reserved.
97
98 This program is free software; you can redistribute it and/or modify it
99 under the same terms as Perl itself.
100
101
102
103perl v5.30.1 2020-01T-e3s0t::LectroTest::RegressionTesting(3)