Estimating the Value and Schedule of Mathematical Software program

Arithmetic and mathematical software program mixed with right now’s highly effective computer systems can ship giant enhancements in pace and effectivity in addition to new helpful options. Mathematical software program is in widespread use: digital video reminiscent of YouTube and Skype, digital audio reminiscent of MP3 information, JPEG photographs, speech recognition reminiscent of Apple’s Siri, pc generated photographs in films and video video games, and the World Positioning System or GPS that tells individuals the place they’re, all multi-billion greenback markets right now.

Mathematical software program could supply options to many urgent issues reminiscent of curing most cancers by serving to develop methods of good medicine that carry out mathematical or logical calculations to establish and selectively kill most cancers cells (see the earlier submit Animations of a Doable Treatment for Most cancers).

Mathematical software program may remedy many small issues reminiscent of the necessity to loosen up with entertaining new audio/video results for pc video games and films (see the earlier submit, Creating Cartoon Voices with Math).

The profitable resolution of issues utilizing arithmetic and mathematical software program normally requires estimating the price and schedule of mathematical software program initiatives primarily based on historic expertise. A superb coach and quarterback plan the technique and performs for a profitable soccer crew primarily based on what the gamers and crew can truly do.

Estimating the Value and Schedule of Mathematical Software program

Mathematical software program growth is an unusual space, not like mainstream software program growth reminiscent of enterprise websites and consumer interface software program growth. Consumer interface software program, for instance, is commonly extraordinarily simple right now. With fashionable scripting languages like Python and GUI (Graphical Consumer Interface) Builders, it’s attainable to create working consumer interfaces quickly with little danger if one sticks with normal GUI elements reminiscent of buttons, sliders, and information entry fields. Mathematical software program growth is normally a lot tougher than fashionable consumer interface software program growth — taking longer per line of code, involving rather more debugging — and far much less predictable.

People and teams typically have extraordinarily optimistic concepts concerning the measurement and scope of mathematical software program initiatives. Many individuals seem like unaware of the dimensions and complexity of assorted generally used examples of mathematical software program. For instance, the extensively used open-source x264 h.264 video encoder is over 62,000 strains of code developed between 2004 and 2011 with a minimum of 18 contributors. The H.264 video compression normal is the video compression utilized in many YouTube movies, BluRay discs, and different excessive efficiency video methods.

The favored open supply Unbiased JPEG Group JPEG picture encoder/decoder utilized by many industrial and open-source picture editors and viewers is over 52,000 strains of code developed between 2000 and 2011 with a minimum of 13 contributors.

The LAME MP3 audio encoder, finest referred to as the MP3 encoder plugin for the Audacity audio editor, is over 87,000 strains of code (about 40,000 strains of algorithmic C/C++ code and about 47,000 strains of Bourne shell installer code) developed between 1998 and 2011 with a minimum of 9 major builders and a minimum of 21 whole contributors.

A line of code is akin to a minimum of one shifting half in a bodily machine. As a degree of reference, the House Shuttle Primary Engine, some of the refined engines on the earth, has about 50,000 shifting components. These mathematical packages are comparable in complexity to essentially the most refined bodily machines on the earth and infrequently fail catastrophically resulting from tiny errors simply as a rocket engine will.

Software program engineering professional Barry Boehm’s unique software program price estimating mannequin COCOMO (Embedded) which stands for the Constructive Value Mannequin for Embedded Software program Improvement — seems to present a tough estimate of the time it takes to develop these low stage mathematical packages, though there’s substantial variation between estimates and precise effort.

The mannequin is:

[tex]MM (Man Months) = 3.6(KDSI)^{1.2} [/tex]

the place Boehm’s Man Month is 152 man-hours (19 man-days) and KDSI is 1000 (Kilo) Delivered Supply Directions (strains of code). Clean strains and feedback will not be counted.

Just a few fast numbers from COCOMO Embedded:

1000 strains of code 3.6 man months
2000 strains of code 8.3 man months
5000 strains of code 24.8 man months

Basic COCOMO (Embedded)

Primary COCOMO (Embedded)

If the mission is utilizing consultants at an hourly charge, one ought to multiply the variety of man months occasions 152 hours occasions the hourly charge of the consultants. If the mission is utilizing direct staff, one ought to use the price of the workers per thirty days. Boehm’s mannequin omits one man-day per thirty days for the typical paid day without work of the worker.

Value = (Estimated Man-Months)*(152 hours)*(hourly charge)


Value = (Estimated Man-Month)*(Month-to-month Wage and Overhead)

There may be substantial variation between the precise and estimated effort from this straightforward mannequin. In his e book Software program Engineering Economics (p. 84), Boehm notes:

From a sensible standpoint, you will need to notice that Primary COCOMO estimates are inside an element of 1.3 of actuals solely 29% of the time, and inside an element of two solely 60% of the time.

Barry Boehm advises towards utilizing his mannequin for initiatives smaller than 2000 strains of code.

Within the writer’s expertise, shorter initiatives, reminiscent of 1000 strains of code, are nonetheless in the identical ballpark, on common, as predicted by Primary COCOMO Embedded however there’s much more variation between the estimates and precise effort. The writer as soon as carried out the Superior Encryption Commonplace (AES), about 1500 strains of code, in a single week which was a lot quicker than the mannequin would predict or the writer’s expertise with different initiatives. The hassle varies much more on small initiatives relying on the main points of the algorithm and different elements which are onerous to know upfront.

