<p><pre><code>  &gt;  I can&#x27;t imagine visually inspecting and verifying anything if I didn&#x27;t write it to begin with.
</code></pre>
It&#x27;s a skill, you need to develop it. You develop it by doing it :)<p><pre><code>  &gt; I wouldn&#x27;t know where to begin thinking of possible ways to break it.
</code></pre>
For deadlocks, look at every single lock used. Show that one of the Coffman conditions doesn&#x27;t apply, and you&#x27;ve proven that there can never be a deadlock.<p>For race conditions, look at every piece of shared memory (or other shared resource). That is where race conditions always occur.<p>For understanding a program, the key is to understand the structure. That is why people put things in subdirectories, to help communicate the structure of the program, and show which things are closely related.