Page History
...
| Tabsetup | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Div | | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| refstable | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Show If | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Panel | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Expand |
1. Importance of Coding Standards in NASA ProjectsLongevity of ProjectsNASA programs and projects often span decades across their life cycles, including development, deployment, operation, maintenance, and eventual retirement. During this time:
Key Benefits of Coding StandardsAdhering to coding standards provides significant benefits, particularly in NASA's software development context, where safety, reliability, and security are paramount:
Certification and Critical SoftwareFor NASA’s human-rated and mission-critical hardware, adherence to a recognized coding standard (e.g., MISRA-C, CERT C) and the use of automated static analysis tools are industry best practices. Manual verification of large-scale systems is impractical, making automated verification against coding standards essential to detect vulnerabilities and ensure compliance. 2. General Coding Standard GuidancePlanning for Coding Standards
Key Distinction: Coding Standards vs. Coding Style
Correlation With Defect Prevention
Outsourcing ConsiderationsWhen software development is outsourced, having clear coding standards ensures contractors deliver high-quality code that meets NASA’s requirements. Standards should:
3. Practical Guidelines for Coding StandardsClassification of StandardsCoding standards are commonly classified by:
Essential Coding Standard CoverageStandards should cover the following aspects:
4. Tools and Automated VerificationRole of Automation
Recommendations for Automated Analysis
5. Verification and AssessmentVerification Activities
Training
Legacy and Human-Rated Software
6. Example Standards and References
Documentation of Standards
7. ConclusionThis guidance highlights the essential role of coding methods, standards, and criteria in NASA’s software development processes. Their adoption ensures high-quality, secure, reliable, and maintainable software, critical to mission success. In practice:
See also SWE-023 - Software Safety-Critical Requirements, SWE-157 - Protect Against Unauthorized Access, SWE-185 - Secure Coding Standards Verification, See SWE-087 - Software Peer Reviews and Inspections for Requirements, Plans, Design, Code, and Test Procedures), and assessments of how the coding standards are used to develop the software work products. See also Topic 7.10 - Peer Review and Inspections Including Checklists. See also PAT-022 - Programming Practices Checklist 3.6 Checklists Relevant To LanguagesThe checklists below contain specific checks and things to be aware of in certain languages:
3.7 Additional GuidanceAdditional guidance related to this requirement may be found in the following materials in this Handbook:
3.8 Center Process Asset Libraries
See the following link(s) in SPAN for process assets from contributing Centers (NASA Only).
|
| Div | ||
|---|---|---|
| ||
4. Small ProjectsFor small projects, the scope, budget, and timeline are typically more constrained than large-scale endeavors. However, adhering to coding methods, standards, and criteria is equally critical to ensure software reliability, maintainability, and security. The following simplified guidance is tailored for small projects to streamline the process while maintaining quality and compliance. 1. Start Simple: Use Existing Standards and ToolsLeverage Established Standards
Use Tools for Automation
2. Tailor Standards to Small Project NeedsFocus on Essential Rules
Keep It Lightweight
3. Planning and IntegrationSet Expectations Early
Low Overhead for Compliance
4. Ensure Traceability to Project GoalsAlign With Project Requirements
Traceability Practices
5. Efficient Verification and TestingStatic Code Analysis
Peer Reviews (Lightweight)
6. Security Considerations for Small ProjectsAdopt Secure Coding Practices
Use Minimal Tooling
7. Practical Example for Small ProjectsImagine a small team working on a Python project to control a science instrument. Adopting Standards
Verification Process
Delivering Results
8. Final Recommendations for Small Projects
By following these streamlined recommendations, small projects can effectively apply Requirement 4.4.3, ensuring consistency, reliability, and maintainability without unnecessary overhead. These practices support the successful completion of small-scale development efforts while ensuring compliance with NASA standards and best practices. |
| Div | |||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||||||
5. Resources5.1 References
5.2 Tools
|
| Div | ||||
|---|---|---|---|---|
| ||||
6. Lessons Learned6.1 NASA Lessons LearnedLessons Learned from NASA’s History with Coding StandardsThe NASA Lessons Learned database provides key insights into the importance of coding standards based on prior mission experiences. These lessons underscore the role of coding standards in ensuring maintainability, cost control, and error reduction in projects across the software development lifecycle. The following entries from the database provide critical lessons for implementing coding standards effectively: 1. Software Design for MaintainabilityLesson Number 0838
2. Mars Pathfinder Flight Software Development Process (1997)Lesson Number 0590
3. Static Software Analysis of the NASA Autonomous Flight Termination SoftwareLesson Number 24503
Key Application of Lessons Learned to Small and Large ProjectsThese historical lessons emphasize NASA's ongoing focus on the importance of disciplined and consistent coding practices. Regardless of project size, the following actions should be taken to incorporate these lessons effectively:
Integrating Lessons Learned into Current NASA ProjectsUsing the lessons from past projects, the following procedural steps can help integrate coding standards effectively into NASA projects:
Examples of Common Lessons to Implement in PracticeLesson/Application: For projects reusing code from prior missions:
Lesson/Application: When adopting static analysis tools:
Lesson/Application: Early identification of coding inconsistencies:
Key TakeawaysCombining insights from the NASA Lessons Learned database with modern practices allows project managers to ensure coding standards are not just a set of rules, but a valuable tool for improving software quality, reducing costs, and ensuring mission success. Leveraging these insights will create a robust foundation for the continued success of NASA’s software systems across their extended life cycles. 6.2 Other Lessons LearnedThe Goddard Space Flight Center (GSFC) Lessons Learned online repository
|
| Div | |||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||||||||||||||||||
7. Software Assurance
7.1 Tasking for Software Assurance
7.2 Software Assurance ProductsStatic Analysis of the Source Code
Independent Evaluation of Source Code
Key Deliverables for SA Verification of Code Against Coding Standards
7.3 MetricsEffective metrics support continuous improvement and provide a quantitative way to track adherence to coding standards and resolution of issues. Recommended Metrics for Coding Standards
Reference:For additional metric-related guidance, see Topic 8.18: SA Suggested Metrics. 7.4 Updated GuidanceTask 1: Understand and Familiarize With Project Coding Standards
Task 2: Perform Independent Static Code Analysis
7.5 Recommendations for Success
By rigorously implementing and independently verifying adherence to coding standards, software assurance ensures that the project minimizes risks, improves maintainability, and upholds NASA’s emphasis on delivering high-quality software systems. 7.6 Additional GuidanceAdditional guidance related to this requirement may be found in the following materials in this Handbook:
|
| Div | ||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||
8. Objective Evidence
|
SWEREFs called out in text: 006, 007, 161, 197, 278, 326, 476, 477, 510, 526
SWEREFs NOT called out in text but listed as germane: 077, 162, 199
Related Links Pages
Children Display
5.2 Tools
| Div | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||
6. Lessons Learned6.1 NASA Lessons LearnedThe NASA Lessons Learned database contains the following lessons learned related to coding standards:
6.2 Other Lessons LearnedNo other Lessons Learned have currently been identified for this requirement. |
| Div | ||||
|---|---|---|---|---|
| ||||
7. Software AssuranceExcerpt Include | | SWE-061 - Coding Standards | SWE-061 - Coding Standards | |
| Panel | ||||
| ||||
| Include Page | SITE:SWE-061 - SA Task1 | SITE:SWE-061 - SA Task1 | ||
| Include Page | SITE:SWE-061 - SA Task2 | SITE:SWE-061 - SA Task2 |
| Note | ||
|---|---|---|
| ||
|
| title | Definition of objective evidence |
|---|
7.3 Metrics
- # of coding standard violations identified (Open, Closed, type of violation, Severity)
- # of software process Non-Conformances by life cycle phase over time
See also Topic 8.18 - SA Suggested Metrics
7.4 Guidance
Task 1: Review the project software development/management plan to learn what kind of software coding standards, methods, rules, and principles are used for the project. The coding standards could include any project-defined standards that dictate the safe use of code, secure coding standards, reliability coding standards, etc. They may also include a set of “principles” or best practices that have been collected for particular software applications, such as principles for developing flight software. These coding standards and principles are reviewed by software assurance during the development and selection of the project processes, as per SWE-013 - Software Plans. After becoming familiar with these standards, practices, and principles, analyze the software code using the static analyzers' results to help determine whether these standards, methods, and principles are being used consistently. Any risks or issues should be brought up with project management.
Task 2: Software assurance will perform independent static code analysis on the coding standard practices, methods rules, and principles. They should review the results of the static code analysis runs to determine whether the project's coding standards, etc., are being followed. Results should be reported to the project management at the end of the analysis. Information on code standard usage, static code analysis tools, their effectiveness, and the developers’ responses to the results should also be shared with the project management.
7.5 Additional Guidance
Additional guidance related to this requirement may be found in the following materials in this Handbook:


