LLM Code Review Challenge
In this non scientific contest, I checked the code review prowess of three (3) excellent LLM's. The contestants are:
Method
LLM canvass provided by https://app.understand.tech
Attach code file (Appendix A) as input to a single prompt below.
“Review attached java code. Find issues and provide a report. Summarize issues first, followed by detail fix.”Sit back and watch results stream in.
Summary
All contestants did an excellent job. The table below is not meant to pick a winner. Rather, it highlights that if we combine the result set from multiple LLM, we will have better coverage over a single LLM.
There are at least 10 issues listed in the table below. Let’s see how the contestants did.
Summary Response
Here we review full response received from the LLM canvass.
Recommended by LinkedIn
GPT 4.1
Summary of Issues
Claude Sonnet 3.7
Summary of Issues
DeepSeek v3
Summary of Issues:
Appendix A ( Banker.java)
// Banker.java
// This file contains intentional bugs and areas for improvement
// Task: Identify and fix the issues in this bank account implementation
import java.util.ArrayList;
import java.util.List;
public class BankAccount {
private String accountNumber;
private String accountHolder;
private double balance;
private List<String> transactionHistory;
public BankAccount(String accountNumber, String accountHolder, double initialBalance) {
this.accountNumber = accountNumber;
this.accountHolder = accountHolder;
this.balance = initialBalance;
this.transactionHistory = new ArrayList<>();
transactionHistory.add("Account created with initial balance: " + initialBalance);
}
public void deposit(double amount) {
if (amount > 0) {
balance += amount;
transactionHistory.add("Deposited: " + amount);
}
}
public void withdraw(double amount) {
if (amount > 0 && amount <= balance) {
balance -= amount;
transactionHistory.add("Withdrew: " + amount);
} else {
System.out.println("Invalid withdrawal amount");
}
}
public void transfer(BankAccount recipient, double amount) {
if (amount > 0 && amount <= balance) {
this.withdraw(amount);
recipient.deposit(amount);
transactionHistory.add("Transferred: " + amount + " to account " + recipient.getAccountNumber());
}
}
public void printTransactionHistory() {
System.out.println("Transaction History for Account: " + accountNumber);
for (String transaction : transactionHistory) {
System.out.println(transaction);
}
}
// Getters
public String getAccountNumber() {
return accountNumber;
}
public String getAccountHolder() {
return accountHolder;
}
public double getBalance() {
return balance;
}
public List<String> getTransactionHistory() {
return transactionHistory;
}
}
// Main class to demonstrate the BankAccount functionality
public class Main {
public static void main(String[] args) {
BankAccount account1 = new BankAccount("123456", "John Doe", 1000.0);
BankAccount account2 = new BankAccount("789012", "Jane Smith", 500.0);
account1.deposit(200);
account1.withdraw(100);
account1.transfer(account2, 300);
account1.printTransactionHistory();
account2.printTransactionHistory();
System.out.println("Account 1 balance: " + account1.getBalance());
System.out.println("Account 2 balance: " + account2.getBalance());
}
}
Amazing work Asad Haque. Thanks for posting this. There is an amount of intelligence that AI agents gain when providing the right amount of code context. The more 'context' the better the output... it can be a code generation task/ code review or simply writing test cases.
I like the use case and the video gets the point across :)
💡 Great insight
💡 Great insight
Excellent article !!