Testing and Validation
Validation vs Unit Tests vs Pre-Deployment Checks
This is a Venn Diagram situation.
Validation
- Validation is focused on the
Current State(of the Workbook) and itsData - Validation error could typically be fixed by a business end user (which is not the case with
Unit Tests) - Addin-defined Validation runs by default on new host workbook (unit tests do not)*
- Validation should not risk corrupting existing workbook data (whereas
Unit Testscan) - Validation should not make
network connection(whereasTestscan) - Validation is far less useful with an
unloaded Host Workbook(eg no imported Data) - Validation - also meant to be like "Tuning & Alignment" ... We expect users to run validation
Unit Tests
- Tests are focused on checking the VBA project code.
- Test errors would be typically be fixed by a vba coder, not a business end user
- Tests lean more towards infrastructure (whereas
Validationleans towards business/data) - Tests can risk data, because end users do not run them
- Tests can run a little slower
Pre-Deployment Checks
- Deployment checks are the last thing you do before releasing a new version of your application.
- Deployment automatically runs all defined
Unit TestandValidationprocedures... - And then checks anything other special conditions you want to verify before releasing a version.
- Anytime you release a version and (later) notice you "forgot" to do something; that "something" is likely a good candidate to include in pre-deployment checks.
- Ideas for deployment checks:
- Are any inputs or data ranges that should be clear, not cleared?
- Are any DB Models populated with records, which should be zeroed out?
- Are there any "generated worksheets" (created by your code) that should be deleted?
Resets
- Reset scripts are designed to "zero out" a host workbook to it's "empty" or "initial" state
- If you were building an appraisal workbook, the reset script would clear out any imported rent comparables, sales comps, operating expense comps, etc.
- In practice, your end users do not often run Reset scripts (because the base template they grab off the T-Drive was already reset).
- Resets can also be used to normalize zoom, re-order worksheets, etc.