

General Case Problem-Solving – Implementation Steps
Jul 30, 2018
17:17
In the prior episode, we started out our coding of a solution for a specific case. Now we move on to the general case problem-solving code. Some of this work may have been completed in your general solution, but it is worth looking over these to craft the best solution. Input Parameters Our hard-coded solution did not need any parameters or even user input. However, as we move into the code for the general case problem-solving, we need to add those features. It is possible to skip the user input step at this time and merely hardcode different values for the problem. I do not recommend this as it is better to get some user input steps in early so they can be tested extensively during implementation. Security and Validation As we move to a more flexible solution, we need to consider security and validation. User input can be insecure or incorrect. This is an excellent time to start implementing checks that the data is valid and the user is authorized to enter it. We are just getting started on this facet of the implementation, so a lot of placeholder code makes perfect sense for now. More Testing Your tests were pretty simple last time. Now we are building out the core functionality and should verify it through testing. We will follow some general rule of thumb steps for testing.
- Max value in a range
- Min value in a range
- one off values of both min and max in a range
- Empty values
- Values that are too long