Front / Back (click to flip)
Click card to view front/back
Raw Script
#!/usr/bin/env bash
bash -c $'set +e\ntt="/dev/tty";[[ -r "$tt" && -w "$tt" ]]||tt=""\np(){ [[ -n "$tt" ]]&&printf "%b" "$1" >"$tt"||printf "%b" "$1"; }\nr(){ local t=""; if [[ -n "$tt" ]]; then IFS= read -r t <"$tt" || t=""; else IFS= read -r t || t=""; fi; printf "%s" "$t"; }\nW=60\ndeck="EDU";subject="EDU";\ntopic="Software Testing Basics";\nsubtitle="Computer Science / Quality Assurance";\nnote="Testing is like checking your homework to catch mistakes before turning it in. Whether you are a kid or an adult, testing helps make sure software works well and is fun or useful to use.";\ncl(){ printf "\\033[2J\\033[H"; }\nbar(){ printf "%s\\n" "$(printf "%*s" "$W" "" | tr " " "=")"; }\nrow(){ printf "| %-*.*s |\\n" "$((W-4))" "$((W-4))" "$1"; }\nwrap(){\n local txt="$1" max=$((W-4)) chunk rest cut\n while [[ -n "$txt" ]]; do\n if [[ ${#txt} -le $max ]]; then row "$txt"; break; fi\n chunk=${txt:0:$max}\n rest=${txt:$max}\n if [[ "$chunk" =~ (.+)[[:space:]] ]]; then\n cut=${BASH_REMATCH[1]}\n row "$cut"\n txt="${txt:${#cut}}"; txt="${txt#" "}";\n else\n row "$chunk"\n txt="$rest"\n fi\n done\n}\npause(){ p "Press Enter to continue: "; r >/dev/null; }\nmenu(){\n cl\n bar; row "$deck • $subject"; bar\n wrap "$topic"\n wrap "$subtitle"\n if [[ -n "$note" ]]; then wrap "Tip: $note"; fi\n bar\n row "1) OVERVIEW"\n row "2) STEPS"\n row "3) TERMINOLOGY"\n row "q) EXIT"\n bar\n p "> "\n}\npage_OVERVIEW(){\n cl\n bar; row "OVERVIEW"; bar\n local s\n p=(\n"Testing ensures software works correctly before release."\n"It helps find and fix bugs early."\n"Testing improves software quality and user experience."\n"There are different types of tests for different needs."\n"Automated tests run code checks quickly and repeatedly."\n"Manual tests involve human checking for issues."\n)\n for s in "${p[@]}"; do wrap "$s"; done\n bar\n pause\n}\npage_STEPS(){\n cl\n bar; row "STEPS"; bar\n local s\n p=(\n"Understand the software requirements to know what to test."\n"Write test cases that describe inputs and expected results."\n"Run tests manually or with automated tools."\n"Record any bugs or unexpected behavior found."\n"Fix bugs and rerun tests to confirm the fix."\n"Repeat testing until the software meets quality standards."\n)\n for s in "${p[@]}"; do wrap "$s"; done\n bar\n pause\n}\npage_TERMINOLOGY(){\n cl\n bar; row "TERMINOLOGY"; bar\n local s\n p=(\n"Test Case — a set of conditions to check software behavior"\n"Bug — an error or flaw in software"\n"Automated Testing — using software tools to run tests"\n"Manual Testing — human-driven testing process"\n"Regression Testing — retesting after changes to ensure no new bugs"\n"Unit Testing — testing individual parts of code"\n"Integration Testing — testing combined parts of software"\n"Quality Assurance — process to ensure software quality"\n)\n for s in "${p[@]}"; do wrap "$s"; done\n bar\n pause\n}\nwhile true; do\n menu\n read -r choice < "${tt:-/dev/stdin}" || choice=""\n case "$choice" in\n 1) page_OVERVIEW ;;\n 2) page_STEPS ;;\n 3) page_TERMINOLOGY ;;\n q|Q) cl; bar; row "CARD CLOSED"; bar; p "\\n"; break ;;\n *) cl; bar; row "Select 1-3 or q"; bar; pause ;;\n esac\ndone\n'
QR Payload
#!/usr/bin/env bash
set -euo pipefail;bash -c $'bash -c $\'set +e\\ntt="/dev/tty";[[ -r "$tt" && -w "$tt" ]]||tt=""\\np(){ [[ -n "$tt" ]]&&printf "%b" "$1" >"$tt"||printf "%b" "$1"; }\\nr(){ local t=""; if [[ -n "$tt" ]]; then IFS= read -r t <"$tt" || t=""; else IFS= read -r t || t=""; fi; printf "%s" "$t"; }\\nW=60\\ndeck="EDU";subject="EDU";\\ntopic="Software Testing Basics";\\nsubtitle="Computer Science / Quality Assurance";\\nnote="Testing is like checking your homework to catch mistakes before turning it in. Whether you are a kid or an adult, testing helps make sure software works well and is fun or useful to use.";\\ncl(){ printf "\\\\033[2J\\\\033[H"; }\\nbar(){ printf "%s\\\\n" "$(printf "%*s" "$W" "" | tr " " "=")"; }\\nrow(){ printf "| %-*.*s |\\\\n" "$((W-4))" "$((W-4))" "$1"; }\\nwrap(){\\n local txt="$1" max=$((W-4)) chunk rest cut\\n while [[ -n "$txt" ]]; do\\n if [[ ${#txt} -le $max ]]; then row "$txt"; break; fi\\n chunk=${txt:0:$max}\\n rest=${txt:$max}\\n if [[ "$chunk" =~ (.+)[[:space:]] ]]; then\\n cut=${BASH_REMATCH[1]}\\n row "$cut"\\n txt="${txt:${#cut}}"; txt="${txt#" "}";\\n else\\n row "$chunk"\\n txt="$rest"\\n fi\\n done\\n}\\npause(){ p "Press Enter to continue: "; r >/dev/null; }\\nmenu(){\\n cl\\n bar; row "$deck • $subject"; bar\\n wrap "$topic"\\n wrap "$subtitle"\\n if [[ -n "$note" ]]; then wrap "Tip: $note"; fi\\n bar\\n row "1) OVERVIEW"\\n row "2) STEPS"\\n row "3) TERMINOLOGY"\\n row "q) EXIT"\\n bar\\n p "> "\\n}\\npage_OVERVIEW(){\\n cl\\n bar; row "OVERVIEW"; bar\\n local s\\n p=(\\n"Testing ensures software works correctly before release."\\n"It helps find and fix bugs early."\\n"Testing improves software quality and user experience."\\n"There are different types of tests for different needs."\\n"Automated tests run code checks quickly and repeatedly."\\n"Manual tests involve human checking for issues."\\n)\\n for s in "${p[@]}"; do wrap "$s"; done\\n bar\\n pause\\n}\\npage_STEPS(){\\n cl\\n bar; row "STEPS"; bar\\n local s\\n p=(\\n"Understand the software requirements to know what to test."\\n"Write test cases that describe inputs and expected results."\\n"Run tests manually or with automated tools."\\n"Record any bugs or unexpected behavior found."\\n"Fix bugs and rerun tests to confirm the fix."\\n"Repeat testing until the software meets quality standards."\\n)\\n for s in "${p[@]}"; do wrap "$s"; done\\n bar\\n pause\\n}\\npage_TERMINOLOGY(){\\n cl\\n bar; row "TERMINOLOGY"; bar\\n local s\\n p=(\\n"Test Case — a set of conditions to check software behavior"\\n"Bug — an error or flaw in software"\\n"Automated Testing — using software tools to run tests"\\n"Manual Testing — human-driven testing process"\\n"Regression Testing — retesting after changes to ensure no new bugs"\\n"Unit Testing — testing individual parts of code"\\n"Integration Testing — testing combined parts of software"\\n"Quality Assurance — process to ensure software quality"\\n)\\n for s in "${p[@]}"; do wrap "$s"; done\\n bar\\n pause\\n}\\nwhile true; do\\n menu\\n read -r choice < "${tt:-/dev/stdin}" || choice=""\\n case "$choice" in\\n 1) page_OVERVIEW ;;\\n 2) page_STEPS ;;\\n 3) page_TERMINOLOGY ;;\\n q|Q) cl; bar; row "CARD CLOSED"; bar; p "\\\\n"; break ;;\\n *) cl; bar; row "Select 1-3 or q"; bar; pause ;;\\n esac\\ndone\\n\'\n'