Talk through it. Describe how you would do it on paper. Define it for me. If you can't tell me how to do it, then you definitely cannot tell a computer.
My criteria for good software:
Does it work?
Can someone else come in, make a change, and be reasonably certain no bugs were introduced?