# Software Development Estimation

in Software Costing we looked at some typical ways of determining the likely cost of a Software Development project. One way was to look at how much typing was involved. This is not considered the best approach as the cartoon below demonstrated.

Software Estimation

I prefer to spend more time thinking about the problem and less time typing. Among other things this reduces the amount of typing required.

The other example was by looking at the study by VDC Research where the median Software Development project had a cost of US\$12.50 per line of code. Which is also very expensive by our reckoning. But these are actual figures. The hard part is working out how many lines of code (LOC) will be required before you have written them.

# Estimation by Function Points

So I was interested when The Embedded Muse, a software development newsletter authored by Jack Ganssle, published some data from Capers Jones who is a legend in the Software Development industry for his statistics on the Software Development Process.

Capers Jones & Quote

My first thought was that I fully agree with the quote. Let’s have a look at it in detail.

High-quality software is not expensive. High-quality software is faster and cheaper to build and maintain than low-quality software, from initial development all the way through total cost of ownership.

The assertion is that if you have a way to measure Software Quality, and you stick to good Software Development Process and the creation of High Quality Software, the overall cost will be lower. This might seems counter intuitive to some of our prospects given the development process requests we get, but I think it is spot on. Here are the other items of interest.

According to Capers Jones, a very rough guide to estimating the number of people needed on a project, and the project’s duration, is:

• Number of developers = (function points)/150
• Calendar months = (function points) x 0.4
• One function point is approximately 130 lines of C Code

So for a typical 20,000 lines of C Code project, we would expect 154 function points with 1 developer required and it would take 5 years. If I look at one of the Industrial Control projects we did then that was 60,000 lines with 3 developers (that part works) and 8 months overall (rather than 5 years). So I’m not convinced the time component of the formula works. Maybe it is too heavily influenced by larger projects. But the number of developers seems to be about right.

Again, these are actual project figures and not some abstract model. And if you don’t use good Software Development Process then the cost of debugging and fixing issues in the field will typically dwarf the cost of writing the code.

# Software Development Metrics

So I thought I’d do a summary of the Software Development Metrics we have accumulated over time as this may help with the Software Estimation process. This is what it looks like in our world of typically smaller projects (less than 100K LOC) reflected through the data above:

• Number of developers = LOC  / 20,000
• Number of months = LOC / ((number of developers) x 6600)
• Cost of development = \$4.80 per LOC

This assumes good process and average project difficulty. Things that will push a project way past this are code space constraints, processing power constraints, poorly defined requirements and substantial changes of direction mid project. But it does give some way to at least know the ballpark.

Successful Endeavours specialise in Electronics Design and Embedded Software Development, focusing on products that are intended to be Made In AustraliaRay Keefe has developed market leading electronics products in Australia for more than 30 years. This post is Copyright © 2018 Successful Endeavours Pty Ltd.

# Software Costing

There is an old saying that goes something like this: “hardware is almost free and comes from China; but software is actually free and comes from India”. Actually not such on old saying, and certainly not true. But we do see signs of this myth being alive and well when providing project pricing and estimates for new clients. I covered some of this in Software Estimation.

Software Estimation

This was about how to try and work out a Software Development Budget in advance. Including forgetting that the entire Software Development Process involves more than just typing. So is it possible to know what it really costs from real world (non-imaginary) data?

# Software Cost

The answer is that it is. My thanks go to VDC Research who recently did a survey of Embedded Developers and made the data available to subscribers of The Embedded Muse, a software development newsletter authored by Jack Ganssle. If you develop software, especially for Embedded Systems, I recommend you sign up if you aren’t already a subscriber.

Jack Ganssle

Here is a summary of some statistics that gave me insights into real Software Development Costs.

 Average Median Project Team Members 19 7 Project Cost \$27,000,000 \$250,000 Lines of Code 627,000 20,000

So that is a big spread. Our projects are often below the median level shown here so I was interested to work out what these statistics translate to in cost. The \$ are all USD\$. And the large lines of code average probably represents larger projects using a major Operating System such as Linux as part of the project.

 Cost per team member Cost per line of code Average \$1,421,052 \$43.06 Median \$35,714 \$12.50

My first thought is that we don’t charge enough if these are industry typical figures. A bit more thinking shows the process costs of much larger systems. As far as I know there would be few software developers actually getting \$1M for their part in the project. And there will be tools costs also included. The statistic missing for me was the duration the money was spent over. We typically budget \$5 per line of code for larger projects (20K lines is a decent sized project for a small embedded system) and \$2.50 for smaller ones (say 5K lines of code of less).

