Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!zaphod.mps.ohio-state.edu!rpi!bu.edu!orc!inews!iwarp.intel.com!psueea!eecs!warren From: warren@eecs.cs.pdx.edu (Warren Harrison) Newsgroups: comp.software-eng Subject: Re: complexity question Message-ID: <3196@psueea.UUCP> Date: 3 Aug 90 08:00:40 GMT References: <39400115@m.cs.uiuc.edu> Sender: news@psueea.UUCP Reply-To: warren@eecs.UUCP (Warren Harrison) Organization: Portland State University, Portland, OR Lines: 36 In article <39400115@m.cs.uiuc.edu> marick@m.cs.uiuc.edu writes: > >I have a question related to program complexity vs size. But, first, >my terms: > if (global1 == global2) > global1 = a; >This has 4 data references but only 3 distinct references (since there >are two duplicate references to global1). The distinct references are the Software Science "number of unique operands" - n2 and the data references are the Software Science "number of total operands" - N2. > >Now, if I had to guess, I'd guess that both the number of references >and the number of distinct references grow linearly with program size >(measured in lines of code or in number of tokens). Does anyone know? Most research suggests that Software Science length is highly correlated with lines of code (Length= N1 + N2 - where N1 is the total number of operators used) - this indicates that as the code size grows, more operators/operands are being referenced (for this I got a PhD? :-). What is more interesting is the n1/n2 relationship (unique references to operators/operands). As program size grows, unique operators reach a limit because a language only has so many operators - or at least a programmer has a favored "working set of operators". In fact after some point in size, one might want to consider n1 a constant. However, program vocabulary (n1+n2) is also correlated with program size, which suggests as you do that operands are added to a program as it increases in size. Warren ========================================================================== Warren Harrison warren@cs.pdx.edu Department of Computer Science 503/725-3108 Portland State University