Skip to content

Thoughts on how to divvy-up validators #4

@michaelcueno

Description

@michaelcueno

Types of Validations (Let me know if I'm missing something)

  1. Trivial syntax ( We can handle these, if, else, then , unless .. )
  2. Non-trivial syntax
    -Contain a loop
    -Thoses using nil?
    -Anything else
    These will be broken into categories for sexp* keyword* or function*, each of which will have as many columns as new unknowns found and will be listed in order of frequency
    *A keyword being anything in the first argument of a :call
    *A function being anything in the second argument of a :call
    Example AST: s(call, s(Keyword, Keyword), function, arglist)
    *An sexp would be the :call in the above example
  3. call an external method (and fails)
  4. Interact with the database (still working on how to detect these)
  5. Use something we havent' seen yet (Unknown case, basically if the translator fails, but the log contains none of the above)

Order of Ops (Assuming we have all apps in a single directory) This will be automated in a script
o For each app

1. Install app  (I don't think this should be a problem as long as we are dealing with rails 3 apps.. Not too sure though)

2. run rake translate ( this will perform the tasks listed below *this is something I wrote just to be clear*)
  o For each model
    - Run get_validations
    - Divvy into Rails built-ins, Custom model defined validations, Custom Validators, Assiciations or something else
    o Run mimic_server_side_validations on model (This will only analyze Custom Validators and Custom model defined validations)

3. run divvy*

*divvy is what I'm calling the external program to parse the log files and create some human readable data (Piecharts!)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions