3 ms·
Slightly related are Go examples - they're tests, and documentation at the same time. It'd be nice if someone hooks in a listener to automatically collect examp
by chewxy 8y ago
Slightly related are Go examples - they're tests, and documentation at the same time. It'd be nice if someone hooks in a listener to automatically collect examples tho
- pmontra 8y agoAnd Elixir's doctests https://elixir-lang.org/getting-started/mix-otp/docs-tests-and-with.html https://elixir-lang.org/getting-started/mix-otp/docs-tests-a...
- merlincorey 8y agoAnd Python's Axe! I mean doctest: https://docs.python.org/3/library/doctest.html https://docs.python.org/3/library/doctest.html
- westurner 8y ago1. sys.settrace() for {call, return, exception, c_call, c_return, and c_exception} 2. Serialize as/to doctests. Is there a good way to serialize Python objects as Python code? 3. Add doctests to callables' docstrings with AST Mutation testing tools may have already implemented serialization to doctests but IDK about docstring modification. ... MOSES is an evolutionary algorithm that mutates and simplifies a combo tree until it has built a function with less error for the given input/output pairs.
- gklitt 8y agoYeah, I like doctests but also find it limiting to have everything in the source code text. Having a GUI for viewing examples is nice, although it does introduce other problems like how to store and version the examples.