4

Suppose you are tasked with understanding some software which is very complex, has a web of dependencies, and a loaded namespace. Let's say it's a controller of a compiler which is more or less undocumented.

Is there any codified notion, or name for a technique whereby one 'logs' the values of variables throughout execution, in order to learn about how the software works? Or maybe for only the scope of a given function? I imagine this would exist primarily as a debugging tool.

In my particular case, I am working with F#, so it would also be helpful if you had a specific reference.

6
  • I usually try writing (or adding extra) unit tests, and then "scratch refactor". I would imagine a long list of variables and values will give you even more information overload. Commented Jul 12, 2017 at 11:04
  • My approach to this would vary greatly depending on how the code is structured. In well-factored F#, I probably would just read the code rather than what you're suggesting. Commented Jul 12, 2017 at 11:30
  • 2
    "printf debugging", "trace debugging", or "tracing" stackoverflow.com/questions/189562/… Commented Jul 12, 2017 at 11:32
  • 2
    You might also try loading the code into FSI and running pieces of it interactively. FsCheck can be useful here to generate arbitrary instances of complex values that you can pass to a function to get it to run. Commented Jul 12, 2017 at 11:39
  • 1
    I find that stepping through various test cases in the Visual Studio debugger can be very illuminating. Commented Jul 12, 2017 at 19:52

1 Answer 1

0

What you are looking for is tooling that supports inspectors, tracers, watches (globals and locals) and context aware evaluators. Some editors may have plugins to enable this. As of (2017) LightTable-FSharp for the Light Table editor is available which shows an inline evaluator. Thank you.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.