Twenty-One Defects: A Failure Log from a Computational Qurʾānic Project

Draft for submission · target: Journal of Digital Islamicate Research (Brill) · approx. 5,200 words · 17 August 2026

Abstract. Methodological writing in humanities computing describes how verification ought to work. It rarely reports what actually went wrong. This paper takes the opposite approach: it is a complete register of the twenty-one defects found in a single computational Qurʾānic project, the mechanism that caught each one, and what the pattern of discovery implies about the defects still undetected.

Three findings emerge. First, a class of silent corruption specific to Arabic-language computing is documented: literal Arabic characters written into regular-expression character classes reorder on serialisation, widening the class until it deletes the alphabet, producing counts of zero with no error raised. This occurred four times, including once inside the audit script written to detect it. Second, the defects divide almost perfectly by detector: fifteen were found by automated checks and six by a human reading output, with no overlap whatsoever. Third, that absence of overlap is itself evidence. Applied to two detectors sharing no findings, a capture–recapture estimator does not converge, which is the formal statement of an uncomfortable conclusion: the search for defects in this project is not near completion.

The paper argues that publishing failure registers is a practical contribution rather than an admission, and that verification designs which remove the human reader are blind in the one direction they cannot anticipate.

Keywords: reproducibility; verification; Arabic computing; Qurʾānic studies; research software; error analysis

1. Introduction

The literature on reproducibility in the digital humanities is largely prescriptive. It recommends version control, open data, documented pipelines, and independent verification. These recommendations are sound and widely endorsed. They are also, as a body of evidence, curiously one-sided: they describe systems that worked, or systems that ought to work, and very seldom report the specific ways in which a real project failed.

The reason is not mysterious. There is a professional cost to publishing one's own errors and no obvious reward. The consequence, however, is that practitioners inherit a literature rich in advice and poor in data. We are told to verify; we are not told what verification actually catches, what it reliably misses, or how many defects a competent project should expect to contain at the point of publication.

This paper contributes data of that kind. It reports every defect found during the construction of a computational study of Qurʾānic vocabulary — a corpus of 6,236 āyāt with 130,030 morphologically annotated segments, from which root, lemma and sense-level counts were derived and published. Twenty-one defects were found. Each is described with its consequence had it gone undetected, and with the mechanism that in fact detected it.

The paper makes no claim that this project was unusually error-prone. It makes the opposite claim: that a project with six independent audit layers and 305 passing checks still accumulated twenty-one defects is the ordinary condition of computational scholarship, and that the useful question is not whether defects exist but which mechanisms find which kinds.

2. The project

The material under study was an annotated Qurʾānic corpus assembled from two public sources: the Uthmanī text (6,236 āyāt) and the morphological annotation of the Quranic Arabic Corpus, comprising 130,030 segments tagged for root, lemma and part of speech. From these, 1,651 roots and 4,776 lemmas were indexed, and counting was performed at three levels — root, lemma, and sense — with outputs published as two reference documents.

The technical apparatus grew over the project's life to six audit layers comprising 305 automated checks: corpus integrity, morphological integrity, document structure, cross-document consistency, project-wide compliance, and a clean-room recount that shares no code with the counting engine. Every build refuses to write output if any check fails.

Crucially, most of that apparatus did not exist at the start. It was written in response to defects as they were discovered. This is itself a finding, examined in section 5.

3. The register

Table 1 lists all twenty-one defects in order of discovery, with the consequence had each gone undetected and the detector that found it. Defects are classified as machine-detected (an automated check reported it) or human-detected (a person reading output noticed it).

