Computer Science

Logical Error

A logical error is a mistake in the program's logic that causes it to behave unexpectedly or produce incorrect results. It is a type of programming error that occurs when the code does not follow the intended logic or algorithm. Logical errors are difficult to detect and fix because the program may still run without crashing.

Written by Perlego with AI-assistance

3 Key excerpts on "Logical Error"

  • Instant Approach to Software Testing
    eBook - ePub

    Instant Approach to Software Testing

    Principles, Applications, Techniques, and Practices

    16 ]. Introduction of errors in a software program is subject to human mistakes and can be classified as follows:
    • Logical Error: Missing or inadequate or unclear interpretation in the source code.
    • Message error: Compiler error messages for the source code that are misinterpreted.
    • Navigation error: Moving from one function to another function is not correctly coded.
    • System error: Memory leak, hardware, and operating system related errors.
    • Incorrect requirements: Incorrect or wrong requirements.
    • Performance error: Anything related to the performance leads to performance error.
    • Data error: Incorrect data update in the database due to wrong data types used.
    • Database error: Improper normalization of database schema/design.
    • Standards: Standards not followed like improper exception handling, improper coding/design standards.
    • Incorrect design: Wrong or incorrect design.
    • Typographical error: Grammatical/lexical mistake in documents/source code.
    • Comments: Comments in the source code are not properly mentioned.
    • Variable declaration error: Wrong declaration/usage of variables in the source code, mismatch in data types of variables.
    • Boundary value analysis error: Boundary conditions are not coded properly.
    • Complexity error:
  • Foundations of Computing
    eBook - ePub

    Foundations of Computing

    Essential for Computing Studies, Profession And Entrance Examinations - 5th Edition

    • Pradeep K. Sinha, Priti Sinha(Authors)
    • 2022(Publication Date)
    • BPB Publications
      (Publisher)
    Hence, it does not produce any error message for a logic error. Therefore, identifying logic errors in a program is the responsibility of the program development and testing team. The testing procedure involves running the program to process input test data, and comparing the obtained results with the known correct results. If the results obtained for the test data do not match with the known correct results, most likely the program contains one or more logic errors. Logic errors are typically due to either missing logic or incorrect logic. If the logic is incorrect, the results obtained for the test data will be wrong. These errors are the easiest of the logic errors to find. Errors caused by missing logic result from logical situations that the programmer did not think of while planning/writing the program. For example, let us assume that an arithmetic process uses a numeric field and the data entry operator has entered a non-numeric value in it. The program logic should determine that the data is not numeric before attempting the arithmetic process. If this logic is missing, the program will fail when the arithmetic process encounters non-numeric data. This type of logic error can be difficult to find. This error will occur only when a user enters nonnumeric data in a numeric field. Users may use the program for weeks, months, or years before this happens and the error in program logic shows up. Debugging a Program for Syntax Errors Both syntax and logic errors are known as bugs and the process of locating and correcting these errors is known as debugging. As compared to logic errors, syntax errors are easier to locate and correct because almost all language processors detect syntax errors automatically. When a language processor processes the source code of a program, it indicates on the source listing of the program each program statement having one or more syntax errors, and gives hints regarding the nature of the error
  • BCS Glossary of Computing
    • Arnold Burdett, Dan Bowen, Diana Butler, Aline Cumming, Frank Hurvid, Adrian Jackson, John Jaworski, Percy Mett, Thomas Ng, Penny Patterson, Marianne Scheer, Hazel Shaw, Alfred Vella, John Woollard, David Fuller(Authors)
    • 2016(Publication Date)
    The programmer follows the instructions from the listing, adding a new line to the trace table each time an instruction is executed. The new line of the trace table should indicate the instruction, either by its machine address or by its line number, and show any changes to the variables. See Figure C6.1. Error including: bug, error message, listing file, execution error, run-time error, compilation error, linking error, syntax error, statement syntax error, program syntax error, structure error, Logical Error is a fault or mistake in a program or information system causing it to produce wrong results or not to work. A bug is a fault in a program that causes errors. Most computers attempt to indicate the likely source of an error by producing error messages. Usually these messages are produced either on the user’s screen, if the error is attributed to the user, or on the operator’s console for more serious errors. When a program is being developed, many simple errors will be detected during the compilation process. A listing file can be generated during compilation; this will contain the source program with error messages and other diagnostic information. The many types of error can be classified as follows: Execution errors or run-time errors are errors detected during program execution. These errors, such as overflow and division by zero, can occur if a mistake is made in the processing algorithm or as a result of external effects not catered for by the program, such as lack of memory or unusual data. Compilation errors are errors detected during compilation and are usually syntax errors (see below). Linking errors occur when a compiled program is linked to library routines
Index pages curate the most relevant extracts from our library of academic textbooks. They’ve been created using an in-house natural language model (NLM), each adding context and meaning to key research topics.