# Unit Testing Class Notes
## What is Unit Testing?
- Testing individual components or functions.
- Ensures code correctness and prevents regressions.
## Common Tools
- Python: unittest, pytest
- JavaScript: Jest, Mocha
## Principles
- Each test should be independent.
- Use setup and teardown methods if needed.
- Mock external dependencies.
## Example (Python)
import unittest
def add(a, b):
return a + b
class TestAdd([Link]):
def test_add(self):
[Link](add(2, 3), 5)
if __name__ == "__main__":
[Link]()