Chapter 07: Writing Test Code: Difference between revisions
Line 52: | Line 52: | ||
/ Unit Tests \ | / Unit Tests \ | ||
/______________________\</pre> | /______________________\</pre> | ||
'''Unit Tests (70%)''': | '''Unit Tests (70%)''': | ||
* Fast execution (< 1 second) | |||
* Test individual components in isolation | |||
* Use mocking for dependencies - Focus on business logic | |||
'''Integration Tests (20%)''': | '''Integration Tests (20%)''': | ||
* Test component interactions | |||
* Include database, web layer, or external services | |||
* Slower execution but higher confidence | |||
* Test real scenarios | |||
'''UI/End-to-End Tests (10%)''': | '''UI/End-to-End Tests (10%)''': | ||
* Test complete user journeys | |||
* Slowest but most comprehensive | |||
* Usually automated browser testing | |||
<span id="testing-philosophy"></span> | <span id="testing-philosophy"></span> |