“The code did what it was designed to do,”
That is the meaning of not defective.. What definition of defective could you conjure that would apply to this code?
It did what it was designed to do. That said, it was defective because it wasn't designed to do what it should do. The point of the new software was to make the plane safer. The software did the opposite, and therefore was defective.