About the course
It does not matter if you would like to employ TDD - Test Driven Development, or just would like to have some test in a 20-year old project in Perl you just inherited.
In both cases you need to know how to write tests in Perl. What are some of the best practices created by Perl developer on CPAN and in corporations.
How to Mock modules and whole subsystems that you'd like to exclude from your tests.
How to verify that your code can properly handle failures in 3rd party APIs.
How to check and increase code coverage.
Even how to run linter on your Perl code to enforce code conventions.
2020 January: The course is currently being recorded.
Content
Available in
days
days
after you enroll
- The source code
- Introduction (1:28)
- Simple Perl Module with sum function (1:44)
- Home made ok function (7:41)
- Test::Simple (5:56)
- Test::Simple too few or too many test cases (4:50)
- Exercise 1 (3:53)
- Solutions 1 (7:35)
- Refactoring many tests (4:53)
- Avoid updating the plan manually (4:48)
- Put test cases in external test file (7:08)
- Test Harness (5:49)
- prove (3:03)
- Directory layout of CPAN distributions (6:11)
- Simple Makefile.PL for ExtUtils::MakeMaker (5:59)
- LAyout of the t directory, prove flags (1:39)
- Packaging a CPAN-like distribution (14:27)
- Exercise 2 (1:56)
Available in
days
days
after you enroll
- Introduction to Test::More (2:36)
- ok, is, isnt in Test::More (5:30)
- diag, note, explain in Test::More (5:27)
- TODO tests when you can't fix a bug immediately (10:25)
- like - matching with regex (15:13)
- cmp_ok compare with less-than and greater-than (2:24)
- is_deeply comparing complex data structures (array and hash references) (6:02)
- skip tests that cannot be executed (6:12)
- locale (2:31)
- Early exit and bailut (BAIL_OUT) (5:28)
- Exercise 3 (4:03)
- Test Coverage - Devel::Cover - CPANcover (13:41)
- Test coverage: Add more tests to a module (20:35)
- Declare your plan at execution time (1:36)
- done_testing - no_plan in a better way (5:27)
- "plan test" or "no_plan" or "done_testing" ? (5:18)
- Compute test plan (2:53)
- subtests (8:55)
- skip all tests in a file (4:25)
- Exercise 4 (4:35)
- Test blocks (3:10)
Available in
days
days
after you enroll
- Test libraries (0:54)
- Multiple expected values and reporting with diag (11:03)
- Create my own test function and fix reporting with Test::Builder::Level (9:03)
- Create a test module to make the test function reusable (7:26)
- Test::Build is a singleton (2:17)
- Skipping tests on the fly. e.g. based on previous test results. (6:31)
- Verify expected warning (6:41)
- Make the code warning-free - Fail test if there is an unexpected warning (9:40)
- Combine testing for expected and for no unexpected warnings (6:19)
- Expected Exceptions (5:51)