Code peer review is a critical quality assurance process that ensures the correctness, reliability, maintainability, and compliance of software to engineering and safety standards. In NASA's software projects, peer review plays an integral role in identifying and resolving issues related to coding practices, logic errors, adherence to requirements, and compliance with standards such as NASA-STD-8739.8, NPR 7150.2
Swerefn
refnum
083
, and other coding guidelines.
When more than 20% of the code is not subjected to peer review, the likelihood of undetected software defects increases, posing significant risks to mission success. This is especially critical for safety-critical, real-time, or embedded software, where defects can have catastrophic consequences. Peer review is one of the most cost-effective ways to identify issues early in the software development process. Skipping or inadequately performing this step escalates the risk of downstream defects, rework, delays, and potential mission failures.
1.2 Key Risks
1. Increased Defect Density
Issue: Without peer review, defects such as logic errors, algorithm inefficiencies, or non-compliance with coding standards remain undetected.
Risk to Program:
Defects manifest in testing or operations, leading to rework, schedule slips, or mission-critical faults.
Hidden defects propagate and increase cost as they emerge later in the development lifecycle.
2. Non-Compliance with Standards
Issue: Code that bypasses peer review may not adhere to NASA-required standards like NASA-STD-8739.8, MISRA, or other mission-specific guidelines.
Risk to Program:
Non-compliance is flagged during audits or milestone reviews, forcing late-stage fixes and potentially delaying the program.
System safety and reliability are jeopardized because of inconsistencies in safety-critical software components.
3. Logical and Design Flaws
Issue: Without a second set of eyes, logical flaws or architectural issues in code can go unnoticed.
Risk to Program:
Critical algorithms or interfaces fail, causing unpredictable or unsafe system behavior.
Late discovery of architectural flaws triggers costly redesigns and integration issues in downstream phases.
4. Inconsistencies in Implementation
Issue: Developers may unknowingly duplicate functionality or use inconsistent approaches without peer feedback.
Risk to Program:
Code becomes harder to maintain and increases the risk of introducing unintended side effects during updates.
Monitor and report on peer review coverage as part of development metrics:
Track the percentage of code reviewed and defects detected during those reviews.
Highlight projects or teams that fall below the defined 80% review threshold and take corrective measures.
8. Include Peer Reviews in Agile/Scrum Workflows
Incorporate peer reviews as part of every sprint or increment deliverable:
Use tools like Git, GitHub, Bitbucket, or others for pull-request-based peer reviews.
Make sure small, iterative code changes are consistently reviewed.
9. Establish Continuous Improvement Practices
Encourage the review process to evolve:
Incorporate lessons learned to improve future reviews.
Gather team feedback on how reviews can be made more efficient and impactful.
10. Conduct Independent Verification and Validation (IV&V)
Partner with NASA’s IV&V Facilities to validate the thoroughness of peer reviews:
Use IV&V findings to identify gaps in peer review practices.
Have IV&V teams complement peer reviews, especially for high-risk, safety-critical systems.
Consequences of Ignoring Risks
High Defect Introduction:
Code defects propagate through testing and into operational systems, resulting in catastrophic failures or rework costs.
Non-Compliance with Standards:
The program is flagged during audits for not meeting peer review thresholds, delaying certification processes.
Increased Cost of Fixes:
Defects identified later in the development lifecycle are exponentially more expensive to fix.
Erosion of Confidence:
Stakeholder confidence in software quality diminishes due to poorly reviewed and unreliable software.
Mission Failures:
Defects in critical systems (e.g., avionics, fault tolerance) lead to degraded mission performance or failure, with safety and reliability risks.
Conclusion:
Code peer reviews are a cornerstone of software quality in NASA projects, ensuring early defect detection, adherence to standards, and maintainability. Failing to peer-review at least 80% of the code introduces unnecessary risks to system reliability, safety, and mission success. By defining clear policies, leveraging tools and training, and fostering a peer review culture, projects can address this risk, ensuring that software meets the stringent demands of NASA missions. Ensuring that all safety-critical and real-time systems are thoroughly reviewed is non-negotiable for success.
Div
id
tabs-2
Div
id
tabs-3
3. Resources
3.1 References
refstable-topic
Show If
group
confluence-users
Panel
titleColor
red
title
Instructions for Editors
Expand
For references to be used in the Risk pages they must be coded as "Topic R999" in the SWEREF page. See SWEREF-083 for an example.
Enter the necessary modifications to be made in the table below:
SWEREFs to be added
SWEREFS to be deleted
SWEREFs called out in text: 083,
SWEREFs NOT called out in text but listed as germane: