Lesson 41 - Hammer Testing
LEARN
End of Course
- Final Exam
- In lieu of Final there will 3 more lectures
- Lectures will be posted by Tuesday, Dec 7, 1:30 pm
- Projects
- All work must be completed by Friday, Dec 3
- If you have not gotten credit for your projects email me with details
Office Hours
- If you need help please attend office hours
- MWF 1:30-2:30 by Zoom
- Zoom: https://unco.zoom.us/j/99180652183
- Email: mark.seaman@unco.edu
Hammer Scripts Tests
- All tests produce text output
- When each test is run the output is compared against the expected values
- Failing tests are fixed by
- Fixing the product code
- Fixing the test code
- Approve the current output
Tests Use the Entire System
- Tests can look at
- Database records
- Files
- Call up other computers
- Execute Scripts within Django context
- Consume web pages
- Use Git to do version control
Requirements for a Test
- Use normal operation of system
- Don't interfere with data state
- Produce test that shows proper operation
- 1 minute to write, 15 seconds to fix
- Runs in less than one second
Expected answer
- Every test produces output
- Run the test and approve the result
- If anything changes the test will fail
- Start with tests that are noisy and fragile
- Approve is the only action needed
Show the Diff
- Use Linux "diff" command to show unexpected results
- Shows lines removed and added
Build an App to Manage Tests
- Automatically scan "test" app and builds test objects
- Runs all tests
- Collects and displays test results
- Allow easy approval
BUILD
Practice
- Clone my repo and study the code in HammerTest Source Code
- Build the code and experiment with it
- Set up tests for your favorite web sites
- Do it simple; do it now!