Read Microsoft Word - USC_Read_Me.doc text version

------------------------------------------------------------------------------------------------------------

INSTRUCTIONS FOR USING THE CodeCount TOOLS

----------------------------------------------------------------------------------------------------------GENERAL INFORMATION: CodeCount Software is a set of tools that will count the number of lines of code found within a set of programming language specific source code files. The input to each tool is a file, '*_list.dat', that contains the full directory/path and file name specification for each source code file to be analyzed. Each of the files contained in the input file will be accessed with READONLY privileges. Also input to each tool is a file, '*_lines_environment.dat', that contains user defined parameters to adjust the processing during execution of the tool. This environment file must be located in the same directory as the executable of the tool. The output of each tool may be found in the file '*_outfile.dat'. Error messages will be output to the terminal screen and written to the '*_outfile.dat' output file during execution. The '*' prefix for all of the aforementioned filenames is programming language dependent. Below are the prefixes and their associated CodeCount tool:

CodeCount tool name ada_lines asm_1750A_lines or asm_pss_1750A_lines c_lines cbl_lines for_lines java_lines jov_lines pas_lines pl1_lines Prefix to use ada asm c cbl for java jov pas pl1 Example ada_list.dat asm_outfile.dat c_lines_environment.dat cbl_list.dat for_list.dat java_lines_environment.dat jov_outfile.dat pas_outfile.dat pl1_outfile.dat Example (MS DOS) ada_lst.dat asm_outfile.dat c_env.dat cbl_lst.dat for_lst.dat java_env.dat jov_outfile.dat pas_outfile.dat pl1_outfile.dat

Information pertaining to the line of code counting definition, installation procedures, and execution procedures for each of the individual tools is given in the following sections. Information pertaining to the user defined parameters may be found as trailer commentation in the respective '*_lines_environment.dat' files.

Copyright (C) 1998 University of Southern California Center for Software Engineering Salvatori 330, 941 West 37th Place, Los Angeles, California 90089-0781, USA This document is part of a software package that is free with limitations: you can redistribute it and/or modify it under the terms of the USC-CSE Limited Public License as published by the University of Southern California Center for Software Engineering; either version 1 of the License, or (at your option) any later version. This document is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the USC-CSE Limited Public License for more details. You should have received a copy of the USC-CSE Limited Public License along with this document; if not, write to the University of Southern California Center for Software Engineering Salvatori 330, 941 West 37th Place, Los Angeles, California 90089-0781, USA.

INSTRUCTIONS FOR USING THE CodeCount TOOLS

----------------------------------------------------------------------------------------------------------BASIC ASSUMPTIONS: o Files that contain Ada source code shall have a `.A', '.ADB', or '.ADA' file extension. Files without these file extensions are considered to be data files. The names of files are read/accessed without case sensitivity. The file version number and ';' when absent shall result in the highest version of that file to be analyzed. o Files that contain Mil-Std-1750A Assembly source code shall have a '.ASM' or '.IEE' file extension. This program does not check for these file extensions. The names of files are read/accessed without case sensitivity. The file version number and ';' when absent shall result in the highest version of that file to be analyzed. o Files that contain C/C++ source code shall have a '.C', '.CC', '.CPP', or '.H' file extension. Files without these file extensions are considered to be data files. The names of files are read/accessed without case sensitivity. The file version number and ';' when absent shall result in the highest version of that file to be analyzed. o Files that contain COBOL (ANSI X.3.23-1985) source code or other variants shall have a '.CBL' file extension. Files without these file extensions are considered to be data files. The names of files are read/accessed without case sensitivity. The file version number and ';' when absent shall result in the highest version of that file to be analyzed. o Files that contain FORTRAN 77 (ANSI X.3.9-1978) or earlier variants shall have a '.F', '.FOR', or '.F77' file extension. Files that contain FORTRAN 90 (ISO/IEC 1539-1:1996) or later variants shall have a '.F90', or '.F95' file extension. Files that contain High Performance FORTRAN shall have a '.HPF' file extension. Files without these file extensions are considered to be data files. The names of files are read/accessed without case sensitivity. The file version number and ';' when absent shall result in the highest version of that file to be analyzed. o Files that contain JAVA source code shall have a '.JAVA' or `.JAV' file extension. Files without these file extensions are considered to be data files. The names of files are read/accessed without case sensitivity. The file version number and ';' when absent shall result in the highest version of that file to be analyzed.

© 1998 USC-CSE. See full notice on first page.

Page 2 of 19

INSTRUCTIONS FOR USING THE CodeCount TOOLS

