Answer the question
In order to leave comments, you need to log in
Are self-modifying, recursively self-modifying their implementations automatic tests possible for recursively self-modifying metaprograms?
Tip:
1. Objectively, there are metaprograms, i.e. template code that generates some specific implementation of the algorithm with a specific set of internal parameters.
2. A person is a reasonable reality external to the software, which sets a starting set of initial tests, requirements, restrictions, etc. Such a subject that can produce goal-setting and compose algorithms and choose systems of axioms (a machine is automatically capable of proving theorems within the framework of the initial axiomatics, which is also an important fact).
3. Suppose we have an implementation of a recursive metaprogram that generates itself. Recursive calls are feasible; in a metaprogram, the program itself is the data. This means that a recursive metaprogram that transforms itself, it seems, theoretically, can also exist. Being implemented flexible, it probably not only includes or excludes some algorithms from its body according to a pre-provided base (do not invent starting algorithms for it), not only tweaks its internal parameters, but also adds new code by some miracle and enters it into this database of algorithms (see point 3). And on the next iteration, the code must correspond to something that checks the requirements in paragraph 2.
4. And now we want to test this recursive self-generating program (3). Of course, the test can be written by hand. The theory of TDD states that the test must precede the implementation, that the code should be covered with tests as much as possible, that tests are, in principle, automated.
Reflecting on points 1-3, I admit their feasibility, I know or assume that, in principle, all this already exists and is practically possible.
Meyers wrote about template metaprogramming, recursion is also a well-known thing.
But when I think about point 4, I can't understand, I don't know if logically/mathematical self-modifying tests are possible that test self-modifying programs?
Those. a person has set a starting implementation (for example, a slow bubble sort) and a starting test, some basic restrictions, and then everything somehow improves by itself adaptively, so it cooks recursively inside the meta-metacompiler until ready. And it unfolds into a quick-fast sort on the Nth iteration, plus the corresponding test rewrote itself from the initial one, tracking the code coverage.
"Toaster for a programmer" :)
How technically/theoretically described is possible? :)
Answer the question
In order to leave comments, you need to log in
What is a test?
This is a true statement regarding the fact that: f(a) = b.
where f is your program (such a black box, a function)
In this vein, self-modifying tests do not exist.
There is an initial state of the program, there is an algorithm of its work (in a black box), and there is a result of execution of this program. The result should be the same as the previous one. those. f(a) must be early b. If not, then the test failed.
How can the test be modified to get a different coverage of the initial and final conditions?
But no way. And you will be generally sure that this test covers exactly those conditions. Perhaps, in this case, the result of the program execution should be completely different?
those who read the question need to put up a monument,
and those who understand - also name the street in his honor!
You are answering your own question:
the corresponding test rewrote itself from the initial
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question