There are several debates happening in the tech industry right now amongst software engineers. One of them goes along the lines of “If you don’t read the code the AI is producing, then how do you know what it does?!”
Things I find strange about this argument:
- No software engineer has read every single line of code that goes into a project
- Most don’t read their own entire code base, let alone any libraries or dependencies that go into them
- Reading code alone doesn’t tell you how it _actually_ works when you put everything together.
- NASA Showed that a formal code review process (reading the code) catches somewhere between 60%-90% of defects [Source 1, Source 2]
The serious answer to this is: Regardless of how code was created, you need to test it in order to know that it does what it’s supposed to
It doesn’t matter if you wrote it, you don’t know it works until you test it.
It doesn’t matter if an AI wrote it, you don’t know it works until you test it.
It doesn’t matter if another team wrote it, you don’t know it works until you test it.
It doesn’t matter if a compiler generated it, you don’t know it works until you test it.
There are many ways to verify code
- You can write automated testing of all sorts
- You can have formal verification systems such as algebraic types and rust’s borrow checker
- You can have humans manually test things
- You can have users test things
But in the end it’s the verification, the convincing yourself it works, that matters for taking responsibility. Not whether you read it or not.