The free open-source CLOC (Rely Strains of Code) utility is out there for the key programming platforms: Home windows, Mac OS X, Linux, and different widespread types of Unix. There at the moment are many free open-source packages that implement identified arithmetic and algorithms reminiscent of x264 and the opposite examples cited above. It’s thus typically attainable to get a tough estimate of the dimensions and scope of mathematical software program initiatives that contain identified arithmetic and algorithms.

Limitations of Strains of Code

It is very important understand that a line of code (LOC) is a tough estimate of the dimensions and complexity of a pc program. Within the C or C++ programming languages, these are each a single line of code:

a = 1;

if ( (a > b && a

The second instance line of code would normally require extra precise effort than the primary instance line. This is among the causes price and schedule estimates primarily based on counts of the strains of code differ loads in comparison with the precise effort.

Due to the numerous issues with utilizing strains of code for price and schedule estimation, different strategies reminiscent of operate factors have been developed. Perform factors are at the moment fashionable in books and articles on software program price and schedule estimation. Nevertheless, operate factors had been developed for enterprise and consumer interface software program. Perform level estimation usually includes counting the variety of inputs and outputs to this system reminiscent of information entry fields in a enterprise program. This typically predicts the precise effort properly as a result of many enterprise and consumer interface packages have easy inside logic or arithmetic and the hassle is proportional to the variety of inputs and outputs of this system. Enterprise software program normally makes use of solely primary arithmetic, including columns of numbers and comparable easy operations.

Mathematical packages are usually extraordinarily advanced internally however typically seem as only some inputs and outputs. For instance, a video compression program takes one enter, the uncompressed uncooked video, and returns one output, the compressed video. Thus, strategies reminiscent of operate factors are inclined to grossly underestimate the dimensions and scope of mathematical software program initiatives.

This weak spot of operate factors has been acknowledged for a few years and there are extra superior variations of the operate level methodology that try to raised estimate the dimensions and complexity of advanced algorithms hidden from the top consumer. Nevertheless, it's nonetheless higher to depend on strains of code for estimating the dimensions and scope of mathematical software program, regardless of the plain limitations of utilizing strains of code for price and schedule estimation.

Scripting Languages (Matlab) Versus Low-Stage Compiled Languages (C/C++)

One well-known option to pace up the growth of mathematical software program is to make use of mathematical scripting languages reminiscent of Matlab, Mathematica, Octave (a free open-source program that's largely suitable with Matlab), and lots of others. These are scripting languages just like Python or PHP which have giant well-integrated libraries of mathematical operate mixed with an inventory (e.g. Mathematica) or numerical array/matrix information kind (e.g. Matlab).

Within the writer’s expertise, the pace of growth of mathematical software program utilizing Octave, MATLAB, or comparable instruments is usually 2-3 occasions quicker on common than C/C++. That is largely as a result of the variety of strains of code is decreased by an element of 2-3. The Primary COCOMO Embedded mannequin nonetheless offers a helpful tough estimate of the particular effort required, however the variety of strains of code enter to the price mannequin is decreased!

There may be quite a lot of variation within the elevated pace of growth from utilizing Octave, Matlab, or comparable instruments, relying on the main points of the algorithm and simply plain luck. Some algorithms are properly tailored to implementation in Octave/MATLAB and the pace of growth achieve could be 10-20 occasions the pace to develop in C/C++. Mathworks, which markets MATLAB, performs up instances like this. There are additionally some algorithms the place there isn't a achieve; the Octave/MATLAB code is just about the identical because the C/C++ code.

Sadly, the pace of execution of the packages in Matlab, Octave, and comparable instruments is commonly considerably lower than compiled code written in C, C++, or comparable programming languages. With languages like Matlab that use numerical arrays, the penalty shouldn't be as nice because it was a decade in the past. Some operations such because the Quick Fourier Rework (FFT) typically appear to be simply as quick in Matlab or comparable instruments as compiled variations. Nevertheless, one ought to usually plan for a penalty of 2-3 occasions in pace of execution. It's nonetheless typically not sensible resulting from pace of execution and reminiscence utilization issues to develop computationally intensive mathematical software program reminiscent of video compression packages utilizing instruments reminiscent of Octave, Matlab, or Mathematica.


Arithmetic and mathematical software program can ship giant enhancements in pace and effectivity in addition to new helpful options. Success is more likely with estimates of the dimensions and scope of mathematical software program growth primarily based on historic expertise.

Steered Studying/References

Barry Boehm, Software program Engineering Economics, Prentice-Corridor, Englewood Cliffs, NJ, 1981

© 2012 John F. McGowan

Concerning the Writer

John F. McGowan, Ph.D. solves issues utilizing arithmetic and mathematical software program, together with creating video compression and speech recognition applied sciences. He has intensive expertise creating software program in C, C++, Visible Primary, Mathematica, MATLAB, and lots of different programming languages. He's in all probability finest identified for his AVI Overview, an Web FAQ (Often Requested Questions) on the Microsoft AVI (Audio Video Interleave) file format. He has labored as a contractor at NASA Ames Analysis Heart concerned within the analysis and growth of picture and video processing algorithms and know-how. He has printed articles on the origin and evolution of life, the exploration of Mars (anticipating the invention of methane on Mars), and low-cost entry to house. He has a Ph.D. in physics from the College of Illinois at Urbana-Champaign and a B.S. in physics from the California Institute of Know-how (Caltech). He could be reached at [email protected].

Leave a Comment