The Limits of Thinking
Published:
This essay discusses the mental concept of thinking in limits. Its utility is demonstrated in a situation where humans have poor intuition.
Cognition and reasoning in humans often emerges from a collection of such smaller patterns as well. Defining and testing for common patterns may alert us about flaws in the execution of our thoughts. I am not talking about the content of thoughts here, such as holding a wrong fact in memory. Rather, it is about the way in which we go about reaching the desired outcome and thus how confident we can be about such an outcome. Everyone knows that we shouldn’t believe everything we hear or read, but it is harder for many to realize we also shouldn’t believe everything we think.
Cognitive unit tests apply this software development principle to our own thinking processes. Just as unit tests verify that individual components of software function correctly, cognitive unit tests are small mental checks we can perform to ensure our thinking patterns remain effective and grounded in reality. They are structured questions or checks we apply to our thoughts to identify flawed reasoning patterns before they lead us astray. When we run these “tests” against our thoughts and beliefs (especially when we obtain new information), we can catch errors in our cognitive processing - catastrophizing, overgeneralizing, personalizing, and other thinking traps that our minds are prone to. Much like software developers who won’t push code to production until all tests pass, we can learn to pause before acting on our thoughts until they’ve been properly validated. This creates a kind of mental “continuous integration” system that helps maintain the integrity of our thinking in real-time, preventing small cognitive errors from compounding into larger psychological issues.
Consider the following illustrative situation. You work in an office and are generally secure in your role. One day you receive an email from your manager requesting an “urgent meeting tomorrow”. Immediately, your mind races to conclusions: “I’m going to be fired,” “I’ve done something wrong,” or “The project is failing.” A cognitive unit test in this situation would involve asking yourself:
By running these quick mental checks, you can identify that your initial reaction was based on anxiety rather than evidence, allowing you to approach the situation with a more balanced perspective.
So what might such cognitive unit tests look like? I have compiled a list of ones that can be helpful and which I believe are the most common causes of “program errors”. Similarly to unit tests in software development, there are no golden standard tests to perform. Each individual will be more receptive to certain pitfalls, and will have unique tests they will need to define for themselves, potentially with the help of a professional.
The below unit tests are questions you can ask yourself about a certain belief or idea. They will help you understand if they are balanced and true. For each unit test I have included an example situation to apply it in. You can use these unit tests as starting points for journaling too. Developers of large language model (LLM) technologies may also consider adding these as reasoning traces.
“Are you learning the right thing?”, “Are you solving the right problem?”
“What is my emotional state now?”, “Is it possible that my thoughts are generated by my emotions?”, “Am I actually angry or just hungry?”, “Would I think differently tomorrow?”
Cognitive unit tests can be used in daily life. They provide a structured framework to ensure we make clear-headed decisions. In this essay I created a parallel to software development, to provide us with more jargon to describe these cognitive tools. But of course, similar approaches have been proposed in therapy and counseling literature.
In Cognitive Behavioral Therapy (CBT), similar cognitive unit tests are commonly applied as part of therapeutic interventions. One core exercise is ‘cognitive restructuring’ or ‘reframing’ thoughts, where clients learn to identify, challenge, and modify distorted thinking patterns. These cognitive unit tests serve multiple therapeutic functions in clinical settings.
First, they interrupt automatic negative thought patterns by introducing a metacognitive pause - a moment where patients step back and examine their thinking process rather than being swept along by it. This pause itself has therapeutic value, as it breaks the cycle of rumination that often characterizes anxiety and depression.
Second, regular application of these tests gradually builds cognitive flexibility, a key predictor of mental health resilience. Patients who develop the ability to question their thoughts show improvements in various outcome measures, including reduced symptom severity in mood disorders and anxiety conditions.
Third, these cognitive checks create a framework for self-directed intervention between therapy sessions. Unlike pharmaceutical interventions alone, cognitive approaches equip patients with tools they can independently deploy when distressing thoughts arise, fostering autonomy and self-efficacy in managing their mental health.
Beyond CBT, similar approaches appear in Dialectical Behavior Therapy (DBT), where “checking the facts” serves as a core skill for emotion regulation, and in Acceptance and Commitment Therapy (ACT), where cognitive defusion techniques help patients recognize thoughts as mental events rather than objective truths requiring action.
The effectiveness of these approaches is well-documented in clinical literature, with meta-analyses demonstrating moderate to strong effect sizes for cognitive interventions across multiple conditions. By systematizing these approaches into “cognitive unit tests,” we create a framework that bridges clinical practice with everyday mental health maintenance that anyone can implement.
The cognitive unit test framework offers a valuable bridge between the structured world of software development and the often chaotic landscape of human thought. By implementing these systematic checks, individuals gain a powerful tool against rumination - that relentless, circular thinking that characterizes many mental health challenges.
What makes this approach particularly effective is its emphasis on process rather than content. Rather than trying to suppress negative thoughts (which research shows often backfires), cognitive unit tests create a metacognitive framework that allows individuals to examine how they’re thinking, not just what they’re thinking. This shift in perspective interrupts the cognitive fusion that makes rumination so difficult to escape.
The software engineering analogy provides both accessibility and precision. Just as developers don’t need to rebuild an entire codebase to fix a bug, individuals don’t need complete cognitive overhauls to improve mental wellbeing. Instead, identifying and correcting specific problematic thinking patterns can create cascading positive effects throughout one’s cognitive ecosystem.
Looking forward, these principles have implications beyond individual mental health. The systematic identification of cognitive distortions could inform computational models of human reasoning, potentially improving artificial intelligence systems by incorporating more realistic representations of human cognitive biases and correction mechanisms. Moreover, as we continue developing increasingly sophisticated AI, understanding how to implement “cognitive unit tests” within these systems may help them avoid the equivalent of human cognitive traps while maintaining creative flexibility.
By applying these structured checks to our thinking, we transform the prefrontal cortex from a potential source of rumination to what it evolutionarily developed to be - an extraordinary problem-solving tool that expands human potential rather than constraining it.