For something small and self-contained, this might be just a basic flowchart or a simple equation. For larger projects, it helps to break the job into modules, and to consider the following: What task each module must perform How data gets passed between modules How the data will be used within each module Although gathering and planning requirements can be tedious and much less fun than diving straight into coding, it is even more tedious to spend hours debugging. Take the time to design the flow and structure of your program correctly up front, and you may even spot more efficient ways of accomplishing your goals before you write the first line of code!
Extremes: Zero and beyond the expected maximum for positive numeric values, empty string for text values, and null for every parameter. Meaningless values. Even if you don’t believe your end user would input gibberish, test your software against it anyway. Incorrect values. Use zero for a value that will be used in division, or a negative number when positive is expected or when a square root will be calculated. Something that is not a number when the input type is a string, and it will be parsed for numeric value.
Extremes: Zero and beyond the expected maximum for positive numeric values, empty string for text values, and null for every parameter. Meaningless values. Even if you don’t believe your end user would input gibberish, test your software against it anyway. Incorrect values. Use zero for a value that will be used in division, or a negative number when positive is expected or when a square root will be calculated. Something that is not a number when the input type is a string, and it will be parsed for numeric value.
You can take an active role in improving the clarity of the process by presenting your requirements documentation or your implementation plan well before beginning to code. This will help to ensure that what you are planning to create is actually what’s been asked for. Structure the project as a series of milestones with a demo for each block, and manage the process one milestone at a time. The fewer things you need to think about at any given moment, the more likely it is that you will think clearly.
Start by displaying a square and getting it to follow the mouse; i. e. , solve movement tracking alone, first. Next, make the size of the square relate to mouse speed; i. e. , solve speed-to-shape tracking on its own. Finally, create the actual shapes you want to work with and put the three components together. This approach naturally lends itself to modular code writing, where each component is in its own self-contained block. This is very useful for code reuse (e. g. you want to just use the mouse tracking in a new project), and makes for much easier debugging and maintenance.