Ok – this is a question with lots of layers and lots of approaches. I’ll stick to using an existing programming language (your pick) and describe the methodology I’ve used to build things.
You want your program to do something. To do that thing, it needs input(s) from somewhere, and does something to make an output. Now that, but for many combinations of inputs and outputs. OK time to simplify….
I sketch out a flow chart showing where things are coming from, going to, and the operations being done on them. Now I realize my inputs need to be tested in case the format is wrong or the data is out of bounds. I’m looking for ways to test the things I want done to see they wind up with valid outputs.
Time to start coding. I need a way to request the data from the source, or respond while waiting for an input. More tests. Data valid? Test. Which action to take? More tests. Action does this. Check to see if results valid. Test. Pass output to next link in the chain (output, or more actions). And while you’re testing, create exits to deal with invalid data.
Lather, rinse, repeat. Design it well, and you get a general purpose process that you can feed endlessly and receive valid output for a variety of conditions and inputs. X + Y = Z Any valid X and Y will (should) give you a valid Z. Test!
And so on, until you’ve built all the steps needed to go from start to finish, while reusing as much code (loops, etc) as possible.
Than help?
Latest Answers