comp.lang.ada
 help / color / mirror / Atom feed
* Assy/Ada SLOC ratio;What's an  Ada SLOC?
@ 1992-10-09 21:30 Paul Byrley
  0 siblings, 0 replies; 8+ messages in thread
From: Paul Byrley @ 1992-10-09 21:30 UTC (permalink / raw)


Two questions:
First, what do you experts count for Ada SLOC?  I thought total
semicolons but now am hearing "semicolons EXCEPT for ...".  I
would appreciate opinions from lots of people who have Ada
experience.  I will send summary out to net when results are in.

Second, what ratio do you experts use when estimating the no.
of assembly lines of code to make an Ada SLOC (as you defiined
it in answering my first question).  I would hope to get data
on the "group" of assembly code which performed a certain 
operation or function vs the SLOC for the Ada to perform the
same operation or function.  I don't think line for line assy to
Ada translation would help much.  Please try to tell me the domain
you work in and the number of lines of code (not just the ratio).

I can use the answer for the first question without the second, but
not the reverse.

Thank you very much

Paul Byrley
BYRLEY@NTSC-RD.NAVY.MIL

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Assy/Ada SLOC ratio;What's an Ada SLOC?
@ 1992-10-14 12:14 cis.ohio-state.edu!zaphod.mps.ohio-state.edu!darwin.sura.net!aplcen.apl.j
  0 siblings, 0 replies; 8+ messages in thread
From: cis.ohio-state.edu!zaphod.mps.ohio-state.edu!darwin.sura.net!aplcen.apl.j @ 1992-10-14 12:14 UTC (permalink / raw)


In <9210092044.AA05113@ajpo.sei.cmu.edu> byrley@NTSC-RD.NAVY.MIL ("Paul Byrley"
) writes:

>Two questions:
>First, what do you experts count for Ada SLOC?  I thought total
>semicolons but now am hearing "semicolons EXCEPT for ...".  I
>would appreciate opinions from lots of people who have Ada
>experience.  I will send summary out to net when results are in.

Using semicolonss, 

  A := (Flags => (1 => True,
                  2 => False,
                  3 => True,
                  4 => False),
        Coord => (X => Sqrt(F(N)),
                  Y => Cos(Whatever),
                  Z => Compute_Z),
        Left  => Compute_Left_Expression,
        Right => Compute_Right_Expression,
        Name  => Build_Name,
        Etc   => Continue_Aggregate_Assignment);

is ONLY ONE LINE OF CODE!!!???!!!

while
  A.Flags(1) := True;
  A.Flags(2) := False;
  A.Flags(3) := True;
  A.Flags(4) := False;
  A.Coord.X := Sqrt(F(N));
  A.Coord.Y := Cos(Whatever);
  A.Coord.Z := Compute_Z;
  A.Left := Compute_Left_Expression;
  A.Right := Compute_Right_Expression;
  A.Name := Build_Name;
  A.Etc := Continue_Aggregate_Assignment;

is many lines of code!
yet, the first is quite a bit better, requires at least
as much work, and is what experienced Ada developers do.
You cannot forget some of the record this way.

IMHO, any method that depends on semicolons for counting
lines of code is pretty useless.

--Thor
collard@capsrv.jhuapl.edu
dlc@ddsdx2.jhuapl.edu

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Assy/Ada SLOC ratio;What's an  Ada SLOC?
@ 1992-10-14 16:55 Mark A Biggar
  0 siblings, 0 replies; 8+ messages in thread
From: Mark A Biggar @ 1992-10-14 16:55 UTC (permalink / raw)


