# Static Analysis for the Uninitialized

DevFeed: [Static Analysis for the Uninitialized](<https://devfeed.tech/articles/static-analysis-for-the-uninitialized-89926.md>)

Original publisher: [Read original article](<https://tenderlovemaking.com/2026/10/18/static-analysis-for-the-uninitialized/>)

Published: 2026-10-19T03:20:26Z

Content type: tutorial

Language: en

Sources: [Aaron Patterson](<https://devfeed.tech/sources/aaron-patterson.md>)

Topics: [Static code analysis](<https://devfeed.tech/topics/static-code-analysis.md>), [lint](<https://devfeed.tech/topics/lint.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [JavaScript](<https://devfeed.tech/topics/javascript.md>), [Snowflake streaming data architecture](<https://devfeed.tech/topics/snowflake-streaming-data-architecture.md>)

Tags: [algorithm](<https://devfeed.tech/tags/algorithm.md>), [graphs](<https://devfeed.tech/tags/graphs.md>), [if-statement](<https://devfeed.tech/tags/if-statement.md>), [javascript](<https://devfeed.tech/tags/javascript.md>), [program-analysis](<https://devfeed.tech/tags/program-analysis.md>), [programming](<https://devfeed.tech/tags/programming.md>), [ruby](<https://devfeed.tech/tags/ruby.md>), [static-analysis](<https://devfeed.tech/tags/static-analysis.md>)

## AI overview

The article walks through a static analysis for finding possibly uninitialized variables. It models data flow with bipartite graphs, implements the analysis in Ruby, and applies it to TIP and Ruby code, including a forward analysis over a control flow graph.

## Source excerpt

I really enjoy learning new things in my free time. Lately I've been studying this book on Static Program Analysis. The book is very good, but some of the formulas are quite dense so I like to try writing them out in code. The chapter I'm currently reading (chapter 9) has a section on finding possibly-uninitialized variables using bipartite graphs. I've found it to be quite enjoyable, so in this post I would like to describe, in my own words, how to do it. We'll start by analyzing some code from a toy programming language the book uses called "TIP", and then we'll use the techniques we developed to analyze some Ruby code. In other words, we're going to write a program to analyze programs. We're really going to be meta-programmers today! Uninitialized variables in TIP The TIP programming language is like a very very simplified version of JavaScript. Below is the code we'll be analyzing: var a, b, c; // a, b, c a = input; // b, c b = a + c; // b, c if (input) { // b, c c = 1; // b } // b, c This example is taken straight from the chapter. In TIP, you declare variables with the var keyword kind of like in JavaScript. In chapter 9 of the book, the TIP language only has integers; later chapters add pointers. In TIP, 0 is considered false, and there is a special function input that returns an integer input from the user. Each line in the above code has a comment indicating which variables are possibly uninitialized. I keep saying "possibly", and I'll explain why later. The first line declares the variables with var, and all variables start as "uninitialized" when they are declared. The second line gets input and assigns it to a, so now only b and c are uninitialized. The third line adds a and c and assigns it to b. On this line, b is still considered to be "uninitialized" because c is uninitialized, and the value of b depends on the values of a and c. The fourth line is an if statement, and whether we take the if statement depends on input from the user. In other words, w