Software Effort for IV Automation
Posted on September 30, 2014
By Jonathan Bagot, M.Sc., B.C.Sc. (Hons)
Lines of Code (LOC) is a software metric that has been used since the mid-1960’s to estimate effort and productivity . It is the simplest method to estimate the size of a software program. There are many different ways to count LOC, but the gist of the idea is to count the number of lines of code in a software program’s source code.
Many software developers hate the LOC software metric. They will tell you that it is useless and can provide a list of reasons to justify their claims, such as:
- More code does not mean better quality. For this reason, measuring effort and productivity with LOC is counterproductive. It rewards software developers for more code even though fewer lines of code are likely more efficient and may be easier to read, maintain, and extend.
- Expert software developers are typically assigned the difficult problems. These difficult problems may not require an abundance of code to solve. However, in order to solve these difficult problems, the design effort to implement complex logic may be significant. It is not fair to measure the expert software developer’s productivity based on LOC in this case. For example, in an embedded system the expert software developer may spend days optimizing a few lines of code based on real-time requirements.
Although many software developers despise the LOC software metric, LOC has been empirically shown to have a high correlation with effort . For this reason, project managers may use LOC as a metric to roughly estimate effort for software projects.
Using the size of the software program in Kilos of LOC (KLOC), effort in man months can be estimated using a model such as the Constructive Cost Model (COCOMO) II. In order to keep it simple, consider the following large project equation for effort shown below. The equation uses nominal values for the constant A and exponential scale B with an Effort Adjustment Factor (EAF) of 1.0. B can be adjusted based on five factors and EAF can be adjusted based on seventeen cost drivers (see  for more details). These adjustment factors allow the cost model to consider the characteristics of the environment, the software’s complexity, required reliability, the experience level of the development team, the stability and attributes of the target system, and the characteristics of the development tools.
Effort = A x EAF x SizeB
Effort = 2.94 x Size1.1
The effort equation shown above is typically used before starting a project. In this case, the size of the software program is an estimate because no code has been written. It is also possible to use the effort equation shown above upon completion of a project as a form of retrospective analysis. In this case, the size of the software program is exact because the actual source code can be analyzed to determine the LOC counts.
What sort of software effort does it take to develop the software necessary to automate IV doses? RIVA currently has 471,958 physical LOC* not including the Structured Query Language (SQL), Programmable Logic Controller (PLC), Variable Assembly Language (VAL3) robot code, and various software utilities used for machine setup.
It is not completely correct to compare LOC counts unless you know the exact method of counting and the programming language used, but to put the RIVA software effort into perspective, the U.S. fighter jets have the following LOC counts for the onboard operational software :
- F-16A Block 1 (1974) – 135,000 LOC
- F-16D Block 60 (1984) – 236,000 LOC
- F-22 Raptor (1997) – 1.7 million LOC
- F-35 Lightning II (2006) – 8 million LOC
- F-35 Lightning II (2012) – 10 million LOC
Using the simplified equation above for a rough estimate of effort, the KLOC and man years of effort are shown below.
The RIVA software effort would fall somewhere in between the F-16D Block 60 and the F-22 Raptor software effort. In conclusion, the software effort required for IV automation is significant and is an ongoing process of continuous improvement.
Jonathan Bagot is the Software Lead at Intelligent Hospital Systems, designer and manufacturer of RIVA a Fully Automated IV Compounding System
* RIVA LOC determined using CLOC utility available at sourceforge.net.
 B. Stepien. Software development cost estimation methods and research trends. Computer Science, 5:68-82, 2003.
 K. Bhatt, V. Tarey, P. Patel, K. B. Mits, and D. Ujjain. Analysis of source lines of code (SLOC) metric. International Journal of Emerging Technology and Advanced Engineering, 2(5):150-154, 2012.
 B. Boehm, B. Clark, S. Devnani-Chulani, E. Horowitz, R. Madachy, Reifer, R. Selby, and B. Steece. COCOMO II Model Definition Manual. Technical Report.
 C. Hagen, J. Sorenson, S. Hurt, and D. Wall. Software: The Brains Behind U.S. Defense Systems. A.T. Kearne, 2012.
Blog | Engineering | Software