Dynamic analysis: watching code while it runs
Name the goals of dynamic analysis, match a kind of tool to each goal, and read a short report from a running program.
L1–L4 are part of the Pro pass
L0 Explain simply
Analogy: a heart monitor on a treadmill. A doctor can ask how you feel after a walk. You may say fine. A monitor strapped on during the walk tells more. It shows your heart rate, your breathing and a skipped beat that you never felt.
Daily List is a to-do list app. Tom has run his tests. They all pass. Leo wants to know more. What does the code do while the tests run? Does it lose memory, touch memory it already gave back, or spend all its time in one place?
So Tom attaches a watcher to the . This is : watching code while it runs, to find faults that a pass or fail result does not show. The watcher works through instrumentation, which is extra watching code added to the program or around it. A profiler is one kind of watcher, and it records where time or memory goes.
The picture has limits. A heart monitor barely disturbs the walker. A code watcher can slow the program and change its timing.
(SYNTHETIC / TRAINING ONLY: Daily List and every person named in this lesson are invented.)
PICTURE IT
The picture is the one the lesson above opens with. The table below shows how each part of it matches the software.
THE REAL JOB Watching a with the right kind of tool for each goal, so faults that give no wrong answer still show up.
- Name the goal
- Pick the tool kind
- Run the tests under it
- Read the report
- Fix and run again
HOW THE PICTURE MAPS
| In the picture | In the software |
|---|---|
| Asking how you feel | A test result of pass or fail |
| The strapped-on monitor | A dynamic analysis tool |
| The wires on the chest | Instrumentation |
| The heart rate trace | A profiler report |
| A skipped beat you never felt | A fault that gives no wrong answer |
WHERE THIS PICTURE STOPS
- A monitor barely disturbs the walker. A code watcher slows the program and can change its timing.
- A monitor watches the whole body. A code watcher sees only the code that ran.
- A heart has one rhythm to read. A program has memory, time and threads to watch.
HOOK
Tests ask the answer. Analysis watches the engine.
REMEMBER IT THIS WAY
A contrast: two neighbours told apart by one test.
A test asks whether the answer was right. asks what happened inside while the program gave it.
| In the trick | What it stands for |
|---|---|
| A test | Was the answer right |
| Dynamic analysis | What happened inside while it ran |
TELL A FRIEND
watches a for faults that give no wrong answer. Pick the tool kind by the goal, and remember it sees only the code that ran.
OFTEN MIXED UP WITH Static analysis for testers: linters, scanners and quality gates. reads code without running it. runs the code and watches what happens inside.
PRACTISE AND KEEP
Sources for this topic — 9 sources
- Market practice
Certified Tester Advanced Level Technical Test Analyst (CTAL-TTA) Syllabus v4.0, member board copy ↗ — American Software Testing Qualifications Board (ASTQB), for the International Software Testing Qualifications Board · Mirror copy of the publisher PDF (ISTQB syllabus CTAL-TTA v4.0, 30 June 2021), version checked against the document's own front matter, read in full text: section 3.3 Dynamic Analysis: TTA-3.3.1 (K3) apply dynamic analysis to achieve a specified goal; 3.3.2 detecting memory leaks, 3.3.3 detecting wild pointers and 3.3.4 analysis of performance efficiency. Dynamic analysis finds failures whose symptoms show only when code runs, and it usually uses tools
Text read in full from a mirror copy of the publisher PDF (ISTQB syllabus CTAL-TTA v4.0, dated 2021-06-30 in its footer), version checked against the document's own front matter. The page at this URL was not opened. Licence terms were not read, so put it in your own words and do not quote it.
- Market practice
ISTQB Certified Tester Advanced Level Technical Test Analyst (CTAL-TTA) Syllabus v4.0 ↗ — International Software Testing Qualifications Board (ISTQB) · Mirror copy of the publisher PDF (ISTQB syllabus CTAL-TTA v4.0, 30 June 2021), version checked against the document's own front matter, read in full text: chapter 3: TTA-3.2.1 (K3) control flow analysis and cyclomatic complexity, TTA-3.2.2 (K3) data flow analysis, TTA-3.2.3 (K3) static analysis for maintainability and TTA-3.3.1 (K3) apply dynamic analysis to achieve a specified goal
Text read in full from a mirror copy of the publisher PDF (ISTQB syllabus CTAL-TTA v4.0, dated 2021-06-30 in its footer), version checked against the document's own front matter. The page at this URL was not opened. Licence terms were not read, so put it in your own words and do not quote it.
Specialist review 6 November 2026: Actual CTAL-TTA4.0 §3.3 dynamic-analysis body reviewed; no claim of a full-syllabus review. Professional certification guidance, not binding legislation or a formal ISO standard. Inherited full-text descriptions are not a claim that this audit read every PDF page.
- Market practice
Dynamic analysis tool (ISTQB glossary study page) ↗ — SoftwareTestPilot · A study-site copy of the glossary meaning: a tool that gives run-time information on the state of code, such as memory allocation, use and release and the use of pointers; Valgrind and AddressSanitizer are named as examples (search excerpt, page not opened)
Found through a web search; the page was not opened (search excerpt, page not opened). Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
Memcheck: a memory error detector (Valgrind manual) ↗ — Valgrind project · Memcheck flags memory errors such as reading memory after it was freed (reported as an invalid read), and leaks where no pointer to a block remains (reported as definitely lost); --leak-check=full shows where leaked blocks were made (search excerpt, page not opened)
Found through a web search; the page was not opened (search excerpt, page not opened). Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
AddressSanitizer (Clang documentation) ↗ — LLVM project · AddressSanitizer is switched on by compiling and linking with -fsanitize=address; it reports a heap-use-after-free with the access, the free and the allocation, and stops at the first error (search excerpt, page not opened)
Found through a web search; the page was not opened (search excerpt, page not opened). Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
The Python Profilers (Python documentation) ↗ — Python Software Foundation · cProfile is a deterministic profiler that records every function call and its timing; results are read with the pstats module; it is for finding where time goes and not for benchmarking (search excerpt, page not opened)
Found through a web search; the page was not opened (search excerpt, page not opened). Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
tracemalloc: Trace memory allocations (Python 3.12 documentation) ↗ — Python Software Foundation · Take two snapshots of memory use and compare them to see where memory grows (search excerpt, page not opened)
Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
Analysis tools lecture slides (Purify) ↗ — Harvey Mudd College CS121 · Accesses through a dangling pointer are reported as free memory reads or writes, and corrupted memory may be used much later so the symptom can be far from the cause (search excerpt, page not opened)
Found through a web search; the page was not opened (search excerpt, page not opened). Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Simplified educational illustration
Payments Signal editorial teaching models — Payments Signal
What this simplifies: Daily List, its code and the people are invented. The C and Python programs are toys with faults planted on purpose, and every number comes from one run. Real reports are longer and some findings are harmless.
Used wherever diagrams, scenarios, figures, or example values are didactic constructions rather than sourced facts; every such use carries a simplifications disclosure. All people, companies, banks, and list entries in examples are fictional.
Deepest material on this page: L4 — Standards & sources. Where a topic stops short of implementation depth, that is a deliberate coverage decision, not an oversight — see coverage.