So there you have a really rough way of estimating cost based on Lines of Code and number of Software Developers involved.

The above is a very small example of the data collected by VDC Research so consider signing up if you want to see all of it.

# Software Lines of Code

Software Lines of Code, or LOC, is only one measure of a project. There is much more to consider. We had a recent project where we were asked to fix 50K lines of code for a product that was proving unreliable. So I ran RSM over the top of it to get the average Cylcomatic Complexity and got 6.2! Those who know what that means probably have no idea how you could write code that hard to debug. And no, it wasn’t lots of switch statements. So is the correct answer \$250K at \$5 per line of code for a complete rewrite?

The answer is a resounding “NO”!

And the reason is because we redesigned the control flow and changed the UI to a table driven design and reduced a spaghetti mess of 50K lines of code down to 10K lines of cleanly designed code. Which is a budget more like \$50K. In this case, it was much more cost effective to redesign from scratch than to try and rescue it. We also fixed the hardware design as that was in part responsible for the unreliability.

So the other answer is that good requirements analysis and good design will reduce Software Cost.

Successful Endeavours specialise in Electronics Design and Embedded Software Development, focusing on products that are intended to be Made In Australia. Ray Keefe has developed market leading electronics products in Australia for more than 30 years. This post is Copyright © 2017 Successful Endeavours Pty Ltd.

# Estimating Software Development

This is actually a huge topic so I am just going to touch on some high level points. What prompted me to start writing on this topic is a recent conversation with a client and a cartoon I came across at Gizmodo about what happens when your Boss Estimates Software.

How long to write the software?

The question of how long it will take to write a particular piece of software is dependent on several factors:

• what is your direct experience in writing that sort of software?
• is there existing code you can leverage? – Software Reuse
• build versus build – can you buy a module?
• what is the Operating System? – an RTOS will usually slow things down
• is it a hard or easy problem?
• is it well defined?
• how will it be tested?
• what quality standards does it have to comply with – eg. Medical Device Class C
• how many people will be working on it?

I’m sure you get the idea.

And the coding is just part of the Software Development Process. That is the thing that gets forgotten more than anything else.

# Software Development Process

In the Software Development Process, coding is preceded by:

• user requirements analysis
• product requirements analysis
• technical analysis
• solution selection
• specification
• test methodology
• Software Design

Then there may be a Design Review.

Then we code (sometimes referred to as putting the bugs in).
Then we test and debug (getting the bugs out).

Then there may be a Code Review and Refactor followed by confirmation it still passes all the tests.

Then we complete the Software Documentation package and create a labelled revision so it can be properly released and tracked.

That is the small software team version of the process and for some projects some of those steps are trivial.

Larger companies have larger processes but can also do larger projects as a result.

# Industry Metrics for Coding

Here are some really basic Coding Metrics.

High security, financial systems, mission critical code – as little as 10 lines of fully debugged and documented code per day averaged across the whole process.

Commercial and scientific software is usually created at a rate of between 100 and 1000 lines of code a day.

And better processes actually speed that up rather than slowing it down.

# Estimating Software Development Time

A recent conversation with a client was on the topic of redoing someone else’s code. They had been working with another Software Development company and had decided that the code needed to be done again. They had spent two years without getting to a fully working version. My first though was “commendable patience”. My second was merely “ouch”!

So we did some analysis. I was initially optimistic. We used a tool called RSM to do some code base analysis. We use quite a lot of science in our Software Development Process including Static Analysis, Code Quality Analysis and complexity measurement. What we got from the initial analysis was 50K lines of code with an average Cyclometric Complexity of 6.21. The normal rule of thumb is that anything above 5 should be redesigned. Not Good. Then we looked at some specific files that had really high complexity scores above 10. That was the clincher. No evidence of design, no consistency, lot’s of cut and paste and everything is global variables.

The good news, is that the real complexity of the required code will not require 50K lines of code when it is properly designed. The bad news is that our client was right. It did need to be done again from scratch. Some parts might be reusable but it was unlikely.

Assuming we can do it with 20K lines of code, this will take between 20 and 200 person days to produce. In our case closer to 20 person days because the thing that makes the biggest difference to software delivery on time is your Software Development Process.

So that is a really quick look at a really big topic.

Successful Endeavours specialise in Electronics Design and Embedded Software Development. Ray Keefe has developed market leading electronics products in Australia for nearly 30 years. This post is Copyright © 2014 Successful Endeavours Pty Ltd.