- Ultimate Goal: Reduce costs and increase productivity.
- Definition 'Production Code': Code that provides functionality to meet project requirements.
- Definition 'Test Code': Often referred to as "tests", it is written to verify the correct functionality of the production code.
Benefits of Testing
- Quality Assurance
- Automated Testing: Minimizes the need for human source code checking or manual testing, providing a cost-effective way to ensure continuous quality assurance and the correct functioning of software at all times.
- Early Feedback: Tests provide immediate bug feedback. This is especially true for detecting accidentally introduced bugs caused by code changes. The earlier bugs are detected, the cheaper they are to fix.
- Bug Location Detection: Tests identify bug locations, saving debugging time.
- Testable Design
- Writing tests automatically enforces design best practices, resulting in a 'testable design' and higher quality code. Good code and architecture are testable, and vice versa.
- Documentation
Tests serve as the most current form of code documentation, capturing the expected behavior of the production code in its present state.