o Files that contain JOVIAL (J73) source code shall have a '.JOV' or '.J73' file extension. This program does not check for these file extensions. The names of files are read/accessed without case sensitivity. The file version number and ';' when absent shall result in the highest version of that file to be analyzed. o Files that contain PASCAL (ANSI/IEEE X3J9-81-093) source code have a '.PAS' file extension. Files without this file extension are considered to be data files. The names of files are read/accessed without case sensitivity. The file version number and ';' when absent shall result in the highest version of that file to be analyzed. o Files that contain PL/I (ANSI X3.56-1976) source code or other variants have a 'P##', 'PLI', 'PL1', 'PLC', or 'PLM' file extension. Files without these file extensions are considered to be data files. The names of files are read/accessed without case sensitivity. The file version number and ';' when absent shall result in the highest version of that file to be analyzed. o Files that contain RTL source code shall have a '.MIC' file extension. Files without this extension are considered to be data files. The names of files are read/accessed without case sensitivity. The file version number and ';' when absent shall result in the highest version of that file to be analyzed. o Files that contain VRTL source code shall have a '.vrtl' file extension. Files without this file extension are considered to be data files. The names of files are read/accessed without case sensitivity. The file version number and ';' when absent shall result in the highest version of that file to be analyzed. o Data files contain only blank lines and data lines. o A Deliverable Source Instruction (DSI) is defined to be the number of physical lines (terminated by a carriage return or EOLN character) which contain program instructions created by project personnel and processed into machine code by some combination of preprocessors, compilers, and assemblers. It excludes comment cards and unmodified utility software. It includes job control language (compiler directive), format statements, and data declarations (data lines). INSTRUCTIONS are defined as lines of code or card images. Thus, a line containing two or more source statements count as one instruction; a five line data declaration counts as five instructions. The DSI definition was selected due to (1) compatibility with a variety of parametric software cost modeling tools, (2) programming language syntax independence, and (3) ability to support software metrics. o The input file contains physical lines terminated by an EOLN character and are of length less than the internal constant `MAX_LINE_LENGTH'.

© 1998 USC-CSE. See full notice on first page. Page 3 of 19

INSTRUCTIONS FOR USING THE CodeCount TOOLS

o A Tab character will be replaced with a blank character upon input. o A FormFeed character will be replaced with a blank character upon input. o A blank line is defined to be any physical line of code which contains only blank, TAB, or Form Feed characters prior to the occurrence of a carriage return (EOLN). o The contents of any programming language specific character literals shall be overwritten with a special character prior to the search for comments so as not to interfere with the search for comment delimiters or other characters. This is required due to character literals and string literals being designated with different delimiters. o A comment is defined to be of two possible classifications, whole or embedded. A whole line comment is defined as any string of characters which follow the programming language specific comment delimiter and as such do not exist on the same physical line of code with any compilable language source code. Continuation of a whole line comment may continue over multiple non-blank physical lines of the file until a suitable comment delimiter has been found which may terminate that specific comment string. An embedded comment is defined as any comment string which co-exists with compilable language source code on the same physical line of the file. In this manner, multiple embedded comments could exist on one physical line intermixed with portions of compilable language source code. Each occurrence of an embedded comment as delineated via suitable comment delimiters shall be counted as separate embedded comments. The contents of embedded comments shall be blanked so as to not interfere with the search for keywords or other language specific literals. o The contents of any programming language specific string literals shall be overwritten with a special character so as to not interfere with the search for keywords or other language specific delimiters. o A compiler directive is classified as any physical line of code which contains one of the specified programming language compilation directive keywords as found within the internal constant 'DIRR_NAME_LIST'. Continuation of the compiler directive over multiple physical lines of the file will increment the DSI count accordingly until a physical line is determined to be of another classification. A blank line or comment (whole or embedded) will not cause the re-classification of a continuation of an compiler directive line.

© 1998 USC-CSE. See full notice on first page.

Page 4 of 19

INSTRUCTIONS FOR USING THE CodeCount TOOLS

o A data line as found within the source file is defined to be any physical line of code which contains one of the programming language specific data keywords as found within the internal constant 'DATA_NAME_LIST'. Continuation of the data line over multiple physical lines of the file will increment the DSI count accordingly until a physical line is determined to terminate. A data line as found within the data file is defined to be any physical line of code which is not a blank line. o An executable line as found within the source file is defined to be any physical line of code which has not been classified as a blank line whole comment line, directive line, data line, or continuation thereof. Continuation of the executable line over multiple physical lines of the file will increment the DSI count accordingly until a physical line is determined to be of another classification, e.g. directive or data line. A blank line or comment (whole or embedded) will not cause the re-classification of a continuation of an executable line. An executable line shall not exist within a data file. o The total sizing of analyzed source code files in terms of the DSI count contains the highest degree of confidence. However, the sizing data pertaining to the subclassifications (compiler directives, data declarations, executable instructions) has a somewhat lower level of confidence associated with them. Misclassifications of subclassifications of SLOC may occur due to (1) user modifications to the tool, (2) syntax and semantic enhancements to the parsed programming language, (3) exotic usage of parsed programming language constructs, and (4) integrity of the host platform execution environment. Additionally, in some programming languages a single SLOC may contain attributes of both a data declaration and an executable instruction simultaneously. These occurrences represent events beyond the control of the CodeCount tool designer and may cause the inclusive parsing capabilities of the tool to missclassify a particular SLOC. For these reasons, the counts of subclassifications should be regarded as an approximation and not as a precise count. In all cases, the sum of the subclassifications should equal the total DSI count, else an error message will be output from the tool. o The search for any programming language specific keywords over a physical line of code for purposes of incrementing the tally of occurrences shall include the detection of multiple keywords of the same type and multiple keywords of different types on the same physical line of code. Keywords found within comments (whole or embedded) or string literals shall not be included in the tally count.

© 1998 USC-CSE. See full notice on first page.

Page 5 of 19

INSTRUCTIONS FOR USING THE CodeCount TOOLS

o Target keywords that are being searched for may have any character other than 'A'..'Z', 'a'..'z', '0'..'9', '_' or '$' following it. A space (blank) is needed in front of the target and the absence of one of the characters above rules out the possibility of an identifier (e.g. "READer"). For this reason, the characters which are contained in the 'special' set are to be blanked prior to the search for the keywords. This will ensure that a space will proceed the keyword. The contents of 'special' should not include characters which are involved in search mechanisms which are executed following the elimination of the 'special' characters. o Targets which appear in the 'NAME_LISTs which are multiple words may have any amount (greater than one) of spaces (blanks) separating the component words.

© 1998 USC-CSE. See full notice on first page.

Page 6 of 19

INSTRUCTIONS FOR USING THE CodeCount TOOLS

----------------------------------------------------------------------------------------------------------INSTALLATION PROCEDURES: 1. Copy the source code file of the appropriate CodeCount tool to your working directory and edit as follows. 2. Set the `TARGET_REVISION' constant to the appropriate symbol to reflect the host platform environment that the CodeCount tool will execute upon. The current setting reflects a generic platform. 3. (optional) Set the `DIRR_PREFIX' constant to the appropriate symbol to reflect the platform/language specific symbol that is used to indicate a compiler directive. Also, update the compiler directive prefix symbol for every entry in the `DIRR_NAME_LIST' constant. Absence of the `DIRR_PREFIX' constant indicates that the specific CodeCount tool does not require this constant and so this step of the Installation Procedure may be skipped. 4. If user modifications to the CodeCount source code file have been made, enter a description of the change in the section labeled `PROJECT UPDATES & REVISIONS'. Set the `PROJECT_REVISION' constant to reflect the latest revision number. 5. Compile/Link the CodeCount tool using an ANSI-C compliant compiler. 6. Copy the associated '*_lines_environment.dat' file to the same working directory. 7. Edit the '*_lines_environment.dat' file to set the user definable parameters. These parameters include the name of the program/project that will be associated with the source code to be counted, along with other numeric quantities. A default value will be used in place of any incorrect numeric values read from this file. NOTE: If case sensitivity is enabled (Compare_Spec = 1), then the case of each entry contained within `DIRR_NAME_LIST', `DATA_NAME_LIST', and `EXEC_NAME_LIST' must be adjusted in compliance with the prevailing coding standard for the source code to be analyzed. NOTE: Determine whether a Physical or Logical SLOC definition is desired and set the SLOC_DEF parameter accordingly. 8. Proceed to EXECUTION PROCEDURES.

© 1998 USC-CSE. See full notice on first page.

Page 7 of 19

INSTRUCTIONS FOR USING THE CodeCount TOOLS

----------------------------------------------------------------------------------------------------------EXECUTION PROCEDURES: 1. Create the file '*_list.dat' file. This file contains a list of each source file containing software to be counted. The format of this file is one filename (complete directory/path description) per physical line. The '*_list.dat' file may be created by using one of the following commands (here, the C/C++ CodeCount tool is used as an example) : UNIX: ls -1 *.c>c_list.dat

VAX VMS: Directory/noheading/notrailer/col=1/output=c_list.dat *.c

MS-DOS dir/B >c_list.dat *.c 2. Execute the CodeCount tool. A progress message may periodically appear on the terminal screen during execution. Error messages will appear on the terminal screen when abnormalities have been detected during execution. The duration of execution will be dependent upon the size and number of source files to be counted and the prevailing loading of the host platform. 3. An output file '*_outfile.dat' is created and contains the output and any error messages generated during execution of the tool. 4. A temporary file 'temp_file.dat' will appear during execution of the 'jov_lines' tool. This file is deleted during normal exit of the tool.

© 1998 USC-CSE. See full notice on first page.

Page 8 of 19

INSTRUCTIONS FOR USING THE CodeCount TOOLS

----------------------------------------------------------------------------------------------------------ERROR MESSAGES: "ERROR, unable to open *_outfile.dat file" 1. The CodeCount tool is unable to open/create the output file. Check the privileges associated with file create for that directory. "ERROR, unable to open *_list.dat file" 1. '*_list.dat' file does not exist in the current directory. 2. '*_list.dat' file privileges prevent readonly access. "ERROR, unable to read *_list.dat file" 1. '*_list.dat' file is an empty file. 2. '*_list.dat' file is not in the correct format. "ERROR, truncated an entry of the *_list file" 1. The '*_list.dat' file contains a filename of length greater than 'MAX_LIST_FILENAME_LENGTH' constant. Increase the value of the 'MAX_LIST_FILENAME_LENGTH' constant, then re-compile the tool. Since the input file cannot be accessed, the CodeCount tool will abort parsing of this file and proceed to the next source file specified in '*_list.dat' file. "ERROR, unable to open *_lines_environment file" 1. '*_lines_environment.dat' file does not exist in the current directory. 2. '*_lines_environment.dat' file privileges prevent readonly access. "ERROR, error in reading *_lines_environment file" 1. '*_lines_environment.dat' file contents is corrupted. 2. A numeric value contained within the '*_lines_environment.dat' file exceed predefined bounds causing the default value to be used. "ERROR, unable to access the file -> <filename>" 1. The input file does not exist at the directory/path location. 2. The directory/path specified is incorrect. 3. The directory/path location does not permit readonly access to files. "ERROR, truncated a line of <filename>" OR "ERROR, truncated a line of the file -> <filename>" 1. The input file contains a line of length less than or equal to the `MAX_LINE_LENGTH' constant, but is also greater than the `Line_Length' parameter within the `*_lines_environment.dat' file. Increase the numerical value of the `Line_Length' parameter. To prevent DSI counting errors, the CodeCount tool will abort parsing this file and proceed to the next source file specified in '*_list.dat'. For UNIX

