---
title: "Beware of bugs in the above code; I have only proved it correct, not … — Donald Knuth Quote #2 | QuotesBy.net"
description: "Beware of bugs in the above code; I have only proved it correct, not tried it. — a quote by Donald Knuth."
image: "https://quotesby.net/wp-content/themes/quotesby-editorial/assets/og-default.png"
---

> # Beware of bugs in the above code; I have only proved it correct, not tried it.

[Donald Knuth](https://quotesby.net/Donald-Knuth)\#2

[Programming](https://quotesby.net/Donald-Knuth/programming/)[Testing](https://quotesby.net/Donald-Knuth/testing/)[Proof](https://quotesby.net/topics/proof/)[Verification](https://quotesby.net/topics/verification/)

[WhatsApp (opens in a new tab)](https://wa.me/?text=%E2%80%9CBeware%20of%20bugs%20in%20the%20above%20code%3B%20I%20have%20only%20proved%20it%20correct%2C%20not%20tried%20it.%E2%80%9D%20%E2%80%94%20Donald%20Knuth%20https%3A%2F%2Fquotesby.net%2FDonald-Knuth%2F2%2F)[X (opens in a new tab)](https://twitter.com/intent/tweet?text=%E2%80%9CBeware%20of%20bugs%20in%20the%20above%20code%3B%20I%20have%20only%20proved%20it%20correct%2C%20not%20tried%20it.%E2%80%9D%20%E2%80%94%20Donald%20Knuth&url=https%3A%2F%2Fquotesby.net%2FDonald-Knuth%2F2%2F)[Facebook (opens in a new tab)](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fquotesby.net%2FDonald-Knuth%2F2%2F)

## About this quote

What does it mean?Proving code correct is not enough; testing it is also required.In plain termsJust because code is proven does not mean it works.What can you take from it?Always test your code after proving it.

### Where it applies

- software development
- engineering
- debugging

### Putting it to work

- run tests
- verify logic
- check edge cases

### Questions to consider

- How do you verify code?
- Is proof enough?

### Another view

Testing cannot catch every possible bug.

## More from Donald Knuth

1. > Premature optimization is the root of all evil (or at least most of it) in programming.

[Permalink to quote \#1](https://quotesby.net/Donald-Knuth/1/ "Permalink to quote 1")
2. > I can't be as confident about computer science as I can about biology. Biology easily has 500 years of exciting problems to work on. It's at that level.

[Permalink to quote \#3](https://quotesby.net/Donald-Knuth/3/ "Permalink to quote 3")
3. > The psychological profiling \[of a programmer\] is mostly the ability to shift levels of abstraction, from low level to high level. To see something in the small…

[Permalink to quote \#4](https://quotesby.net/Donald-Knuth/4/ "Permalink to quote 4")

## Related quotes

1. > An algorithm must be seen to be believed.

[Donald Knuth](https://quotesby.net/Donald-Knuth)[Donald Knuth quote \#11](https://quotesby.net/Donald-Knuth/11/ "Permalink to quote 11")
2. > Talk is cheap. Show me the code.

[Linus Torvalds](https://quotesby.net/Linus-Torvalds)[Linus Torvalds quote \#20](https://quotesby.net/Linus-Torvalds/20/ "Permalink to quote 20")
3. > Premature optimization is the root of all evil (or at least most of it) in programming.

[Donald Knuth](https://quotesby.net/Donald-Knuth)[Donald Knuth quote \#1](https://quotesby.net/Donald-Knuth/1/ "Permalink to quote 1")

```json
{
    "@context": "https://schema.org",
    "@type": "Quotation",
    "text": "Beware of bugs in the above code; I have only proved it correct, not tried it.",
    "url": "https://quotesby.net/Donald-Knuth/2/",
    "spokenByCharacter": {
        "@type": "Person",
        "name": "Donald Knuth"
    }
}
{
    "@context": "https://schema.org",
    "@type": "BreadcrumbList",
    "itemListElement": [
        {
            "@type": "ListItem",
            "position": 1,
            "name": "Home",
            "item": "https://quotesby.net/"
        },
        {
            "@type": "ListItem",
            "position": 2,
            "name": "Authors",
            "item": "https://quotesby.net/authors/"
        },
        {
            "@type": "ListItem",
            "position": 3,
            "name": "Donald Knuth",
            "item": "https://quotesby.net/Donald-Knuth"
        },
        {
            "@type": "ListItem",
            "position": 4,
            "name": "Quote #2",
            "item": "https://quotesby.net/Donald-Knuth/2/"
        }
    ]
}
```
