Last modified 10 years ago Last modified on 10/06/2009 09:42:16 AM

DC3b Task: Complete support for validated policy files

Project Plan Status


1. Finish support for policy validation


Here's what's already in place:

  • values can be loaded from Dictionary objects
  • Definition does validation of an individual parameter; need to confirm that it is complete
  • Whole policies are validated by a Dictionary instance
  • Policies do not yet hold onto dictionaries

To Do

  • enumerate in a text description (etc/validationTests.txt) each test that should be encoded in the validation code; this will allow subsequent developers or reviewers to verify a complete implementation.
    • confirm that the tests are all implemented
  • Have policy instances constructed from a Dictionary save it for later validation
  • Carry out automatic validation in Policy set/add methods when Dictionary available
  • add a mergeDefaults(const Dictionary& d, bool validate) to validate existing data while merging in default values
    • (See existing mergeDefaults + Policy constructor that takes a Dictionary)
  • need to determine to what extent non-deterministic names must be supported during validation
  • need tool for developers (i.e. a script in bin for validating dictionary files and policy files.
    • see etc/dictionary_dict.paf
    • requires dictionary file as input; dictionary is validated
    • can optionally take a policy file; if provided, validate policy file against dictionary

2. Document recommended pattern for loading and using policies


Here's what's already in place:

  • DefaultPolicyFile can be used to load dictionaries from a package directory.
  • Policy includes a mergeDefault(const Policy&) method for merging in default values from default policy file or Dictionary. (See todo item for sub-task 1 above regarding mergeDefaults(const Dictionary& d, bool validate).)


In a typical pipeline, the policy file for configuring a Stage is instantiated first and then passed to the constructor of the Stage. The stage implementation is responsible for loading defaults; thus, the need for mergeDefaults()

3. Update existing policy use (in application code) to use recommended pattern

4. Disallow a dictionary to override another dictionary.

Effort Estimate

Known (approx) effortremaining
Enumerate tests 2 hours complete
Interactive testing 2 hours complete
Review existing tests 4 hours complete
Unit tests for existing validation tests 8 hours complete
Fix & refactor existing, write missing validation tests 8 hours complete
Non-deterministic names (childDefinition) 4 hours complete
Automatic validation on set/add 12 hours complete
Write mergeDefaults(Dictionary) 2 hours complete
Disallow a Dictionary to override another Dictionary 4 hours will not implement
Validation script for policy authors 8 hours complete
Document recommended pattern for loading and using policies 4 hours 4
Update existing use in application code 12 hours 12
total 70 hours16 hours (4 days)