© 1998 USC-CSE. See full notice on first page.

Page 9 of 19

INSTRUCTIONS FOR USING THE CodeCount TOOLS

systems, try using the following Korn shell command to correct for missing EOLN symbols. tr -d ^M "\r" <filename "ERROR, EOLN not detected in <filename>" OR "ERROR, EOLN not detected in file -> <filename>" 1. The input file contains a line of length greater than the `MAX_LINE_LENGTH' constant. Increase the numerical value of the `MAX_LINE_LENGTH' constant and re-compile the tool. To prevent DSI counting errors, the CodeCount tool will abort parsing this file and proceed to the next source file specified in '*_list.dat'. For UNIX systems, try using the following Korn shell command to correct for missing EOLN symbols. tr -d ^M "\r" <filename "ERROR, unable to open temp_file.dat" 1. The current directory/path location does not permit creation of files. "ERROR, Physical SLOC counting error in <filename>" OR "ERROR, Physical SLOC counting error in the following file" 1. Internal CodeCount tool logic has incorrectly processed source code within the input file. 2. The input file does not contain compilable source code resulting in misinterpretation of the source language constructs. "ERROR, Logical SLOC counting error in <filename>" OR "ERROR, Logical SLOC counting error in the following file" 1. Internal CodeCount tool logic has incorrectly processed source code within the input file. 2. The input file does not contain compilable source code resulting in misinterpretation of the source language constructs. "ERROR, unable to perform the calculation" 1. Internal CodeCount tool logic has incorrectly processed source code within the input file. 2. Erroneous operands have been detected prior to performing a math calculation that will result in a run-time error. "ERROR, processing error detected in Search function" 1. A call to the Search function was made with erroneous input data. This may be caused by user modifications to the CodeCount tool.

