0% found this document useful (0 votes)
5 views

Programming in IDE

The document discusses program testing, focusing on identifying and correcting syntax, logic, and run-time errors. It highlights the ease of finding syntax errors through compilers and the challenges of detecting logic and run-time errors, which require careful testing. Additionally, it introduces stub testing as a method to test user interfaces before full implementation.

Uploaded by

chiyanjapeter7
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Programming in IDE

The document discusses program testing, focusing on identifying and correcting syntax, logic, and run-time errors. It highlights the ease of finding syntax errors through compilers and the challenges of detecting logic and run-time errors, which require careful testing. Additionally, it introduces stub testing as a method to test user interfaces before full implementation.

Uploaded by

chiyanjapeter7
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Paper 2. Sec 2.4.

1) Programming in IDE Computer Science 9608


with Majid Tahir

Syllabus Content:
2.4.2 Program testing:
show understanding of ways of exposing faults in programs and ways of avoiding
faults
locate and identify the different types of errors:
o syntax errors
o logic errors
o run-time errors
correct identified errors

Testing strategies
Finding syntax errors is easy. The compiler/ interpreter will find them for you and usually gives
you a hint as to what is wrong.

Syntax Error:
A syntax error is a 'grammatical' error, in which a program statement does not follow the rules
of the high-level language constructs.

When Syntax error occurs, VB IDE underlines


wrong syntax, and gives options for corrections.

1
Paper 2. Sec 2.4.1) Programming in IDE Computer Science 9608
with Majid Tahir

Much more difficult to find are logic errors and run-time errors.

A run -time error occurs when program execution comes to an unexpected ha lt or 'crash' or it
goes into an infinite loop and 'freezes'.

Logical Error:
Logic error: an error in the logic of the solution that causes it not to behave as intended

Run-time Error:
Run-time error: an error that causes program execution to crash or freeze

Testing
Both of these types of errors can only be found by careful testing. The danger of such errors is
that they may only manifest themselves under certain circumstances. If a program crashes
every time it is executed, it is obvious
there is an error.

If the program is used frequently and


appears to work until a certain set of
data causes a malfunction.

That is much more difficult to discover


without perhaps serious
consequences.

Stub testing
When you develop a user interface,
you may wish to test it before you
have implemented all the facilities.

You can write a 'stub' for each


procedure (see Figure).

The procedure body only contains an


output statement to acknowledge that
the call was made.
Each option the user chooses in the
main program will call the relevant
procedure.

2
Paper 2. Sec 2.4.1) Programming in IDE Computer Science 9608
with Majid Tahir

References:

Cambridge International AS & A level Computer Science Course book by Sylvia Langfield and Dave Duddell
Visual Basics Console Mode Editor Window from notes of Sir Majid Tahir

You might also like