nerdexam
(ISC)2

CSSLP · Question #82

Which of the following secure coding principles and practices defines the appearance of code listing so that a code reviewer and maintainer who have not written that code can easily understand it?

The correct answer is C. Use a consistent coding style. Using a consistent coding style is a secure coding principle that ensures code readability and ease of understanding for code reviewers and future maintainers.

Secure Software Implementation

Question

Which of the following secure coding principles and practices defines the appearance of code listing so that a code reviewer and maintainer who have not written that code can easily understand it?

Options

  • AMake code forward and backward traceable
  • BReview code during and after coding
  • CUse a consistent coding style
  • DKeep code simple and small

How the community answered

(40 responses)
  • A
    3% (1)
  • B
    10% (4)
  • C
    85% (34)
  • D
    3% (1)

Why each option

Using a consistent coding style is a secure coding principle that ensures code readability and ease of understanding for code reviewers and future maintainers.

AMake code forward and backward traceable

Making code forward and backward traceable connects code to requirements and design, but it doesn't primarily define the visual appearance or immediate understandability of the code listing itself.

BReview code during and after coding

Reviewing code during and after coding is a process or activity of secure development, not a principle that defines the appearance or structure of the code itself.

CUse a consistent coding styleCorrect

A consistent coding style, encompassing aspects like naming conventions, indentation, and comment structure, significantly enhances the readability and understandability of source code. This practice is crucial for effective peer review and for allowing maintainers who did not write the code to quickly grasp its logic and purpose, which directly contributes to identifying and preventing vulnerabilities.

DKeep code simple and small

Keeping code simple and small is a general principle for reducing complexity and potential vulnerabilities, but it is a broader architectural and design guideline rather than specifically defining the 'appearance of code listing' for easy understanding.

Concept tested: Secure coding - consistent coding style

Topics

#Secure coding principles#Coding style#Code readability#Code maintainability

Community Discussion

No community discussion yet for this question.

Full CSSLP Practice