© 1998 USC-CSE. See full notice on first page.

Page 10 of 19

INSTRUCTIONS FOR USING THE CodeCount TOOLS

ADA_Lines

FILE EXTENSIONS : Files that contain Ada source code shall have a `.A', '.ADB', or '.ADA' file extension. Files without these file extensions are considered to be data files. The names of files are read/accessed without case sensitivity. The file version number and ';' when absent shall result in the highest version of that file to be analyzed. DATA FILES : Data files shall contain only blank lines and data lines. Data lines shall be counted using the physical SLOC definition. SOURCE FILES : Source code files may contain blank lines, comment lines (whole or embedded), compiler directives, data lines, or executable lines. Source code files to be analyzed shall have previously been compiled successfully to ensure the integrity of the inclusive syntax. SLOC DEFINITION : The primary definitions for a Source Line of Code (SLOC) include the physical SLOC and the logical SLOC. The physical SLOC definition uses the Deliverable Source Instruction (DSI) concept. The logical SLOC definition is highly dependent upon the structure of the programming language to be parsed by the CodeCount tool. PHYSICAL SLOC : The number of physical SLOCs within a source file is defined to be the sum of the number of physical SLOCs (terminated by a carriage return or EOLN character) which contain program instructions created by project personnel and processed into machine code by some combination of preprocessors, compilers, interpreters, and/or assemblers. It excludes comment cards and unmodified utility software. It includes job control language (compiler directive), format statements, and data declarations (data lines). Instructions are defined as lines of code or card images. Thus, a line containing two or more source statements count as one physical SLOC; a five line data declaration counts as five physical SLOCs. The physical SLOC definition was selected due to (1) compatibility with parametric software cost modeling tools, (2) ability to support software metrics collection, and (3) programming language syntax independence. LOGICAL SLOC : The number of logical SLOC within a source file is defined to be the sum of the number of logical SLOCs classified as compiler directives, data lines, or executable lines. It excludes comments (whole or embedded) and blank lines. Thus, a line containing two or more source statements count as multiple logical SLOCs; a single logical statement that extends over five physical lines count as one logical SLOC. Specifically, the logical SLOC found within a file containing software written in the Ada programming language may be computed by counting number of non-literal (terminal) semicolons within the file. The count of semicolons should include pragmas (LRM 2.8), declarations (LRM 3), and statements (LRM 5). Semicolons found within comments and character string literals shall be excluded. Comments and blank lines are by definition excluded from the SLOC count. The logical SLOC definition was selected due to (1) compatibility with parametric software cost modeling tools, and (2) ability to support software metrics collection. The logical SLOC count is susceptible to erroneous output when the analyzed source code file contains software that uses overloading or replacement characters for a few key symbols, e.g., ';' .

© 1998 USC-CSE. See full notice on first page.

Page 11 of 19

INSTRUCTIONS FOR USING THE CodeCount TOOLS

ASM_PSS_1750A_Lines

FILE EXTENSIONS : Files that contain Mil-Std-1750A Assembly source code shall have a '.ASM' or '.IEE' file extension. This program does not check for these file extensions. The names of files are read/accessed without case sensitivity. The file version number and ';' when absent shall result in the highest version of that file to be analyzed. DATA FILES : Data files shall contain only blank lines and data lines. Data files shall have a '.DAT' file extension. Files without this extension are considered to be source code files. Data files shall be counted using the physical SLOC definition. A data line as found within the data file is defined as any physical line of code which is not a blank line and shall be output under the heading of 'Assembler Directives'. SOURCE FILES : Source code files may contain blank lines, comment lines (whole or embedded), assembler directives, macro definitions, and assembly lines. Source code files to be analyzed shall have previously been assembled successfully to ensure the integrity of the inclusive syntax. Specifically, source code files shall be formatted using the Mil-Std-1750A Assembly Language syntax style as required for input to the Mil-Std-1750A Assembler, version SJ-04.022, produced by: Proprietary Software Systems (PSS), Inc. 429 Santa Monica Blvd Suite 430 Santa Monica, CA 90401 SLOC DEFINITION : The primary definitions for a Source Line of Code (SLOC) include the physical SLOC and the logical SLOC. The physical SLOC definition uses the Deliverable Source Instruction (DSI) concept. The logical SLOC definition is highly dependent upon the structure of the programming language to be parsed by the CodeCount tool. PHYSICAL SLOC : The number of physical SLOCs within a source file is defined to be the sum of the number of physical SLOCs (terminated by a carriage return or EOLN character) which contain program instructions created by project personnel and processed into machine code by some combination of preprocessors, compilers, interpreters, and/or assemblers. It excludes comment cards and unmodified utility software. It includes job control language (compiler directive), format statements, and data declarations (data lines). Instructions are defined as lines of code or card images. Thus, a line containing two or more source statements count as one physical SLOC; a five line data declaration counts as five physical SLOCs. The physical SLOC definition was selected due to (1) compatibility with parametric software cost modeling tools, (2) ability to support software metrics collection, and (3) programming language syntax independence. LOGICAL SLOC : The number of logical SLOC within a source file is defined to be the sum of the number of logical SLOCs classified as compiler directives, data lines, or executable lines. It excludes comments (whole or embedded) and blank lines. Thus, a line containing two or more source statements count as multiple logical SLOCs; a single logical statement that extends over five physical lines count as one logical SLOC. Specifically, the logical SLOC found within a file containing software written in the Mil-Std-1750A is (1) equivalent to the physical lines less the number of physical continuation lines for source code files that use the PSS Mil-Std format. The logical SLOC definition was selected due to (1) compatibility with parametric software cost modeling tools, and (2) ability to support software metrics collection. The logical SLOC count is susceptible to erroneous output when the analyzed source code file contains software that uses overloading or replacement characters for a few key symbols, e.g., ';' .

© 1998 USC-CSE. See full notice on first page.

Page 12 of 19

INSTRUCTIONS FOR USING THE CodeCount TOOLS

C_Lines

FILE EXTENSIONS : Files that contain C/C++ source code shall have a '.C', '.CC', '.CPP', or '.H' file extension. Files without these file extensions are considered to be data files. The names of files are read/accessed without case sensitivity. The file version number and ';' when absent shall result in the highest version of that file to be analyzed. DATA FILES : Data files shall contain only blank lines and data lines. Data lines shall be counted using the physical SLOC definition. SOURCE FILES : Source code files may contain blank lines, comment lines (whole or embedded), compiler directives, data lines, or executable lines. Source code files to be analyzed shall have previously been compiled successfully to ensure the integrity of the inclusive syntax. SLOC DEFINITION : The primary definitions for a Source Line of Code (SLOC) include the physical SLOC and the logical SLOC. The physical SLOC definition uses the Deliverable Source Instruction (DSI) concept. The logical SLOC definition is highly dependent upon the structure of the programming language to be parsed by the CodeCount tool. PHYSICAL SLOC : The number of physical SLOCs within a source file is defined to be the sum of the number of physical SLOCs (terminated by a carriage return or EOLN character) which contain program instructions created by project personnel and processed into machine code by some combination of preprocessors, compilers, interpreters, and/or assemblers. It excludes comment cards and unmodified utility software. It includes job control language (compiler directive), format statements, and data declarations (data lines). Instructions are defined as lines of code or card images. Thus, a line containing two or more source statements count as one physical SLOC; a five line data declaration counts as five physical SLOCs. The physical SLOC definition was selected due to (1) compatibility with parametric software cost modeling tools, (2) ability to support software metrics collection, and (3) programming language syntax independence. LOGICAL SLOC : The number of logical SLOC within a source file is defined to be the sum of the number of logical SLOCs classified as compiler directives, data lines, or executable lines. It excludes comments (whole or embedded) and blank lines. Thus, a line containing two or more source statements count as multiple logical SLOCs; a single logical statement that extends over five physical lines count as one logical SLOC. Specifically, the logical SLOC found within a file containing software written in the C/C++ programming language may be computed by summing together the count of (1) the number of terminal semicolons, (2) the number of end block statements, i.e., '}', (3) the number of IF and FOR statements that do not have a block statement structure, and (4) the number of logical compiler directives. The logical SLOC definition was selected due to (1) compatibility with parametric software cost modeling tools, and (2) ability to support software metrics collection. The logical SLOC count is susceptible to erroneous output when the analyzed source code file contains software that uses overloading or replacement characters for a few key symbols, e.g., ';' .

© 1998 USC-CSE. See full notice on first page.

Page 13 of 19

INSTRUCTIONS FOR USING THE CodeCount TOOLS

CBL_Lines

FILE EXTENSIONS : Files that contain COBOL (ANSI X3.23-1985) source code or other variants shall have a '.CBL' file extension. Files without these file extensions are considered to be data files. The names of files are read/accessed without case sensitivity. The file version number and ';' when absent shall result in the highest version of that file to be analyzed. DATA FILES : Data files shall contain only blank lines and data lines. Data lines shall be counted using the physical SLOC definition. SOURCE FILES : Source code files may contain blank lines, comment lines (whole or embedded), Identification Division lines, Environment Division lines, Data Division lines, or Procedure Division lines. Source code files to be analyzed shall have previously been compiled successfully to ensure the integrity of the inclusive syntax. SLOC DEFINITION : The primary definitions for a Source Line of Code (SLOC) include the physical SLOC and the logical SLOC. The physical SLOC definition uses the Deliverable Source Instruction (DSI) concept. The logical SLOC definition is highly dependent upon the structure of the programming language to be parsed by the CodeCount tool. PHYSICAL SLOC : The number of physical SLOCs within a source file is defined to be the sum of the number of physical SLOCs (terminated by a carriage return or EOLN character) which contain program instructions created by project personnel and processed into machine code by some combination of preprocessors, compilers, interpreters, and/or assemblers. It excludes comment cards and unmodified utility software. It includes job control language (compiler directive), format statements, and data declarations (data lines). Instructions are defined as lines of code or card images. Thus, a line containing two or more source statements count as one physical SLOC; a five line data declaration counts as five physical SLOCs. The physical SLOC definition was selected due to (1) compatibility with parametric software cost modeling tools, (2) ability to support software metrics collection, and (3) programming language syntax independence. LOGICAL SLOC : The number of logical SLOC within a source file is defined to be the sum of the number of logical SLOCs classified as compiler directives, data lines, or executable lines. It excludes comments (whole or embedded) and blank lines. Thus, a line containing two or more source statements count as multiple logical SLOCs; a single logical statement that extends over five physical lines count as one logical SLOC. Specifically, the logical SLOC found within a file containing software written in the COBOL programming language may be computed by summing together the count of the logical SLOC found within each of the four COBOL main program divisions, i.e., Identification, Environment, Data, and Procedure. The logical SLOC definition was selected due to (1) compatibility with parametric software cost modeling tools, and (2) ability to support software metrics collection. The logical SLOC count is susceptible to erroneous output when the analyzed source code file contains software that uses overloading or replacement characters for a few key symbols, e.g., ';' .

© 1998 USC-CSE. See full notice on first page.

Page 14 of 19

INSTRUCTIONS FOR USING THE CodeCount TOOLS

FOR_Lines

FILE EXTENSIONS : Files that contain FORTRAN 77 (ANSI X.3.9-1978) or earlier variants shall have a '.F', '.FOR', or '.F77' file extension. Files that contain FORTRAN 90 (ISO/IEC 15391:1996) or later variants shall have a '.F90', or '.F95' file extension. Files that contain High Performance FORTRAN shall have a '.HPF' file extension. Files without these file extensions are considered to be data files. The names of files are read/accessed without case sensitivity. The file version number and ';' when absent shall result in the highest version of that file to be analyzed. DATA FILES : Data files shall contain only blank lines and data lines. Data lines shall be counted using the physical SLOC definition. SOURCE FILES : Source code files may contain blank lines, comment lines (whole or embedded), compiler directives, data lines, or executable lines. Source code files to be analyzed shall have previously been compiled successfully to ensure the integrity of the inclusive syntax. SLOC DEFINITION : The primary definitions for a Source Line of Code (SLOC) include the physical SLOC and the logical SLOC. The physical SLOC definition uses the Deliverable Source Instruction (DSI) concept. The logical SLOC definition is highly dependent upon the structure of the programming language to be parsed by the CodeCount tool. PHYSICAL SLOC : The number of physical SLOCs within a source file is defined to be the sum of the number of physical SLOCs (terminated by a carriage return or EOLN character) which contain program instructions created by project personnel and processed into machine code by some combination of preprocessors, compilers, interpreters, and/or assemblers. It excludes comment cards and unmodified utility software. It includes job control language (compiler directive), format statements, and data declarations (data lines). Instructions are defined as lines of code or card images. Thus, a line containing two or more source statements count as one physical SLOC; a five line data declaration counts as five physical SLOCs. The physical SLOC definition was selected due to (1) compatibility with parametric software cost modeling tools, (2) ability to support software metrics collection, and (3) programming language syntax independence. LOGICAL SLOC : The number of logical SLOC within a source file is defined to be the sum of the number of logical SLOCs classified as compiler directives, data lines, or executable lines. It excludes comments (whole or embedded) and blank lines. Thus, a line containing two or more source statements count as multiple logical SLOCs; a single logical statement that extends over five physical lines count as one logical SLOC. Specifically, the logical SLOC found within a file containing software written in the FORTRAN 77 programming language is equivalent to the number of physical lines less the number of physical continuation lines. The logical SLOC found within a file containing software written in the FORTRAN 90 programming language may be computed by (1) counting the number of separator semicolons, i.e., nonterminal semicolons used to separate multiple logical statements on the same physical line, (2) adding the number of physical lines, (3) subtracting the number of physical continuation lines, then (4) subtracting the number of physical lines that only contain the following keywords USE, CYCLE, CASE, CONTAINS, PUBLIC, PRIVATE, ELSE, END INTERFACE, END TYPE, END CASE, END IF, END DO, END SELECT, END WHERE, END SUBROUTINE, END FUNCTION, END PROGRAM, and END MODULE. The logical SLOC definition was selected due to (1) compatibility with parametric software cost modeling tools, and (2) ability to support software metrics collection. The logical SLOC count is susceptible to erroneous output when the analyzed source code file contains software that uses overloading or replacement characters for a few key symbols, e.g., ';' .

© 1998 USC-CSE. See full notice on first page.

Page 15 of 19

INSTRUCTIONS FOR USING THE CodeCount TOOLS

JAVA_Lines

FILE EXTENSIONS : Files that contain JAVA source code shall have a '.JAVA' or `.JAV' file extension. Files without these file extensions are considered to be data files. The names of files are read/accessed without case sensitivity. The file version number and ';' when absent shall result in the highest version of that file to be analyzed. DATA FILES : Data files shall contain only blank lines and data lines. Data lines shall be counted using the physical SLOC definition. SOURCE FILES : Source code files may contain blank lines, comment lines (whole or embedded), compiler directives, data lines, or executable lines. Source code files to be analyzed shall have previously been compiled successfully to ensure the integrity of the inclusive syntax. SLOC DEFINITION : The primary definitions for a Source Line of Code (SLOC) include the physical SLOC and the logical SLOC. The physical SLOC definition uses the Deliverable Source Instruction (DSI) concept. The logical SLOC definition is highly dependent upon the structure of the programming language to be parsed by the CodeCount tool. PHYSICAL SLOC : The number of physical SLOCs within a source file is defined to be the sum of the number of physical SLOCs (terminated by a carriage return or EOLN character) which contain program instructions created by project personnel and processed into machine code by some combination of preprocessors, compilers, interpreters, and/or assemblers. It excludes comment cards and unmodified utility software. It includes job control language (compiler directive), format statements, and data declarations (data lines). Instructions are defined as lines of code or card images. Thus, a line containing two or more source statements count as one physical SLOC; a five line data declaration counts as five physical SLOCs. The physical SLOC definition was selected due to (1) compatibility with parametric software cost modeling tools, (2) ability to support software metrics collection, and (3) programming language syntax independence. LOGICAL SLOC : The number of logical SLOC within a source file is defined to be the sum of the number of logical SLOCs classified as compiler directives, data lines, or executable lines. It excludes comments (whole or embedded) and blank lines. Thus, a line containing two or more source statements count as multiple logical SLOCs; a single logical statement that extends over five physical lines count as one logical SLOC. Specifically, the logical SLOC found within a file containing software written in the JAVA programming language may be computed by summing together the count of (1) the number of terminal semicolons, (2) the number of end block statements, i.e., '}', (3) the number of IF and FOR statements that do not have a block statement structure, and (4) the number of logical compiler directives. The logical SLOC definition was selected due to (1) compatibility with parametric software cost modeling tools, and (2) ability to support software metrics collection. The logical SLOC count is susceptible to erroneous output when the analyzed source code file contains software that uses overloading or replacement characters for a few key symbols, e.g., ';' .

