krzema12/vis-assert

Make writing tests more convenient

Opened this issue · 7 comments

For example, the Kotlin code can be generated that shows a strict testcase for given axes parameters.

Idea: if the assertion fails, display a strict visualization, but not as a Kotlin code, but a 2D grid with axis markers.

Take into account the following edge cases:

  • the function's value exceeds Y axis' range - mark it with some arrow, to point the user that the function goes beyond the visualization
  • for a probed X value, the function returns "not a number" (e. G. Division by 0) or +/- infinity - for now, let's treat it as an invalid function - for such value, there cannot be a valid constraint. At most, no constraint at all for this X value

Ideas on the message:

  • first graph: what the user gave. Use emojis ✔️ and ❌ above the columns to mark which columns contain fulfilled assertions, and for which the assertions fail
  • second graph, below: suggested minimal assertions

An alternative idea is to produce an image for each test, showing the visualization of both the actual function and the assertions.

For each failed test:

  • produce a SVG code
  • embed the code in a URL to a tool
  • the tool should take whatever is given as GET parameter, and convert it to website's content - see https://github.com/krzema12/html2url

During working on a proof of concept, I hit "Error: URI Too Long" issue.