Testing And Debugging Programs Flashcards
What is an execution error?
An error produced when the program is run. Examples include an attempt to use a variable that has not been declared, use of invalid data, attempt to access a non existent file or division by 0.
What is a logic error?
A logic error occurs is when the code executes but produces the wrong result. Common errors may include AND instead of OR, , code written in the wrong order or loops which repeat the wrong number of times.
What is static testing?
A form of testing that involves reading the program code and mentally ‘walking through’ it without actually running the program.
Errors are fixed before program execution.
What is Dynamic Testing?
When code is executed using a set of test data. Variables are listed and the values which they store are tracked as code is executed.
What is a breakpoint and which type of testing is it used in?
Break points are used in dynamic testing to pause executing code at specific points and allowing current variable values to be executed.
Give an example of dynamic testing
A trace table, which lists variables in a program and tracks the values they store as code is executed.
Give an example of static testing
A dry run involves reading the program and going through it mentally without actually running the program. The tester predicts what the program code will produce.
Give an example of a test plan for a small program.
Dynamic testing to simply check the program copes with a variety of different inputs from normal, extreme and exceptional data.
Define normal, extreme and exceptional data
Normal - Data within the expected range
Extreme - Data on the boundaries of the unexpected range
Exceptional - Data within the unexpected range
What is functional testing?
Tests that check to see if particular features work
What is alpha testing?
Tests performed on completed software at a developers site
What is beta testing?
Tests performed offsite by those outside the programming team
What is acceptance testing?
Tests performed by the customer using their own environment and hardware
What is compatibility testing?
Tests that check softwares compatibility with other apps or OS
What is installation testing?
Tests which ensure the software installs correctly on customer hardware.
What is usability testing?
Checks the usability of a user interface
What is accessibility testing?
Checks that software is compatible with disability legislation
Why is software tested?
To identify errors in code
What is a syntax error?
When rules regarding how each instruction must be written or formatted are broken a syntax error is created which prevents execution of the instruction.
What is systematic testing?
When testing is planned and can be documented as a result
What is comprehensive testing?
When every aspect of the software is tested
What is the purpose of a test plan?
A set of test data created in order to systematically and comprehensively test the software in which the client requested to ensure it meet standards when delivered.
Mostly created during design stage as this is the stage when inputs, outputs and user interface should be known.
A test plan includes…
The software specification which was created at the analysis stage.
A schedule for the testing process
Details of what is and what is not to be tested
Test data and expected results
Documentation of the testing process
Why is acceptance (beta) testing important?
There will always be unidentifiable errors within software until it is in the use of clients/users (who can then report it)
Why is documentation of the testing process so important?
So that if problems are encountered later on then test results can be checked and work duplication avoided
What is a dry run?
The user self checks the program by going through its Pseudocode/source code themselves.
User ensures that all variables produce what they are supposed to at various stages of the code.
Table is usually drawn out on paper or using a computer as execution may be difficult.
What is a trace table?
Similar to a dry run but is often used when a user wishes to check various values of a variable in a specific sub-program.
What is a trace tool?
Programming environments can have trace facilities in order to allow the programmer to see which lines of code are being run
which variables values are changing
Trace tool examples
A watch - Takes a variable and displays its value as the program progresses. The user can go through each statement one at a time and the value of the variable being traced is displayed on the watch screen.
This can be set to stop when the variable reaches a particular value.
Some may allow investigation of actual memory locations and in particular the contents of a stack.
By examining such data, any errors occurring in the order of procedure calling from the main program can be checked and corrected as the stack is used to store all procedure calls during execution.
What is a breakpoint?
A point in the source code where the program will stop execution allowing the values of variables to be examined
These can be set to stop execution at a particular point in the code, when the variable has a particular value (watch) or a particular key is pressed
Once stopped, the values can be examined or written to a file for study later
What types of test data will a test plan include?
Normal, Extreme, Exceptional
A syntax error is when…
The “grammatical” rules of the language have been broken. Usually detected by an interpreter/compiler.
Tests and their results should be fully documented so that…
Should subsequent problems be discovered they can be checked
Work duplication is avoided
Examples of execution errors include…
Division by zero
Out of memory
Which testing is carried out by end users of a program?
Beta Testing
Why is it important to document any tests performed during the software development phase?
To avoid duplication of tests if errors are discovered later on
To help ensure that testing is both comprehensive and systematic
Give examples of syntax errors
IF without END IF
WHILE without DO
Missing semi-colon
Fit for purpose
Software matches the specifications agreed with the client
Testing technique which does not involve the use of software to test the value of variables
Dry run - A manual check of the value of variables carried out by the programmer
Comprehensive Testing
Testing normal, extreme and exceptional data
What should happen if exceptional data is entered by a user when asked for an integer value?
Program should have included error trapping features that inform the user of the fact that the data is not valid
Extreme Data
Data which is accepted but is on the limits of a valid range
Maintenance
Results in source code being edited or created afresh, resulting in more testing
Analysis stage and testing
Test plan is informed by the outcome of discussion between the client and developers
Comprehensive testing should focus on
The program meets requirements specified in the analysis
Responds correctly to input
Data and calculations processed correctly
Produces required output