Do we know if spaced repetition can be used with randomized content?

Disclaimer: there may be major flaws in the way I use words. Corrections are welcome.


Suppose I want to memorize all the software design patterns.

I could use spaced repetition and create a new deck of flashcards. Each card would have the name of the pattern on one side and the definition on the other.

This would help me understand references to patterns without opening Wikipedia every time. This would probably help me recognize patterns by descriptions, as long as they’re close enough to the definitions.
But this wouldn’t help me recognize patterns just by looking at their implementations. I’d have to actively think about each pattern I remember and compare the definition and the code.

I could create a second deck, with names and examples. But then I’d just memorize those specific examples and maybe get better at recognizing similar ones.

This problem is similar to that of testing software. (There must be a more straightforward analogy, but I couldn’t find one.) Individual tests can only prevent individual errors. Formal verification is better, but not always possible. The next best thing is fuzzing: using random inputs and heuristics like “did it crash?”.

So I wonder if I could generate new examples on the fly. (More realistically, pull hand-labeled examples from a database.)

The idea is that a skill like recognizing a pattern in the code should also be a form of memory. Or at least the parts of it that do not change between the examples. So using spaced repetition with randomized examples would be like JIT-compilation in brains.

There was an LW post about genetic programming working better when the environment was modular. Maybe something similar would happen here.

But I couldn’t find anything on the internet. Has anybody seen any research on this?