Table 1. Complete defect register.
#Defect Consequence if undetectedDetector
1Under-count by surface form. Counting “woman” matched only imraʾa, missing nisāʾA published count wrong by a factor of twelvehuman
2Over- and under-count together. Counting ayyām missed four inflected forms and admitted two words from an unrelated rootA count contaminated in both directions human
3Arabic literals in a regex class. Characters reordered on serialisation, widening the class until it matched the entire alphabetAll counts silently zero, no error raised. Occurred four timesmachine
4Wrong level of aggregation. Root totals reported against lemma-level claimsInflated some results and destroyed two that were correctmachine
5Silent lemma merging. An unvocalised key matched three distinct wordsA total belonging to no word machine
6Unicode normalisation reordering. NFC reorders shadda and kasra by combining classIdentical strings compared unequalmachine
7Index misalignment. The stored text counts the basmala within the first āyah; the annotation does notWrong word highlighted in hundreds of verses machine
8Rights violation, new document. An in-copyright translation quoted 645 timesUndistributable outputmachine
9Rights violation, published site. Three in-copyright translations already publicThe most serious defect; already publishedmachine
10Threshold excluded a unit entirely. A three-verse sūrah produced an empty sectionVisible gap in a document claiming complete coveragemachine
11Length-dependent metric compared across unequal corpora. Type–token ratioA six-fold difference reported that was an artefact of text lengthmachine
12Statistical over-claim. A least-squares log-log slope presented as an estimated power-law exponent A claim a referee would rejectmachine
13Headline inflated by singletons. Half the “exclusive” items occurred once anywhere Overstated a real distinctionmachine
14Incomplete theme tokens. A colour defined in two of three theme statesUnreadable rendering for some readersmachine
15Stale published artifact. A corrected document not redeployedFix applied but not delivered machine
16Non-additive column read as additive. Per-phase counts summing to 3,804 against a stated total of 1,651 Reader concludes the arithmetic is broken; the figures were correcthuman
17Internal contradiction. One section declares a measure unusable; a later section headlines it Self-contradiction within a single documenthuman
18False benchmark. A single “scholarly count” asserted where published totals range 1,650–1,790An apparent discrepancy that did not exist human
19Novelty unchecked. A finding presented as new that prior literature had establishedRejection on sight human
20Audits raising false alarms. Four false misalignments; then 258 spurious warnings; then a corpus of 36,390 records misread as 7An audit that cries wolf is disregarded, and the next true failure passesmachine
21Superseded code left executable. Two retired builders still runnableWould have overwritten corrected outputmachine

4. A silent failure mode specific to Arabic computing

Defect 3 warrants separate treatment because it is not a slip but a property of the writing system interacting with source-code serialisation, and because it recurred four times despite being known.

Arabic diacritics are combining marks. A regular-expression character class written with literal Arabic combining characters — to strip vowel marks, for example — is vulnerable to those characters being reordered when the file is written, read, or transferred between systems that apply Unicode normalisation. Reordering does not produce a syntax error. It produces a different but still valid character class. In the observed case, two ranges intended to cover annotation marks and vowel signs became a single range spanning U+0621–U+064A: the entire Arabic alphabet.

The consequence is that every string passed through normalisation returned empty. Every subsequent count returned zero, or matched everything, depending on the direction of the comparison. No exception was raised at any point. The code continued to look correct on inspection, because the characters are visually near-identical and their order is not perceptible in a rendered editor.

The defect recurred in four separate files, including — on the fourth occasion — inside the audit script written specifically to detect it in the other three. The scanner searched all source files for literal Arabic in character classes, and correctly flagged itself.

The remedy adopted was structural rather than cautionary. All Arabic handling was consolidated into a single module containing no Arabic characters at all: code points are written as hexadecimal integers, words are written in Buckwalter transliteration and converted at runtime, and normalisation is performed with translation tables built from integers rather than regular expressions over character ranges. The module executes a self-test at import and raises if any check fails, so that a corrupted build cannot start.

The generalisable point is that for a defect whose cause is a property of the characters rather than of the author's attention, care is not a remedy. Only removing the vulnerable construction from the codebase eliminates it.

5. Who found what

Table 2 summarises the detection split.

Table 2. Defects by detector.
DetectorDefects Characteristic of what it caught
Automated checks15 Silent corruption, arithmetic that failed to reconcile, missing or stale outputs, rights violations — failures with a shape describable in advance
Human reading output6 A figure that looked wrong; a document disagreeing with itself; a claim that felt too strong; an unexamined assumption — failures with no shape until noticed
Both0 —

The zero is the substantive result. Two independent processes searched the same artefacts over the same period and their findings do not intersect at a single point.

The explanation is not that one detector is superior. It is that the two are sensitive to different classes of defect. An automated check can only test a condition someone thought to express. Every machine-detected defect in Table 1 corresponds to a check written because that kind of failure had been anticipated — usually because a similar one had already occurred. The human-detected defects share the opposite property: none could have been expressed as a check beforehand, because none had a definite shape until a reader encountered the output and found it unconvincing.

Defect 16 illustrates this precisely. A column of per-phase counts summed to 3,804 against a stated corpus total of 1,651. Every figure was correct: the column counted items present in each phase, and items recurring across phases are counted once per phase. No arithmetic check could fail, because no arithmetic was wrong. What was wrong was that the column was labelled in a way that invited addition. The defect existed only in the relationship between a correct table and a reader's reasonable expectation, and only a reader could locate it.

5.1 What the absence of overlap implies

In fields that must estimate an incompletely observed population, capture–recapture provides the standard approach: the overlap between two independent samples estimates the total. The Chapman estimator is

N̂ = ((n₁+1)(n₂+1) / (m+1)) − 1

where n₁ and n₂ are the two sample sizes and m the overlap. With n₁=15, n₂=6 and m=0 this returns 111.

