If you can't see your way to building a testcase, then your code was built wrong. GTK+ apps, to use your example, are testable using any number of scriptable GUI testers (such as Rational Rose or, on OSX, Automator). Webapps are similar testable using Selenium. Come back when your problem deals with threads and random data.
My criteria for good software:
- Does it work?
- Can someone else come in, make a change, and be reasonably certain no bugs were introduced?