© 1998 USC-CSE. See full notice on first page.

Page 16 of 19

INSTRUCTIONS FOR USING THE CodeCount TOOLS

JOV_Lines

FILE EXTENSIONS : Files that contain JOVIAL (J73) source code shall have a '.JOV' or '.J73' file extension. This program does not check for these file extensions. The names of files are read/accessed without case sensitivity. The file version number and ';' when absent shall result in the highest version of that file to be analyzed. DATA FILES : Data files shall contain only blank lines and data lines. This program does not process data files as they are not defined for the JOVIAL programming language. SOURCE FILES : Source code files may contain blank lines, comment lines (whole or embedded), compiler directives, data lines, or executable lines. Source code files to be analyzed shall have previously been compiled successfully to ensure the integrity of the inclusive syntax. SLOC DEFINITION : The primary definitions for a Source Line of Code (SLOC) include the physical SLOC and the logical SLOC. The physical SLOC definition uses the Deliverable Source Instruction (DSI) concept. The logical SLOC definition is highly dependent upon the structure of the programming language to be parsed by the CodeCount tool. PHYSICAL SLOC : The number of physical SLOCs within a source file is defined to be the sum of the number of physical SLOCs (terminated by a carriage return or EOLN character) which contain program instruction created by project personnel and processed into machine code by some combination of preprocessors, compilers, interpreters, and/or assemblers. It excludes comment cards and unmodified utility software. It includes job control language (compiler directive), format statements, and data declarations (data lines). Instructions are defined as lines of code or card images. Thus, a line containing two or more source statements count as one physical SLOC; a five line data declaration counts as five physical SLOCs. The physical SLOC definition was selected due to (1) compatibility with parametric software cost modeling tools, (2) ability to support software metrics collection, and (3) programming language syntax independence. LOGICAL SLOC : The number of logical SLOC within a source file is defined to be the sum of the number of logical SLOCs classified as compiler directives, data lines, or executable lines. It excludes comments (whole or embedded) and blank lines. Thus, a line containing two or more source statements count as multiple logical SLOCs; a single logical statement that extends over five physical lines count as one logical SLOC. Specifically, the logical SLOC found within a file containing software written in the JOVIAL programming language may be computed by counting number of non-literal (terminal) semicolons within the file. The logical SLOC definition was selected due to (1) compatibility with parametric software cost modeling tools, and (2) ability to support software metrics collection. The logical SLOC count is susceptible to erroneous output when the analyzed source code file contains software that uses overloading or replacement characters for a few key symbols, e.g., ';' .

