Producing Robust Programs (2.3)
No description yet. This curated deck is ready for daily study.
Card preview (11)
What is input sanitisation
• to clean up input data, removing any unwanted data such as extra spaces, or removing special characters/symbols. This also helps prevent SQL injection.
What is validation
• validating the data entered so that it fits a range of values, or is of a specific type. Entered data must fit criteria to prevent logical errors and unexpected outcomes
What is authentication
• only allowing authorised users to access data through use of usernames and passwords etc.
What is maintainable code
• this allows other programmers to also understand the code, especially when dealing with large programs
What 4 ways can maintain code
• Comments : annotating the code to make it easier to understand and read • Indentation : spacing the code appropriately, so it is easily to follow different sections of the program and what they do • Meaningful identifier names : using appropriate names for identifiers (variables, constants etc.) linked to the purpose so it does not cause confusion • Use of sub-programs : allows programmer to structure code so parts can be developed and changed independently without affecting the rest of the program
Why do you test your code
• Testing allows the programmer to test the function of programs to make sure they work as expected
What is iterative testing
• carried out while the program is being developed (ongoing) so different sections of code are tested out by the programmer
What is Final/Terminal testing
• carried out when all the sections of the program and code have been completed and developed. The program is tested as a whole to make sure it functions as expected.
What is normal test data
• selecting valid/expected values to see if the program accepts these without causing errors e.g. if the valid numbers are 1-10 then choose a number within this range
What is Invalid/Erroneous test data
• selecting data which the program should not accept such as entering “six” as string instead of 6 as integer so it should be rejected
What is boundary test data
• selecting values which lie on the boundary of the accepted range of values e.g. if 1-10 are valid values then entering 0,1,10,11 are boundary data