Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!think.com!rpi!zaphod.mps.ohio-state.edu!unix.cis.pitt.edu!dsinc!ub!csn!news.den.mmc.com!randy From: randy@tigercat.den.mmc.com (Randy Stafford) Newsgroups: comp.software-eng Subject: Re: OOP in the "real world" Message-ID: <1991Jun27.165340.22545@den.mmc.com> Date: 27 Jun 91 16:53:40 GMT References: <1991Jun21.200139.14639@den.mmc.com> <1991Jun26.221144.6532@bellcore.bellcore.com> Sender: randy@tigercat (Randy Stafford) Organization: Martin Marietta Astronautics Group Lines: 108 Nntp-Posting-Host: tigercat.den.mmc.com In article <1991Jun26.221144.6532@bellcore.bellcore.com>, bytor@ctt.bellcore.com (Ross Huitt) writes: |> Sorry this is a little late. New mailer... Maybe you should get another new mailer. To wit: |> 11 bytes pe |> r line woul |> d be a bit |> small for a |> system in a |> ny language |> ,even Small |> talk. |> :-) Now the rest: |> In article <1991Jun21.200139.14639@den.mmc.com>, |> herkimer@tigercat.den.mmc.com (Don Herkimer) writes: |> |> [... stuff ...] |> |> In my group at Martin Marietta we have been (re)using a large OO |> commercial package called the Analyst, from Xerox Special Information |> Systems (XSIS). It is written in Smalltalk-80 and consists of |> |> |> |> ~3.8M bytes of source code |> |> ~661 classes |> |> ~14K methods |> |> |> |> If we estimate ~25 "lines of code" per method, this application |> weighs in at about 350 KSLOC. |> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |> |> Let's try some basic math: |> 3.8 meg of source / 14k methods = 271 bytes per method |> 271 byte per method / 25 lines per method = 11 bytes per line |> |> I don't buy it. I've been doing some preliminary metrics gathering |> on OO systems. The two largest commercial/public systems I've looked |> at were the NIHCL C++ class libraries and the Smalltalk/V images. |> The numbers I've been getting are typically on the order of 3 lines |> of code per method. (The C++ LOCs were executable statements as |> defined in the BNF, the Smalltalk LOCs were Non-Comment/Non-Blank |> Source Lines.) This is also true of smaller systems I've seen. |> If we use 3 lines per method with your 14k methods this would yield |> about 42K 'statements'. |> |> If you triple this to get an estimate of the Raw Source Code Lines (ala wc -l) |> then you get a system that's about 126KLOC (everything included). This is |> roughly half of your estimate. Yes, its a big system, but I don't think |> that 350KSLOC is correct by any definition of LOC. |> |> [... stuff ...] |> |> Anybody else have any numbers they would like to share? |> |> Ross Huitt |> Bell Communications Research |> (908) 699-2973 |> bytor@ctt.bellcore.com Yes, Mr. Huitt, I do have some numbers I'd like to share. First of all, there is no way in hell you're going to get an average of 3 SLOC per method in any language, especially C++. Dr. Tom Love (who has been in the business for years and was behind the development of the Objective-C ICPAKs) estimates 10 to 15 SLOC/method for a prototype method and 25 to 30 SLOC/method for a commercial-quality, production method. Let's look at it another way. The size in bytes of the Analyst (ASCII) source code is 3,423,423 (the size of the Analyst.sources file for Analyst V3.2). The number of methods in the Analyst is 13,721 (the number of CompiledMethod instances). 3,423,423 / 13,721 = 249 bytes per method. 249 bytes per method / 40 bytes per SLOC = 6.225 SLOC per method. Similarly, for Objectworks for Smalltalk-80 V2.5, the sources file size is 2,222,520 bytes. The number of methods is 6784. 2,222,250 / 6784 = 328 328 / 40 = 8.2 SLOC per method. The metric 40 (ASCII source) bytes per SLOC comes from some Analyst product literature. In any case, these calculations of number of SLOC per method are two to three times greater than the estimate you used. Using yours, Dr. Love's, and the calculated estimates, we get the following SLOC estimates for the Analyst: 13,721 methods * 3 SLOC per method = 41,163 SLOC. 13,721 methods * 6.225 SLOC per method = 85,413 SLOC. 13,721 methods * 25 SLOC per method = 343,025 SLOC. Tripling these, as you suggest, yields anywhere from 123KSLOC to 1.03MSLOC in the Analyst. Given the order of magnitude difference, I contend that it is naive to "buy it" or "don't buy it" based on one single estimate of SLOC per method. Perhaps you could focus your energies on statistically verifying the 40 bytes per SLOC average for ST80 methods. Then you could come up with a believable estimate of SLOC per method in ST80. You could also fine-tune the total source size (the size of the sources file might be a little high, because it contains other junk besides pure method code). Randy Stafford randy@tigercat.den.mmc.com P.S. How's my "basic math"??