作者:empty 页数:100 出版社:empty |
FOREWORDThe Software Engie ering Laboratory(SEL) is an organization sponsored by theNational Aeronautics and Space Administration/Goddard SpaceFlight Center(NASA/GSFC) and created to investigate the effectiveness of software engineeringtechnologies when applied to the development of applications software.TheSE Lwas created in 1976 and has three primary organizational members:The goals of theSE L are(1) to understand the software development process in theGSFC environment; (2) to measure the effect of various methodologies, tools, andmodels on the process; and(3) to identify and then to apply successful developmentpractices.The activities, findings, and recommendations of theSE L are recorded inthe Software Engineering Laboratory Series, a continuing series of reports thatincludes this document.The major contributors to this document areMany people in both the Software Engineering Branch at NASA/GSFC and in theSoftware Engineering Operation at CSC reviewed this document and contributed theirexperiences toward making it a useful tool for Flight Dynamics Division personnel.Single copies of this document can be obtained by writing to
ABSTRACTThis document discusses recommended practices and style for programmers using theC language in the Flight Dynamics Division environment.Guidelines are based ongenerally recommended software engineering techniques, industry resources, and localconvention.The Guide offers preferred solutions to common C programming issuesand illustrates through examples of C code.
Introductioncomments.The guidelines are intended to help you write code that can be easily read,understood, and maintainedEncapsulation and information hiding techniques can help you write better organizedand maintainable code.Encapsulation means grouping related elements.You canInformation hiding refers to controlling the visi bilt y(or scope) of programelements.You can use C constructs to control the scope of functions and data.ForSoftware engineering principles are discussed and illustratedKey concepts are highlighted.Code examples are provided to illustrate good practices
INTRODUCTION
Purpose.
1.2Audience.
1.3 Approach.
READABILITY AND MAINTAINABILITY
2.1Encapsulation and Information Hiding.
2.2WhiteSpace.
Blank Lines.
Standard Names.
2.2.2 Spacing.
2.2.3 Indentation.
Comments.
2.4Meaningful Names.
3.1ProgramFiles.
3.2 README File.
3.3 Standard Libraries.
2.4.2 Variable Names.
2.4.3 Capitalization.
PROGRAM ORGANIZATION
Header Files.
3.5Modules.
3.6Makefiles.
Standard Filename Suffixes.
FILE ORGANIZATION
4.1File Prolog.
4.2Program Algorithm and PDL.
4.3
5.1Function Pro logs.
5.2Function Arguments.
5.3External Variable Declarations.
5.4Inte mal Variable Declarations.
5.5Statement Paragraphing.
Sequence Statements.
Selection Control Statements.
Iteration Control Statements.
Const Modifier.
Statement Placement.
Nested If Statements.
7.3.2 For.
7.3.3Do While.
7.4.2 Break.
4.2.4 Severe Error and Exception Handling Statements.
Include Directive.
4.4Defines and Typedefs.
4.5External Data Declarations and Definitions.
4.6Sequence of Function