Execution Tracing Flashcards
How to know when a program is correct
- any given input can take and create the right answer and the program has the ability to stop at any point
- implementation of algorithms meet specifications set out for them
Types of software testing
white/glass box
black box
White box testing
- structural or code based testing
- full knowledge of the code being tested and how it was written
- usually by code developers or someone allowed to examine the code in detail
- small components of larger software tested in isolation
Boundary testing
- test data is chosen for its proximity to any max/mins written into the program
- test a list length to approach its limit, to reach or exceed it and then fix with errors
Black box testing
- aka behavioural testing
- assumes testers ignorance of internal source code
- conduct tests to check program against specification
- test for ease of use, aesthetics, performance etc
automated testing
- a lot of research effort goes into software that tests together
- the goal is to automate some repetitive but necessary testing in the formalized process or testing difficult to do manually
Execution tracing
- tracking the course of a running program’s execution
- temporarily insert print() statements to show the values of certain variables at certain points
pausing execution
simple technique without any debugging tools to insert a print() followed by keyboard input
issues with manually pausing execution
- need to insert a lot of code for line-by-line investigation
- need to tidy up code after tracing (IE deleting the testing code)
IDE Debugging Tools
- suspend program execution temporarily at designated places called breakpoints
- allow viewing values of variables in scope at a breakpoint
- set and clear breakpoints
- suspend program
- debugger
IDLE debug control
Go stop over out quit
Go
resume execution, stop at next breakpoint if any or to end of program
step
execute the current instruction and suspend execution again
if the current instruction is or contains a function call, then step into that function and suspend execution there
over
same as step, except if the current instructions is or contains a function that call will be “stepped over” and the program will be suspended at the start of the next instruction in the current block
out
resume execution until the current block is finished executing or step out of a function if the execution is currently one
quit
exit program