Advantages Using Sloc Software Metric Examples
8 Product- and Process- Metrics. The advantage of SLOC. Manner, with which programming language, and how many SLOC a software. Source lines of code. Source lines of code (SLOC), also known as lines of code (LOC), is a software metric used to measure the size of a computer program by counting the number of lines in the text of the program's source code.
Ramones More Unreleased Tracks Rare. Source lines of code (LOC, SLOC, KLOC, LLOC) Project Code Meter Source lines of code Source lines of code (SLOC or LOC) is a software metric used to measure the size of a software program by counting the number of lines in the text of the program's source code. SLOC is typically used to predict the amount of effort that will be required to develop a program, as well as to estimate programming productivity or effort once the software is produced. Measurement methods There are two major types of SLOC measures: physical SLOC (LOC) and logical SLOC ().
Specific definitions of these two measures vary, but the most common definition of physical SLOC is a count of lines in the text of the program's source code including comment lines. Blank lines are also included unless the lines of code in a section consists of more than 25% blank lines. In this case blank lines in excess of 25% are not counted toward lines of code.
Logical LOC attempts to measure the number of 'statements', but their specific definitions are tied to specific computer languages (one simple logical LOC measure for C-like programming languages is the number of statement-terminating semicolons). It is much easier to create tools that measure physical SLOC, and physical SLOC definitions are easier to explain. However, physical SLOC measures are sensitive to logically irrelevant formatting and style conventions, while is less sensitive to formatting and style conventions. Unfortunately, SLOC measures are often stated without giving their definition, and logical LOC can often be significantly different from physical SLOC.
Consider this snippet of C code as an example of the ambiguity encountered when determining SLOC. 000100 IDENTIFICATION DIVISION. 000200 PROGRAM-ID. 000* 000500 ENVIRONMENT DIVISION. 000600 CONFIGURATION SECTION. 000700 SOURCE-COMPUTER. 000800 OBJECT-COMPUTER.
Examenes Matematicas 1 Eso Anaya Download on this page. 000 DATA DIVISION. 001100 FILE SECTION. 000 PROCEDURE DIVISION.
100 MAIN-LOGIC SECTION. 100300 BEGIN. 100400 DISPLAY ' ' LINE 1 POSITION 1 ERASE EOS. 100500 DISPLAY 'Hello world!'
LINE 15 POSITION 10. 100600 STOP RUN. 100700 MAIN-LOGIC-EXIT. Lines of code: 5 (excluding whitespace) Lines of code: 17 (excluding whitespace) Another increasingly common problem in comparing SLOC metrics is the difference between auto-generated and hand-written code. Modern software tools often have the capability to auto-generate enormous amounts of code with a few clicks of a mouse. For instance, GUI builders automatically generate all the source code for a GUI object simply by dragging an icon onto a workspace. The work involved in creating this code cannot reasonably be compared to the work necessary to write a device driver, for instance.
By the same token, a hand-coded custom GUI class could easily be more demanding than a simple device driver; hence the shortcoming of this metric. There are several cost, schedule, and effort estimation models which use SLOC as an input parameter, including the widely-used series of models by Barry Boehm et al., PRICE Systems True S and Galorath's SEER-SEM.
While these models have shown good predictive power, they are only as good as the estimates (particularly the SLOC estimates) fed to them. Example According to Vincent Maraia [1 ], the SLOC values for various operating systems in Microsoft's Windows NT product line are as follows: Year Operating System SLOC (Million) 1993 Windows NT 3.1 4-5 [1 ] 1994 Windows NT 3.5 7-8 [1 ] 1996 Windows NT 4.0 11-12 [1 ] 2000 Windows 2000 more than 29 [1 ] 2001 Windows XP 40 [1 ] 2003 Windows Server 2003 50 [1 ] David A. Wheeler studied the Red Hat distribution of the Linux operating system, and reported that Red Hat Linux version 7.1 (released April 2001) contained over 30 million physical SLOC. He also extrapolated that, had it been developed by conventional proprietary means, it would have required about 8,000 person-years of development effort and would have cost over $1 billion (in year 2000 U.S. A similar study was later made of Debian Linux version 2.2 (also known as 'Potato'); this version of Linux was originally released in August 2000.