What is Program Comprehension in Software Engineering

Program Comprehension

A programmer's ability to understand what a computer program's source code performs is known as program comprehension. The comprehension of a program is commonly disregarded in computer science training in favor of studying the mechanics and syntax of the computer language being taught. Writing intelligible code, on the other hand, is a universal requirement, independent of the computer language used. The algorithm and logic behind a programmer's library or piece of code can easily be lost if no one can figure out what it does thereafter. It's becoming more typical for programmers to be unable to comprehend their own code, which is frequently not written in a clear and intuitive manner.

Strategies for Program Comprehension:

Programmers can utilize one of two basic ways to increase program understanding, each with its own set of benefits and cons. The first technique is to add documentation to code during or after it is written, and the second method is to develop code with a focus on structure. Most programmers benefit from a combination of the two ways; however, some coders favor one strategy over the other. The programmer's preference for which method to use is a personal one, but any attempt to clarify code is preferable to none.

Adding Documentation:

The first way, adding documentation to code, is the easier of the two, and when done effectively, it can be a very valuable crutch for a programmer who is unfamiliar with the language in which the code is written. To aid with program comprehension, most computer languages have a distinct documentation style. If code documentation is well written, a novice programmer's initial step can be to read all of the documentation and comments to have a better idea of how the program works without having to read any of the code. Rather than relying on code syntax and mechanics, the programmer may see what's going on in plain language and then tie the text to exactly what's going on at any given time. Programmers, on the other hand, must be careful while adding documentation to code.

Writing code with an emphasis on structure:

When a programmer writes code with a focus on structure, he or she thinks that any other maintainers looking at the code would have a similar understanding of the language's syntax and mechanics. This is a reasonable assumption in some cases, but it cannot always be depended upon. Comprehending programs based primarily on the structure is conceivable, but it necessitates substantially more effort on the part of the original programmer. Everything must be consistent, including the mechanics and grammar of the language, as well as all stylistic conventions. When writing code in this manner, a programmer must always keep in mind that what is obvious to him may not be obvious to others.

Post a Comment

Previous Post Next Post