2. What I Mean by Testing?
•
Automatic and repeatable checking that code
written works as expected.
•
•
Correct side effects
•
•
Correct result
Speedy enough
Writing tests prior to writing code
3. Why Test?
•
Reduce regression bugs
•
Increase code quality
•
•
•
Better design
Find problems early
Helps you know when you are done coding
8. Integration Testing
•
Test interaction with dependencies / external
calls
•
Not as detailed as unit tests - no need to test
every scenario
•
Minimal mocking / patching
10. System / End-to-End Testing
•
Test public endpoints
•
Use full stack
•
No mocking / patching
•
Minimal to no inspecting of underlying side
effects - only results of calls
•
Run in a staging environment
13. Acceptance Testing
•
Fulfill user stories
•
Can be written and/or manual
•
Could be written by someone other than
developer - stakeholder
•
Full stack
•
Run against staging environment
Result – inputs -> outputs
Side Effects – Car model -> start engine -> update boolean engine running
Speedy – app needing 1000 calls per second
Tests prior – instead of throwing together tests at the end – plan ahead
Regression – knowing previous code won’t brake
Design – break up code into small pieces
Done coding – good design == confidence
Unit – small units – possibly mocking out external dependencies
Integration – testing units with their dependencies to make sure interactions work
System – Calling only public API endpoints/functions and using the full stack
Acceptance – automated based on user stories – could be written by someone other than developer - or just manual user testing
BaseTestCase - built on top of unittest
Generally would have API calls for a system running on a staging environment, but this I hope still shows the difference