Test-Driven Development of a Static Code Analyzer in Python
summary
A Python static analyzer called lizard grows from weekend prototypes into a working cross‑language tool that measures cyclomatic complexity, finds code clones, and runs on huge repos (Ansible-sized) in under two minutes. Implementation follows strict TDD: tiny failing test, just‑enough code, refactor, repeat — hundreds of commits that reveal design. Clone detector skips header parsing (no headers), avoids hashing by matching token sequences directly, and proves fast and accurate enough for CI.
AI-written summary · about
chapters (16)
- 0:00Introduction and speaker
- 1:07Three steps to make software
- 3:40Introduction to Lizard tool
- 8:36Cyclomatic complexity explained
- 12:58Test-driven development basics
- 17:04TDD cycle and iteration time
- 18:32Duplicate code and defect correlation
- 19:55Implementing clone detector
- 22:50First failing test and refactoring
- 26:08Building test data and passing tests
- 29:16Refactoring and design emergence
- 33:40Code smells and anti-patterns
- 37:00Design from working software
- 40:40Performance considerations in TDD
- 42:28Duplicate rate analysis results
- 44:19Summary of three steps
related talks
27mStatic Code Analysis with Python
30mChasten Your Python Program: Configurable Program Analysis and Linting with XPath
27mAn Overview of the Python Code Tool Landscape 2023
28mPreventing headaches with linters and automated checks
30mAutomating Code Quality
58mSecurity Static Analysis - Avoiding an Angry Mob of Engineers
53mTestability Patterns For Web Apps - A New OWASP Project
01h 00mCode Quality in Practice
