Become a 10x Software Engineer with Bayesian Thinking

You can use the principles of Bayesian Thinking to improve your productivity

Devansh
5 min readJun 13, 2023

Bayesian thinking is extremely powerful when it comes to software engineering.

At its core Bayes Theorem is a way of updating our beliefs about the world with new knowledge that we gain. Bayes’ Theorem is extremely powerful because it allows us to use the additional specific information we have about a sample rather than being forced to resort to general population-level statistics. This can be critical in sorting through the heaps of additional information that we receive to prioritize the right decisions.

This can be especially important for becoming effective software engineers. Because of how quickly things change, a developer working on a normal-sized project has a myriad of decisions to make. At a point you can-

  1. Add a new feature.
  2. Refactor existing code.
  3. Made changes to existing pipelines.
  4. Work on integrating an entirely new capability.

and more. How can you quickly identify what’s important and where you should put your energy? Answering this question well can be the key to great career success. Picking the wrong horse… will teach you a lot. Turns out that Bayesian thinking might provide a great benefit to software testing. In many ways, human thinking is naturally Bayesian, so you’re likely already using some of this subconsciously. However, human thought is vulnerable to many logical fallacies. Explicitly training your Bayesian thinking will protect you from them (to a large degree).

Bayesian reasoning methods provide an ideal research paradigm for achieving reliable and efficient software testing and program analysis

-Bayesian Reasoning for Software Testing

In this article, I will be going over some avenues you can leverage Bayesian Thinking to improve your decisions. My suggestion for the article would be the following- pick one or two areas suggested in this article and focus on learning about them in more detail. If you’d like me to cover any topics in more detail, let me know through any of the usual methods.

Image Source by Tirthajyoti Sarkar

Leveraging Bayesian Thinking for better results

  1. Prioritizing and estimating: When faced with multiple tasks or features to implement, Bayesian thinking can be a game-changer. Take a look at what this team discovered about using Bayesian Thinking for better software, “Our approach is based on probability theory and utilizes Bayesian Networks (BN) to incorporate source code changes, software fault-proneness, and test coverage data into a unified model. As a proof of concept, the proposed approach is applied to eight consecutive versions of a large-size software system. The obtained results indicate a significant increase in the rate of fault detection when a reasonable number of faults are available.
  2. To implement this, I recommend that engineers assign prior probabilities to each item based on the available information (don’t overthink this, just go with a reasonable guesstimate). As new data or insights emerge, these probabilities can be updated to make more accurate estimates and prioritize effectively. The important point here is to have your original guesses set up quickly. Iterating quickly will be the most important factor for improving your performance.
  3. A/B testing: Bayesian inference is widely used in A/B testing, where different versions of a feature or design are compared to determine the optimal choice. Bayesian methods allow engineers to continuously update their beliefs about which version performs better as new data comes in, leading to more efficient and adaptive decision-making. My favorite part about this is that you can build very fine-tuned profiles for testing. This article from Hubspot is a good one about this topic.
  4. Bug fixing and debugging: When troubleshooting software bugs, there can be a lot uncertainty about the root cause. Bayesian thinking can help in formulating hypotheses and iteratively updating beliefs as new evidence is gathered. By marking potential causes with priors and adjusting them with each new piece of information, engineers can narrow down the search space more effectively. The authors of A Bayesian Framework for Automated Debugging had some interesting results for those that are interested.
  5. Risk assessment and decision-making: This is the OG use case of Bayes Theorem (it was used to compute the risk of death for insurance iirc). Bayesian thinking enables engineers to quantify and update their beliefs about potential risks and outcomes, considering both prior knowledge and observed data. This is a big step up from using just priors since we can use very specific character traits to fine-tune our computations (going back to why Bayesian A/B tests work so well).
  6. Machine learning and Bayesian networks: Finally, Bayesian methods play a huge role in machine learning. Probabilistic graphical models provide a framework for representing uncertain relationships between variables and allow us to represent complex systems, make predictions, and run diagnostics. When I worked in supply chain risk analysis, Bayesian Networks were by far the most effective tool I had (even more so than my beloved Random Forests).

Ultimately, Bayesian thinking is an extremely powerful tool for software engineers. If you’d like to see what other Math concepts are essential for software engineers, and what role they play, check out our Math for Software Engineers article here.

That is it for this piece. I appreciate your time. As always, if you’re interested in working with me or checking out my other work, my links will be at the end of this email/post. If you like my writing, I would really appreciate an anonymous testimonial. You can drop it here. And if you found value in this write-up, I would appreciate you sharing it with more people. It is word-of-mouth referrals like yours that help me grow.

Save the time, energy, and money you would burn by going through all those videos, courses, products, and ‘coaches’ and easily find all your needs met in one place at ‘Tech Made Simple’! Stay ahead of the curve in AI, software engineering, and the tech industry with expert insights, tips, and resources. 20% off for new subscribers by clicking this link. Subscribe now and simplify your tech journey!

Using this discount will drop the prices-

800 INR (10 USD) → 640 INR (8 USD) per Month

8000 INR (100 USD) → 6400INR (80 USD) per year (533 INR /month)

Get 20% off for 1 year

Reach out to me

Use the links below to check out my other content, learn more about tutoring, reach out to me about projects, or just to say hi.

Small Snippets about Tech, AI and Machine Learning over here

AI Newsletter- https://artificialintelligencemadesimple.substack.com/

My grandma’s favorite Tech Newsletter- https://codinginterviewsmadesimple.substack.com/

Check out my other articles on Medium. : https://rb.gy/zn1aiu

My YouTube: https://rb.gy/88iwdd

Reach out to me on LinkedIn. Let’s connect: https://rb.gy/m5ok2y

My Instagram: https://rb.gy/gmvuy9

My Twitter: https://twitter.com/Machine01776819

--

--

Devansh
Devansh

Written by Devansh

Writing about AI, Math, the Tech Industry and whatever else interests me. Join my cult to gain inner peace and to support my crippling chocolate milk addiction

Responses (7)