That figure should not be reported as an estimate and is not offered as one. Capture–recapture assumes both samples draw from the same population with independent and comparable detection probabilities. Section 5 argues precisely that this assumption fails here: the two detectors are sensitive to disjoint classes.

But the failure of the assumption is not a reason to discard the observation. It is the observation. When two searchers cover identical ground and share no findings, the supportable inference is not that the ground is now clear. It is that each is systematically blind to a class the other sees, with no information about how many classes are watched by neither. Nothing in the data supports a claim that the defect search in this project is near completion.

6. Discussion

6.1 Publishing in order of claim breadth

If undetected defects cannot be excluded, the practical response is to limit what any one of them can invalidate. A dataset description asserting that a particular annotation contains particular items survives a correction as a version increment. A paper asserting a substantive finding does not: an error in the measure removes the finding. This suggests sequencing publication by breadth of claim, with descriptive and methodological outputs preceding interpretive ones — not from timidity, but because it minimises the expected cost of the error one cannot rule out.

6.2 The cost of an audit that cries wolf

Defect 20 records three occasions on which an audit reported failures that did not exist — on one occasion 258 of them, caused by a check that stripped HTML tags but not character entities and therefore flagged every ellipsis as anomalous. On another, a corpus of 36,390 records stored as a nested structure was read as 7 unlabelled records.

False alarms are conventionally treated as a nuisance. They are better understood as defects in their own right, and among the more dangerous, because their effect is on the reader rather than the data: an audit that regularly reports non-existent failures trains its author to discount it, and the discounting is not selective. Every false alarm in this project was therefore logged, corrected, and given a regression test.

6.3 Against fully automated verification

Six of twenty-one defects were found by a person reading output, and no automated check in the six audit layers had any prospect of finding them, because none had been imagined when those layers were written. This is not an argument that automation is inadequate; fifteen defects say otherwise. It is an argument about complementarity. Automation is exhaustive within the space of anticipated failures and blind outside it. A reader is unreliable within that space and the only available instrument outside it.

A verification design that removes the human reader in the name of rigour therefore does not increase rigour. It eliminates the sole detector of the class of defect nobody predicted — which is, by construction, the class most likely to survive into publication.

7. Limitations

This is a single-project report, and its counts are not a sample from which rates can be generalised. The classification of defects as machine- or human-detected reflects which detector reported each first, and in a differently ordered project some might have been found by the other. The register was compiled by the author, who is also the source of every defect in it; a register kept by an independent party might differ in both content and emphasis. Finally, and consistently with the paper's own argument, the register is certainly incomplete.

8. Conclusion

Twenty-one defects were found in a project with six audit layers and 305 passing checks. Fifteen were found by machines and six by a person reading, with no overlap between them. One failure mode — the reordering of literal Arabic characters within regular-expression character classes — is specific to Arabic-language computing, fails silently, and recurred four times before a structural remedy removed it.

The absence of overlap between detectors is the paper's main quantitative result, and it does not support optimism. It indicates two processes each blind to what the other sees, and gives no basis for estimating what remains invisible to both.

The register is published open-ended. Its purpose is served if the twenty-second defect is reported by someone else.

References

  1. Dukes, K. The Quranic Arabic Corpus. University of Leeds. Morphological annotation, released under the GNU General Public License.
  2. Tanzil Project. Qurʾān text, Uthmanī orthography.
  3. Chapman, D. G. (1951). Some properties of the hypergeometric distribution with applications to zoological sample censuses. University of California Publications in Statistics 1, 131– 160.
  4. Clauset, A., Shalizi, C. R., & Newman, M. E. J. (2009). Power-law distributions in empirical data. SIAM Review 51(4), 661–703.
  5. Monroe, B. L., Colaresi, M. P., & Quinn, K. M. (2008). Fightin’ words: lexical feature selection and evaluation for identifying the content of political conflict. Political Analysis 16(4), 372–403.
  6. The Unicode Consortium. Unicode Standard Annex #15: Unicode Normalization Forms.

Appendix: what remains to be done before submission

Estimated at four to six working sessions.
TaskNote
Verify the target journal's scope and format JDIR publishes computational and quantitative analyses of Islamicate texts; confirm current author guidelines and word limit
Deposit the audit code and register A repository with a DOI. The paper's argument depends on the reader being able to inspect what is claimed
Re-run the literature search Immediately before submission. Defect 19 is in the register precisely because this step was skipped once
Have one person read it who was not involved Consistent with section 6.3; and they may supply defect twenty-two
Trim to the journal's limit Table 1 is the paper. If length must be cut, cut section 6 before the register
← AL-WAQF