Lesson Objective
- Understand the purpose of testing and validation.
- Be able to state some features of IDEs.
- Identify good coding practice.
KS3, GCSE, A-Level Computing Resources
Testing aims to find and fix errors and ensure a program's quality. You should make a test plan with various tests and test data to check the program. Test data should include different inputs to show the program's strengths and weaknesses. Test data has three categories: Normal, Boundary and Erroneous.
Sensible, valid data that the program should accept and be able to process. For example, if a program asks for a number from 1 to 10, normal data could be 5.
Valid data that falls at the boundary of any possible ranges, sometimes known as extreme data. For example, if a program asks for a number from 1 to 10, boundary data could be 1 or 10.
Invalid data that the program cannot process and should not accept. For example, if a program asks for a number from 1 to 10, erroneous data could be -5, 20, or "hello".
Validation is used to make sure that data is entered in a correct way. This ensures that the data is relevant and useful for its intended purpose.
Different types of validation checks can be used to validate data:
Validation does not guarantee the accuracy of the data. It might be in the right format, but still incorrect. For instance, typing an incorrect birth date.
Below is an example of an algorithm that validates an input.
Authentication is the process of confirming your identity. Below are some examples of authentication methods:
An IDE is a software tool that helps you make other software. It gives you a space to type, change, and store code in a convenient way. IDEs have various features that assist you in making and modifying programs. Here are some examples of features:
Debugging is the process of finding and fixing any problems or bugs in the program, usually by testing it in a methodical way. A debugger program is a common feature in IDEs that helps with debugging.
You should use meaningful variable and subroutine names in your program. This helps other programmers to understand what is going on. It can also help you remember how your code is working.
Example: No meaningful names
Example: With meaningful names
Comments are also good practice as they can again explain sections of code to other programmers and also help you remember things.
Example: No comments
Example: With comments