Syntax Error
Logical Error
Runtime Error
Testing & Debugging
Testing Quality Attributes
100

When does a syntax error occur?

Syntax errors occur when a mistake is made in the language rules or sentence structure of the programming language.

100

Can a program run with a logical error?

Yes, the program can run, but it may give wrong or unexpected results.

100

Is a runtime error the same as a syntax error?

No, a syntax error occurs when the code is written incorrectly, while a runtime error happens when the program is running.

100

What does testing ensure in software development?

Testing ensures that the software behaves as expected, is reliable, and meets user requirements.

100

Why is Stability important in software, and what does it ensure?

Stability ensures that if an error occurs, it does not cause serious or irreversible damage to the software, maintaining the system's robustness.

200

What are some very common mistakes that lead to syntax errors?

Missing Semicolons, Misspelled Keywords, Mismatched Parentheses

200

Can changing variable values help fix a logical error?

Yes, adjusting variable values or how they are used in the program can fix a logical error, especially if they’re involved in wrong calculations or conditions.



200

What causes a runtime error?

Common causes include dividing by zero, accessing invalid memory, or using incorrect input.

200

public class Main {

    public static void main(String[] args) {

        int num = 5;

        if (num > 0)

            System.out.println("Positive number")

        else

            System.out.println("Non-positive number");

    }

}


public class Main {

    public static void main(String[] args) {

        int num = 5;

        if (num > 0) {

            System.out.println("Positive number");  

        } else {

            System.out.println("Non-positive number");

        }

    }

}


200

What does the quality attribute "Reliability" refer to in software testing?

Reliability is the likelihood that the software will run without crashing under certain conditions for a specified period.

300

What is a syntax error, and how does it differ from a logical error?

A syntax error breaks the code structure; a logical error runs but gives wrong results,

300

Is testing the program enough to find logical errors?

No, while testing helps, careful code review and debugging are also necessary to find and fix logical errors.

300

Can runtime errors be detected before the program runs?

No, runtime errors happen while the program is running, so they can’t be detected during the coding phase.

300

What are the steps of testing?

Step 1. Creating a set of test cases

Step 2. Running the program with each test case

Step 3. Checking that the performance of the software is as expected.

300

How should software handle input and output to ensure good Usability?

To ensure good Usability, the software should allow flexible user input and produce output that is clear, well-structured, and easy to interpret.

400

How can extra or missing brackets cause a syntax error?

It breaks the code’s structure, leading to confusion for the compiler.

400

How can incorrect calculations happen due to a logical error?

A logical error in the code can lead to incorrect operations or wrong conditions, causing the program to calculate the wrong result.

400

What is a runtime error?

A runtime error occurs when a program crashes or behaves unexpectedly while it’s running.

400

public class AverageCalculator {

    public static void main(String[] args) {

        int num1 = 10;

        int num2 = 20;

        int num3 = 30;


        int sum = num1 + num2;

        int average = sum / 3;

        

        System.out.println("The average is: " + average);

    }

}


public class AverageCalculator {

    public static void main(String[] args) {

        int num1 = 10;

        int num2 = 20;

        int num3 = 30;


        int sum = num1 + num2 + num3;

        int average = sum / 3;

        

        System.out.println("The average is: " + average);

    }

}


400

How is Maintainability defined as a quality attribute in software?

Maintainability is how easily the software can be debugged, updated, or expanded without causing additional issues.

500

What happens if you forget a semicolon at the end of a statement in languages like Java or C?

It causes a syntax error, as the compiler expects it.

500

Can you identify a logical error by looking at the program’s output?

Yes, logical errors often produce incorrect or unexpected results, which can help identify them.

500

What is a "division by zero" error?

This happens when the program tries to divide a number by zero, which is mathematically undefined and causes the program to crash.

500

Why is debugging essential in software development?

Debugging ensures that software is reliable, efficient, and functions correctly.

500

How does Portability affect a software’s ability to run on different systems?

Portability allows software to be easily adapted for different systems, enhancing its compatibility with various devices and operating systems.