Not being a programmer, I have a question.
Can any program be broken down into functions and functions of functions that have inputs and outputs so that they can be verified if they are working?
replies(13):
Can any program be broken down into functions and functions of functions that have inputs and outputs so that they can be verified if they are working?
Can a function be "verified", this can mean "tested", "reviewed", "proved to be correct". What does correct even mean?
Functions in code are often more complex than just having input and output, unlike mathematical functions. Very often, they have side effects, like sending packets on network or modifying things in their environment. This makes it difficult to understand what they do in isolation.
Any non-trivial piece of software is almost impossible to fully understand or test. These things work empirically and require constant maintenance and tweaking.