© 1998 USC-CSE. See full notice on first page.

Page 17 of 19

INSTRUCTIONS FOR USING THE CodeCount TOOLS

PAS_Lines

FILE EXTENSIONS : Files that contain PASCAL (ANSI/IEEE X3J9-81-093) source code have a '.PAS' file extension. Files without this file extension are considered to be data files. The names of files are read/accessed without case sensitivity. The file version number and ';' when absent shall result in the highest version of that file to be analyzed. DATA FILES : Data files shall contain only blank lines and data lines. Data lines shall be counted using the physical SLOC definition. SOURCE FILES : Source code files may contain blank lines, comment lines (whole or embedded), compiler directives, data lines, or executable lines. Source code files to be analyzed shall have previously been compiled successfully to ensure the integrity of the inclusive syntax. SLOC DEFINITION : The primary definitions for a Source Line of Code (SLOC) include the physical SLOC and the logical SLOC. The physical SLOC definition uses the Deliverable Source Instruction (DSI) concept. The logical SLOC definition is highly dependent upon the structure of the programming language to be parsed by the CodeCount tool. PHYSICAL SLOC : The number of physical SLOCs within a source file is defined to be the sum of the number of physical SLOCs (terminated by a carriage return or EOLN character) which contain program instruction created by project personnel and processed into machine code by some combination of preprocessors, compilers, interpreters, and/or assemblers. It excludes comment cards and unmodified utility software. It includes job control language (compiler directive), format statements, and data declarations (data lines). Instructions are defined as lines of code or card images. Thus, a line containing two or more source statements count as one physical SLOC; a five line data declaration counts as five physical SLOCs. The physical SLOC definition was selected due to (1) compatibility with parametric software cost modeling tools, (2) ability to support software metrics collection, and (3) programming language syntax independence. LOGICAL SLOC : The number of logical SLOC within a source file is defined to be the sum of the number of logical SLOCs classified as compiler directives, data lines, or executable lines. It excludes comments (whole or embedded) and blank lines. Thus, a line containing two or more source statements count as multiple logical SLOCs; a single logical statement that extends over five physical lines count as one logical SLOC. Specifically, the logical SLOC found within a file containing software written in the PASCAL programming language may be computed by (1) counting the number of separator semicolons, (2) adding the number of occurrences of PASCAL statements that did not terminate with the optional separator semicolon, e.g., RECORD, IF, FOR, WHILE, CASE (executable only), REPEAT, and WITH, and (3) adding the number of occurrences of PASCAL statements that did not terminate with the optional separator semicolon due to proceeding a PASCAL keyword acting as a statement separator, e.g., ELSE, UNTIL, and END. The BEGIN/END pair does not contribute to the logical SLOC count. The logical SLOC definition was selected due to (1) compatibility with parametric software cost modeling tools, and (2) ability to support software metrics collection. The logical SLOC count is susceptible to erroneous output when the analyzed source code file contains software that uses overloading or replacement characters for a few key symbols, e.g., ';' .

