0

"How do we detect semantic errors of a software application? Is it possible to eliminate all possible errors of a software application?"

Sakun Chamikara
  • 41
  • 1
  • 1
  • 4

1 Answers1

0

A compiler will by necessity cover syntactic errors.

Semantic errors are much more difficult to address.

Many languages have lint facilities.

Lint-like tools are especially useful for interpreted languages like JavaScript and Python. Because such languages lack a compiling phase that displays a list of errors prior to execution, the tools can also be used as simple debuggers for common errors (e.g. syntactic discrepancies) as well as hard-to-find errors such as heisenbugs (drawing attention to suspicious code as "possible errors"). Lint-like tools generally perform static analysis of source code.

You may want to examine the concept of Correctness.

In theoretical computer science, correctness of an algorithm is asserted when it is said that the algorithm is correct with respect to a specification. Functional correctness refers to the input-output behavior of the algorithm (i.e., for each input it produces the expected output)

In practice, it is not possible to eliminate all semantic errors. For example, both

j = i + 1

and

i = i + 1

are correct syntactically in several different languages. In the proper context, they are also correct, semantically speaking. But the programmer may have intended one but not the other. The detection of that intention, and whether it is detectable, is at the very heart of program correctness.

rajah9
  • 11,645
  • 5
  • 44
  • 57