{
"cells": [
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"button": false,
"new_sheet": false,
"run_control": {
"read_only": false
},
"slideshow": {
"slide_type": "slide"
}
},
"source": [
"# Generalizing Failure Circumstances\n",
"\n",
"One central question in debugging is: _Does this bug occur in other situations, too?_ In this chapter, we present a technique that is set to _generalize_ the circumstances under which a failure occurs. The DDSET algorithm takes a failure-inducing input, breaks it into individual elements. For each element, it tries to find whether it can be replaced by others in the same category, and if so, it _generalizes_ the concrete element to the very category. The result is a _pattern_ that characterizes the failure condition: \"The failure occurs for all inputs of the form `( \n",
" \n",
" \n",
" \n",
" \n",
" \n",
" Quiz
\n",
" s = '<foo>\"bar</foo>'
(i.e., BAD_INPUT
), what is the value of out
such that the assertion fails?
`. For compatibility reasons, we also allow just opening tags without closing tags, as in ``."
]
},
{
"cell_type": "code",
"execution_count": 22,
"metadata": {
"button": false,
"execution": {
"iopub.execute_input": "2023-11-12T12:41:47.184379Z",
"iopub.status.busy": "2023-11-12T12:41:47.184271Z",
"iopub.status.idle": "2023-11-12T12:41:47.186021Z",
"shell.execute_reply": "2023-11-12T12:41:47.185765Z"
},
"new_sheet": false,
"run_control": {
"read_only": false
},
"slideshow": {
"slide_type": "subslide"
}
},
"outputs": [],
"source": [
"SIMPLE_HTML_GRAMMAR.update({\n",
" \"Quiz
\n",
" bad_input_tree
, what is the subtree at the path [0, 0, 2, 1]
as string?Quiz
\n",
" <opening-tag>
?\"bar