Introduction
- Who should read this book
- What this book is about
- What this book is not about
The purpose of testing
Quick Start
- Minimum prerequisites
- Testing a logging module
The Testing Infrastructure
- What are tests anyway?
- Proving that we are wrong
- The “Test Anything” Protocol
- Testing a subroutine
- Arrange, Act and Assert
- Key Take Aways
CPAN Testers
- Reporting tests as a user
- Becoming a CPAN Tester
- Improving your tests as an author
Autotest
- Building the command line tool
- Running a test program
- Makefile
- Gregor’s story
- Coding for CPAN
- Checking for change
- Testing the application logic
- Black box and white box testing
- Key Take Aways
- Building the REST server
- A word about resources
- Testing a basic REST server
- Incorporating our working code
- Testing an API
- Key Take Aways
- Building the web application
- Testing outside-in
- Testing the client, not the server
- Testing the functionality, not the GUI
- Key Take Aways
Temporary data
- Temporary directories and files
- Temporary databases
- Temporary version control repositories
Fake Services
- Fake email server
Web Framework Testing
- Catalyst
Non-deterministic code and tests
- Side effects
- Dates
- Dependency injection
- Factory method mocking
- System call mocking
- Race conditions
- Unwanted randomness
- Wanted randomness
- Frequency test
- Serial test
- Poker test
- Runs test
- Autocorrelation test
Alternative test approaches and runners
- Specification tests
- Class-based testing
- Cucumber/BDD/Gherkin
- QuickCheck
Interactions with the outside world
- Test results formatters
- Continious integration services
- Results reporting
Advanced testing patterns
- Testing asynchronous code
Exotic testing patterns and methods
- Mutation Testing