Skip to content

Philosophy of unit test for F# conversion

EricGT edited this page Dec 19, 2012 · 1 revision
  1. Evidence of correct conversion to F# and F# optimized.
  2. Standardized for easier reading to see patterns for learning.
    a. Use of arrays to hold input for multiple test in an easy to read format as opposed to teasing out meaning from attribute values.
    b. Use of tuples to hold parameters for functions.
    c. Order of parameters matches tuple order.
    d. Traceability comments with each test to identify same test in fsx files, and OCaml source.
    e. Allows for faster creation of new test cases since only data needs to be created, except for exceptions which require additional use of attribute property.
    f. Test data is type checked on entry as opposed to run time. Note: On rare occasion have to create multiple tests because of value restriction.
  3. To show different formulations of same concept. i.e. fpf, List.foldback,
  4. To test against AST which removes possible errors from print routines.
  5. To show AST and human readable output next to each other.
  6. To test basic functionality not tested in OCaml version to show same results or differences. i.e. % operator, minBy/maxBy, replicate
  7. To show progression of advancement in solving problems by reusing Pelletier and other related examples for many different methods.
  8. Not created in typical fashion used for debugging. Test are not designed to jump into IDE with debugger when failure occurs, they are to be easily read by a non-programmer so that a person can learn from the test cases associated with a test.
  9. Identification of examples across many modules by searching for example name. i.e. Pelletier #1
  10. As a way to run examples from a GUI and get visual feedback as opposed to reading each result to confirm correct result.
  11. To provide a convenient means to exclude long running examples.
  12. Testing of most functions.
  13. As a simple means to confirm changes did not break existing code.
Something went wrong with that request. Please try again.