Microsoft's new AI tool can tell you when your code sucks

AI
(Image credit: Shutterstock)

Microsoft researchers have developed an Artificial Intelligence (AI) solution that they believe can help programmers debug their applications faster and more accurately.

Called BugLab, the AI is based on a “hide and seek” game model, and works in a fashion similar to how the Generative Adversarial Networks (GAN) are created.

Detailing the research in a blog post, researchers Miltos Allamanis (Principal Researcher) and Marc Brockschmidt (Senior Principal Research Manager) explained how they created two networks and pitted them against each other, much like how hide and seek is played.

Competition

One network is designed to create bugs, both big and small, into existing code, while the other is created to find them. As the game goes on, and both “participants” get better at it, the AI comes to a point where it’s good enough to identify bugs hidden in actual code. 

The two models were trained jointly, without labeled data, in a self-supervised way, over “millions of code snippets”, the researchers explained. 

Even though the idea was to create a program that can identify arbitrarily complex bugs, these are still “outside the reach of modern AI methods”, the researchers claim. Instead, they focused on commonly appearing bugs, such as incorrect comparisons, incorrect Boolean operators, variable misuses, and similar bugs. 

False alarms standing in the way

Testing was done on Python, and after training the app, it was time to test it in real life. 

“To measure performance, we manually annotate a small dataset of bugs from packages in the Python Package Index with such bugs and show that models trained with our “hide-and-seek” method are up to 30% better compared to other alternatives, e.g., detectors trained with randomly inserted bugs,” the blog added. 

The duo described the results as “promising”, as about a quarter (26%) of bugs could be found and fixed automatically. What’s more, among the bugs detected were 19 previously unknown ones. 

Still, there were many false positives, leading the researchers to conclude that a lot more training is needed before such a model could be practically deployed.

TOPICS

Sead is a seasoned freelance journalist based in Sarajevo, Bosnia and Herzegovina. He writes about IT (cloud, IoT, 5G, VPN) and cybersecurity (ransomware, data breaches, laws and regulations). In his career, spanning more than a decade, he’s written for numerous media outlets, including Al Jazeera Balkans. He’s also held several modules on content writing for Represent Communications.

Read more
AI Education
AI in 2025: Moving beyond code generation to intelligent development platforms
A profile of a human brain against a digital background.
Securely working with AI-generated code
AI writer
Coding AI tells developer to write it himself
A woman at a table using a Windows laptop, opposite sits a man, neither show their face
Microsoft will now pay you even more to find security bugs in Copilot
Gemini Code Assist
What is Gemini Code Assist? Everything we know about the AI coding tool
A laptop screen showing a ChatGPT coding panel
The ChatGPT Mac app just got a massive coding upgrade – and it’s coming to Windows soon
Latest in Pro
Group of people meeting
Inflexible work policies are pushing tech workers to quit
Representational image depecting cybersecurity protection
Third-party security issues could be the biggest threat facing your business
An image of network security icons for a network encircling a digital blue earth.
Why multi-CDNs are going to shake up 2025
A stylized depiction of a padlocked WiFi symbol sitting in the centre of an interlocking vault.
Broadcom warns of worrying security flaws affecting VMware tools
Android Logo
Devious new Android malware uses a Microsoft tool to avoid being spotted
URL phishing
HaveIBeenPwned owner suffers phishing attack that stole his Mailchimp mailing list
Latest in News
Robert Downey Jr reveals himself as Doctor Doom to a delighted crowd at San Diego Comic-Con 2024
Marvel is about to make a major announcement about the MCU, and nobody's sure what it'll be
The Samsung Galaxy S25 Edge on display the January 22, 2025 Galaxy Unpacked event.
Samsung Galaxy S25 Edge colors seemingly revealed in new video, and there’s another sign of an imminent launch
Image of Naoe in AC Shadows
Assassin's Creed Shadows best graphics settings for PS5, PS5 Pro, and Xbox Series X
Promotional image for Malcolm in the Middle featuring the original cast playing golf
Malcolm in the Middle's Disney+ revival gets underway as the series finds its cast – here's which characters are returning
Group of people meeting
Inflexible work policies are pushing tech workers to quit
A young woman is working on a laptop in a relaxed office space.
I’ll admit, Microsoft’s new Windows 11 update surprised me with its usefulness, providing accessibility fixes, a gamepad keyboard layout, and PC spec cards