© 1998 USC-CSE. See full notice on first page.

Page 18 of 19

INSTRUCTIONS FOR USING THE CodeCount TOOLS

PL/I_Lines

FILE EXTENSIONS : Files that contain PL/I (ANSI X3.56-1976) source code or other variants have a 'P##', 'PLI', 'PL1', 'PLC', or 'PLM' file extension. Files without these file extensions are considered to be data files. The names of files are read/accessed without case sensitivity. The file version number and ';' when absent shall result in the highest version of that file to be analyzed. DATA FILES : Data files shall contain only blank lines and data lines. Data lines shall be counted using the physical SLOC definition. SOURCE FILES : Source code files may contain blank lines, comment lines (whole or embedded), compiler directives, data lines, or executable lines. Source code files to be analyzed shall have previously been compiled successfully to ensure the integrity of the inclusive syntax. SLOC DEFINITION : The primary definitions for a Source Line of Code (SLOC) include the physical SLOC and the logical SLOC. The physical SLOC definition uses the Deliverable Source Instruction (DSI) concept. The logical SLOC definition is highly dependent upon the structure of the programming language to be parsed by the CodeCount tool. PHYSICAL SLOC : The number of physical SLOCs within a source file is defined to be the sum of the number of physical SLOCs (terminated by a carriage return or EOLN character) which contain program instructions created by project personnel and processed into machine code by some combination of preprocessors, compilers, interpreters, and/of assemblers. It excludes comment cards and unmodified utility software. It includes job control language (compiler directive), format statements, and data declarations (data lines). Instructions are defined as lines of code or card images. Thus, a line containing two or more source statements count as one physical SLOC; a five line data declaration counts as five physical SLOCs. The physical SLOC definition was selected due to (1) compatibility with parametric software cost modeling tools, (2) ability to support software metrics collection, and (3) programming language syntax independence. LOGICAL SLOC : The number of logical SLOC within a source file is defined to be the sum of the number of logical SLOCs classified as compiler directives, data lines, or executable lines. It excludes comments (whole or embedded) and blank lines. Thus, a line containing two or more source statements count as multiple logical SLOCs; a single logical statement that extends over five physical lines count as one logical SLOC. Specifically, the logical SLOC found within a file containing software written in the PL/I programming language may be computed by summing together the count of (1) the number of terminal semicolons, (2) the number of terminal commas contained within a DECLARE (DCL) statement, and (3) the number of logical compiler directives that do not terminate with a terminal semicolon, i.e., JCL directives. The logical SLOC definition was selected due to (1) compatibility with parametric software cost modeling tools, and (2) ability to support software metrics collection. The logical SLOC count is susceptible to erroneous output when the analyzed source code file contains software that uses overloading or replacement characters for a few key symbols, e.g., ';' .

© 1998 USC-CSE. See full notice on first page.

Page 19 of 19

Information

Microsoft Word - USC_Read_Me.doc

19 pages

Report File (DMCA)

Our content is added by our users. We aim to remove reported files within 1 working day. Please use this link to notify us:

Report this file as copyright or inappropriate

551118


You might also be interested in

BETA
NIH SF424 R&R Application Guide for Adobe Forms Version B - 06/18/2012
Microsoft Word - USC_Read_Me.doc
Minerals Law of Mongolia_english_.doc