U4: Debugging and Validating Data
No description yet. This curated deck is ready for daily study.
Card preview (15)
Trial and Error
• Good for programming as cost of failure is low • Takes little time and money, low stakes
Rule of Ten
• Trial and error cheaper in earlier stages of Software Development Life Cycle • Error costs x10 more to fix at each next stage
Iteration
Continually trying solutions, refining each one, getting closer to end goal
Run-Time Error
• Occurs when program crashes • Can be caused by dividing by 0, opening nonexistent file
Syntax Error
• Mistake in writing code • Ex: Missing variable, forgetting curly bracket • AKA: Compile Time Errors as they’re caught while compiling
Logic Error
• Program runs but output incorrect • Can cause run-time error as well
Top-down Design
Solution where problem broken down into smaller and smaller sub-problems until each can be solved in few steps
Variable Inspection
Visualizers inspect values of objects
Visualizers
Allow to see how code executes step by step
Data Structure Visualization
Visualizers include tools for visualizing data structures (ex: arrays, lists, trees, graphs).
Tracing
• Outputting values of variables during program • Delete output statements when program debugged
Test Data
• Should have wide range of input data • Include different data (ex: 0, decimals instead of strings)
Test Plan
• Includes aspects of program tested • Outcomes of test (positive or negative and details to errors) • Changes made to program
Data Validation
Checking to ensure data entered is expected
try… catch command
• “try” command tries algorithm that may cause crash • “catch” command catches problem, stopping catch