[S]cholarly identifications of real legislation in D [the Deuteronomist source of the Tanakh] entail the differentiation and reconstruction of individual laws as well as of larger legal collections...When such an analysis is performed along the lines proposed above, the following observations emerge: (1) the evidence for identifying an earlier, nonliterary legal corpus in D that once stood apart from its literary framework is quite tenuous, if not absent; and (2) the Deuteronomic laws are well-integrated in their literary framework and its plotline.
These observations together point to a conclusion: the Deuteronomic laws may be understood as an integral and original part of the fictive work of D. This is not to suggest that D’s author invented all of its legal ideas de novo; judging by the cuneiform evidence of legal practice, for example, it appears that D probably mimicked real legal content and reasoning in its composition. Yet in assessing the genre of D’s legislation, if it is to be understood as law, it can be so construed only within D’s story world. This is, of course, not what scholars usually mean when they claim that the rules in Deuteronomy are (or have been) legislation. Their claim is instead that these rules served—or were meant to serve—as law in the real world. What I have argued here is that D’s compositional history and its literariness rule out this option. In other words, D is not law and does not contain real law; it is instead a story about law.
Deuteronomy and the Pentateuch, Jeffrey Stackert