Program Testing & Maintenance (Cambridge (CIE) A Level Computer Science): Flashcards

Exam code: 9618

1/60

0Still learning

Know0

  • Name the three main categories of error.

Cards in this collection (60)

  • Name the three main categories of error.

    Syntax errors, logic errors and runtime errors.

  • Define syntax error.

    A syntax error is an error that breaks the grammatical rules of a programming language and stops it from running.

  • Name three examples of a syntax error.

    Typos and spelling errors, missing or extra brackets or quotes, misplaced or missing semicolons, invalid variable or function names, incorrect use of operators, and incorrectly nested loops or blocks of code.

  • Define logic error.

    A logic error is where incorrect code causes the program to run but produce an incorrect output or result.

  • True or False?

    A logic error stops a program from running.

    False.

    A logic error lets the program run, but it produces an incorrect output or result. It is a syntax error that stops a program running.

  • What is the difference between a syntax error and a logic error?

    A syntax error stops the program running, whereas a logic error lets it run but produces an incorrect result.

  • Why are logic errors hard to spot?

    They can be difficult to identify by the person who wrote the program.

  • Which tool helps find logic errors?

    Trace tables.

  • True or False?

    Trace tables can only find logic errors.

    False.

    Trace tables can help find any kind of error in a program or algorithm.

  • Name three examples of a logic error.

    Incorrect use of operators, logical operator confusion such as using AND for OR, looping one extra time, indexing arrays incorrectly, using variables before they are assigned, and infinite loops.

  • An infinite          is an example of a logic error.

    An infinite loop is an example of a logic error.

  • Arrays are commonly indexed incorrectly because array indexing starts from         .

    Arrays are commonly indexed incorrectly because array indexing starts from 0.

  • Define runtime error.

    A runtime error is where an error causes a program to crash.

  • Name three examples of a runtime error.

    Dividing a number by 0, an index out of the range of an array, and being unable to read or write a drive.

  • In pseudocode, what is wrong with username = SUBSTRING(...)?

    It uses = instead of the correct assignment operator .

  • In pseudocode, what is wrong with generateusername[firstname, last_name]?

    It uses square brackets instead of parentheses for a function call.

  • In pseudocode, what is wrong with FUNCTION generateusername(firstname STRING, last_name STRING)?

    It is missing the colon between each parameter name and its data type.

  • Why is CALL Main a syntax error when the procedure is named main()?

    Procedure names are case-sensitive, and the parentheses are missing. It should be CALL main().

  • Why is IF length > 0 OR width > 0 THEN a logic error when validating dimensions?

    The check allows one value to be negative, which is not valid. It should use AND instead of OR.

  • Why is area ← width - length a logic error?

    It subtracts instead of multiplying to find the area. It should be area ← length * width.

  • When does testing take place?

    During the testing stage of the program development life cycle, once the program has been written and compiled.

  • Which errors are usually detected during compilation?

    Syntax errors.

  • What does testing focus on?

    Checking for logic errors, unexpected behaviour, and operational integrity.

  • When should a test plan be created?

    During the analysis stage.

  • What does a test plan outline?

    The test cases and the expected results.

  • Define dry run.

    A dry run is where you manually trace through the code, for example on paper, to predict the output and track the variables.

  • Define walkthrough.

    A walkthrough is a step-by-step review of the code with others, to identify issues early.

  • What is the difference between white-box and black-box testing?

    White-box testing tests the internal logic and code structure, and the tester knows how the program works. Black-box testing tests the inputs and expected outputs without knowing the internal workings.

  • Define integration testing.

    Integration testing checks that different modules or components work correctly together.

  • What is the difference between alpha and beta testing?

    Alpha testing is performed in-house by the developers during early testing. Beta testing is carried out by external users in real-world environments.

  • Define acceptance testing.

    Acceptance testing is the final check to ensure the program meets the original client requirements.

  • Define stub testing.

    Stub testing uses temporary modules, called stubs, to simulate missing components during early testing.

  • What is suitable test data?

    Data that is specially chosen to test the functionality of a program or design.

  • Test data is specially chosen to test the                            of a program or design.

    Test data is specially chosen to test the functionality of a program or design.

  • Name the three categories of test data.

    Normal, abnormal, and extreme or boundary.

  • Define normal test data.

    Normal test data is data that should be accepted by the program.

  • Define abnormal test data.

    Abnormal test data is data that is the wrong data type.

  • Define boundary test data.

    Boundary data, also called extreme data, tests values at the edges of what the system accepts.

  • What two kinds of value does boundary testing include?

    The maximum and minimum acceptable values, and the values just outside those limits.

  • True or False?

    Boundary testing only uses values that the system accepts.

    False.

    It uses the maximum and minimum acceptable values and also the values just outside those limits.

  • An age field accepts values from 12 to 18.

    What are the boundary values?

    12 and 18, the limits themselves. Both should be accepted.

  • An age field accepts values from 12 to 18.

    What are the values just outside the boundary?

    11 and 19, the unacceptable values either side. Both should be rejected.

  • True or False?

    Entering 19 into an age field that accepts 12 to 18 is normal test data.

    False.

    19 is boundary or extreme data, just outside the upper limit, and should be rejected.

  • An age field accepts values from 12 to 18.

    Give an example of abnormal test data.

    A letter or symbol such as H or @, because it is the wrong data type and should be rejected.

  • What is done with the results of testing?

    They are compared to the expected results to check the program works as intended, and are stored in the test plan.

  • Define program maintenance.

    Program maintenance is the process of updating or improving a program after it has been delivered to the user.

  • Program maintenance happens            the program has been delivered to the user.

    Program maintenance happens after the program has been delivered to the user.

  • True or False?

    Programs wear out over time like physical equipment.

    False.

    Unlike physical equipment, programs do not wear out. They may still need changing due to errors, changing requirements, or new technology.

  • Name three reasons maintenance is needed.

    To fix errors that were missed during testing, to improve performance based on user feedback, and to adapt the software to new uses or platforms.

  • Name the three types of program maintenance.

    Corrective, perfective and adaptive.

  • Define corrective maintenance.

    Corrective maintenance fixes bugs or errors found during real-world use.

  • Define perfective maintenance.

    Perfective maintenance improves performance or adds small enhancements.

  • Define adaptive maintenance.

    Adaptive maintenance modifies the program to support new environments or requirements.

  • Perfective maintenance improves performance based on user                 .

    Perfective maintenance improves performance based on user feedback.

  • What is the difference between corrective and perfective maintenance?

    Corrective maintenance fixes bugs or errors, whereas perfective maintenance improves performance or adds enhancements to code that already works.

  • True or False?

    Adaptive maintenance fixes bugs found in real-world use.

    False.

    Corrective maintenance fixes bugs. Adaptive maintenance modifies the program to support new environments or requirements.

  • A bug causes a program to crash when special characters are entered.

    Which type of maintenance fixes it?

    Corrective maintenance.

  • A loading screen is replaced with a progress bar.

    Which type of maintenance is this?

    Perfective maintenance, because it gives the user better feedback.

  • A desktop-only program is modified to work on a tablet.

    Which type of maintenance is this?

    Adaptive maintenance.

  • Why might a program need maintenance even if no bugs are found?

    Because requirements can change or new technology appears, so the program may need adapting or improving.

Sign up to unlock flashcards

or