In article <9210092044.AA05113@ajpo.sei.cmu.edu> byrley@NTSC-RD.NAVY.MIL ("Paul
 Byrley") writes:
>Two questions:
>First, what do you experts count for Ada SLOC?  I thought total
>semicolons but now am hearing "semicolons EXCEPT for ...".  I
>would appreciate opinions from lots of people who have Ada
>experience.  I will send summary out to net when results are in.

For all practical purposes the semicolon count is good enough.  The only
"except for" I've ever thought made sense is not counting the semicolons
on the end of pragmas, but by actual count that is usualy less then 1% of the 
total.  If your generating SLOC number to be fead into cost-estimation tools
using any value with in the nearest 100 sloc is usually good enough.
>
>Second, what ratio do you experts use when estimating the no.
>of assembly lines of code to make an Ada SLOC (as you defiined
>it in answering my first question).  I would hope to get data
>on the "group" of assembly code which performed a certain 
>operation or function vs the SLOC for the Ada to perform the
>same operation or function.  I don't think line for line assy to
>Ada translation would help much.  Please try to tell me the domain
>you work in and the number of lines of code (not just the ratio).

This is highly compiler and CPU archetecture dependent and sould be determined
on a case by case basis by measurement of actual code.

--
Mark Biggar
mab@wdl1.wdl.loral.com

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Assy/Ada SLOC ratio;What's an Ada SLOC?
@ 1992-10-15 12:21 cis.ohio-state.edu!zaphod.mps.ohio-state.edu!darwin.sura.net!mlb.semi.har
  0 siblings, 0 replies; 8+ messages in thread
From: cis.ohio-state.edu!zaphod.mps.ohio-state.edu!darwin.sura.net!mlb.semi.har @ 1992-10-15 12:21 UTC (permalink / raw)


In article <1992Oct14.121432.10919@aplcen.apl.jhu.edu>, dlc@ddsdx2.jhuapl.edu (
Dave Collard x7468) writes:

[...code example deleted...]

|> 
|> IMHO, any method that depends on semicolons for counting
|> lines of code is pretty useless.
|> 

You've hit on a key point here -- just what do want your 'SLOC'
metric to measure?  Size?  Complexity?  Depending upon your
answer, different SLOC methods may be appropriate.

In the years I've been working in the Ada industry, I've never
seen a consensus for an Ada SLOC computational method.

In the past, I've used 'every non-blank, non-comment line is
a LOC'.  Note that this method is highly depend upon programming
and formating style.  I know that.  But it's a simple way to
count, and if you're consistent, then the data can be meaningful.

Just my $0.02.
-- 
Scott McCoy	Harris ISD	Opinions expressed are my own.
Staff Eng - SW	Internet: 	smccoy@dw3g.ess.harris.com

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Assy/Ada SLOC ratio;What's an Ada SLOC?
@ 1992-10-15 13:15 cis.ohio-state.edu!zaphod.mps.ohio-state.edu!darwin.sura.net!mlb.semi.har
  0 siblings, 0 replies; 8+ messages in thread
From: cis.ohio-state.edu!zaphod.mps.ohio-state.edu!darwin.sura.net!mlb.semi.har @ 1992-10-15 13:15 UTC (permalink / raw)


Before I start: my apologies if this a repeat of an earlier
post of mine.  My newsreader crapped out in the middle of
my previous write-up, and I can't get any indication that
the original post made it.  So, I'll repeat myself...:-)

In article <1992Oct14.121432.10919@aplcen.apl.jhu.edu>, dlc@ddsdx2.jhuapl.edu (
Dave Collard x7468) writes:

[...source code example deleted...]

|> 
|> IMHO, any method that depends on semicolons for counting
|> lines of code is pretty useless.
|> 

You've hit on a key point here -- what do you expect your SLOC
metric to measure?  Size?  Complexity?  The answer you give
can effect the method used to count SLOC.

I haven't seen a consensus in the Ada community on this topic,
and I've been developing/managing Ada projects since 1985.  So
there is probably not one answer to 'what is an Ada SLOC'...

One approach I used in the past is 'every non-blank, non-comment
line is a LOC'.  I fully recognize that this method is highly
dependent upong the programming and formating style.  For example,
a module written using named parameters, and a formatter which
breaks each parameter onto a separate line would have a higher
count then just using positional parameters.  Also, change your
margins for your formatter, and the count changes again.

I point these out to show there are limitations to any method
of counting SLOC.

-- 
Scott McCoy	Harris ISD	Opinions expressed are my own.
Staff Eng - SW	Internet: 	smccoy@dw3g.ess.harris.com

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Assy/Ada SLOC ratio;What's an Ada SLOC?
@ 1992-10-15 21:33 Bob Kitzberger
  0 siblings, 0 replies; 8+ messages in thread
From: Bob Kitzberger @ 1992-10-15 21:33 UTC (permalink / raw)


smccoy@dw3g.ess.harris.com (Scott McCoy) writes:

>In the past, I've used 'every non-blank, non-comment line is
>a LOC'.  Note that this method is highly depend upon programming
>and formating style.  I know that.  But it's a simple way to
>count, and if you're consistent, then the data can be meaningful.

I agree that for most seat-of-the-pants uses this LOC definition is
sufficient.  IMHO, algorthmic complexity far overshadows SLOC in terms
of important metrics, which McCabe et. al try to address.  However
McCabe's complexity measures, if I remember correctly, don't take into
account the complexity of the problem domain, so flight control
software that uises the same depth of loops, nesting of IF statements,
etc. as an accounting program will be deemed equal in complexity.

For entertainment, here's a simple awk script to count non-blank, 
non-comment lines.  Don't make million-dollar decisions based on it ;-)

	.Bob.


#!/bin/nawk  -f

BEGIN		{ cmnt = 0; sloc = 0; blnk = 0; }

/^[ \t]*--/	{ cmnt++; next; }
/^[ \t]*$/	{ blnk++; next; }
/^*$/		{ sloc++; next; }

END		{ 
		  printf("Comment lines: %5d\n", cmnt);
		  printf("Blank lines:   %5d\n", blnk);
		  printf("SLOC       :   %5d\n", sloc);
		  printf("-----------------------\n");
		  printf("Total lines:   %5d\n", cmnt+sloc+blnk);
		}
----------------
Bob Kitzberger          VisiCom Laboratories, Inc.
rlk@visicom.com         10052 Mesa Ridge Court, San Diego CA 92121 USA
                        +1 619 457 2111    FAX +1 619 457 0888

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Assy/Ada SLOC ratio;What's an Ada SLOC?
@ 1992-10-16 13:17 Dennis Doubleday
  0 siblings, 0 replies; 8+ messages in thread
From: Dennis Doubleday @ 1992-10-16 13:17 UTC (permalink / raw)


(Dave Collard x7468) writes:
> IMHO, any method that depends on semicolons for counting
> lines of code is pretty useless.

The tool I wrote back in '87 counts it just about every way imaginable: it
counts ALL semicolons, actual lines (with subtotals of blank, non-blank, and
non-comment lines), and Ada statements (with subtotals of executable and
declarative statements, and a breakdown of statements by statement type).  It
also includes a lot of other code size/complexity measures.  The best way to
do it is to give the user all the well-organized information you can and let
him decide what to make of it.

If you are interested, the tool is called ASAP.  The last time I was able to
check, it was still available via anonymous ftp from ftp.sei.cmu.edu, in the
pub/dd directory.  There is also a document there describing the tool and
giving installation and operation instructions.  It works only on VMS with DEC
Ada.  It could be ported to UNIX with not too much effort; the VMS/DEC Ada
dependencies are enumerated in the accompanying document.

Dennis Doubleday  (dday@sware.com) (404)315-6296 (x62)
SecureWare, Inc.
2957 Clairmont Rd., Suite 200
Atlanta, GA 30329

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Assy/Ada SLOC ratio;What's an Ada SLOC?
@ 1992-10-17 13:41 Xmiester
  0 siblings, 0 replies; 8+ messages in thread
From: Xmiester @ 1992-10-17 13:41 UTC (permalink / raw)


In article  <rlk.719184816@amstel>,  rlk@VisiCom.COM (Bob Kitzberger) writes:
>
>I agree that for most seat-of-the-pants uses this LOC definition is
>sufficient.  IMHO, algorthmic complexity far overshadows SLOC in terms
>of important metrics, which McCabe et. al try to address.  
>

LOC metrics and complexity metrics provide somewhat orthogonal information.
LOC gives you size of code not complexity.  True that they are both useful
in estimation techniques, but one shouldn't compare the 2 and conclude
that one far overshadows the other.  Possibly you meant that given
you could only use one of the 2, that you'd prefer complexity metrics.


>However
>McCabe's complexity measures, if I remember correctly, don't take into
>account the complexity of the problem domain, so flight control
>software that uises the same depth of loops, nesting of IF statements,
>etc. as an accounting program will be deemed equal in complexity.
>

BTW, isn't this thread treading into the realm of comp.software-eng ???


John Goodsen
goodsenj@ajpo.sei.cmu.edu

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~1992-10-17 13:41 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1992-10-14 16:55 Assy/Ada SLOC ratio;What's an Ada SLOC? Mark A Biggar
  -- strict thread matches above, loose matches on Subject: below --
1992-10-17 13:41 Xmiester
1992-10-16 13:17 Dennis Doubleday
1992-10-15 21:33 Bob Kitzberger
1992-10-15 13:15 cis.ohio-state.edu!zaphod.mps.ohio-state.edu!darwin.sura.net!mlb.semi.har
1992-10-15 12:21 cis.ohio-state.edu!zaphod.mps.ohio-state.edu!darwin.sura.net!mlb.semi.har
1992-10-14 12:14 cis.ohio-state.edu!zaphod.mps.ohio-state.edu!darwin.sura.net!aplcen.apl.j
1992-10-09 21:30 Paul Byrley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox