Successful Endeavours - Electronics Designs That Work!

Software Design


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

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 got 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

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.

IoT Security

The Internet of Things, or IoT, is a pivotal component of the future and is driving initiatives from Smart Cities through Ubiquitous Computing and Augmented Reality. Of course the next step up from Smart Cities is a Smarter Planet. But we aren’t at Smart Cities yet.

An enabling technology like IoT can also have roadblocks to adoption. The principal ones being addressed now are:

  • power consumption
  • cost of goods
  • size
  • security

The biggest issue right now is IoT Security. Recent DDoS (Distributed Denial of Service) attacks have used IoT Devices as the attack launchers. They are being selected because many have weaker security than fully fledged computing devices.

DDoS or Distributed Denial of Service

DDoS or Distributed Denial of Service

In a recent article on IEEE Spectrum on the Path to IoT Security it is argued that IoT Manufacturers must take responsibility and not leave it up to end users. There is also a role of industry standards however no clear set of standards have yet been agreed. So although 2016 is the Year of IoT, with this being the single biggest category of product shipped, it is still very early days where things like IoT Security and IoT Interoperability are concerned.

IoT Security versus Software Security

This is not a new dilemma. Software Security is always important and it becomes increasingly important as Internet Communicating IoT Devices become more widespread. One apparent assumption underlying all this is that an IoT Device must be a fully IP Stack capable platform. That is not necessarily the case. In the video I shared about our Water Metering Remote Telemetry project one thing I didn’t mention is that the data stream is all driven from the IoT Device. There is nothing to log into. You can’t patch it with a Windows, Linux or other OS patch to override its function. It is not capable of being used in a DDoS attack because you can’t get to anything in it that can do that. So it is inherently secure against that form of risk.

Internet of Things Cconnectivity

Internet of Things Connectivity

However there are other risks. Nick Hunn has an insightful piece on Wireless Security for IoT where he argues that we are declaring security is present while having no evidence of proving it. That article is a little dated but the basic tenets still seem to apply. Just because a manufacturer or industry alliance states they have addressed security, it doesn’t make it automatically true.

So IoT Security is Software Security with the added component of protecting the physical hardware.

IoT Security in the Future

We still don’t have standards, so for now, individual device manufacturers and alliance members will need to ensure they have adequate security out of the box. The level of security required is determined by the importance of the data, either its security against unauthorised access, or its integrity against falsification. And at the asset level, its proof against either being disabled or used as an attack vector.

As an example, I am personally not so concerned if a hacker can find out how much electricity use my smart meter is reporting. Unless they get time of day usage and can correlate with other data sources to work out in advance when we aren’t home so they can rob us. My energy provider probably cares more about this data for all its customers coming into a competitors hands. Or maybe not. But I do care that I don’t get an outrageous bill because they were able to send fake data for my account to a server.

And energy grid managers care about usage data and Smart Meter appliance management being used to crash an entire electricity grid!

In the case of the Water Metering Remote Telemetry project I care that it remains online and working because otherwise someone will have to travel a long way to fix it. We have a facility in Gilgandra that is 892Km away as the crow flies. It will take a full day to get there and then another to back again. So I want it to be proof against some hacker disabling its communication ability. Since it has a physical antenna, I do care about that being hard to break. So some of these devices are put above normal reach and everything is inside a secure plastic case including the antenna. And our customer wants to know the reported water usage is correct. This means no missing data, and no incorrect data. They use the data to bill their customers.

One simple way to mess up data is a Replay Attack. If you can intercept and copy a data transmission, then you can play back that transmission any time you want to. You don’t even have to understand the content, the encryption, anything. Simply capture a HTTP POST or GET and replay it. Why does this matter? Because if the data transmitted is the volume of water used since the last report, then every time you play it back, you add to someone’s water bill. Or you distort the level of water the system believes is in a tank or reservoir. You can protect against these attacks in a number of ways but you have to consider the need to protect against them first of all.

There is a large volume of material on this topic. Here are some additional articles you might find useful for broadening your perspective on this topic:

I’m sure you won’t find it hard to search out a lot more articles. Just consider this. Once it has an Internet connection, any device can access anywhere in the world. And most firewalls protect against incoming attacks. A corrupted device on the inside can get out any time it wants to.

Internet of Things Global Reach

Internet of Things Global Reach

And if you want a really interesting view of what this could be like 10 years from now, I recommend reading Rainbow’s End by Vernor Vinge. Enjoy. And this isn’t my first reference to this book because I think it is fairly prescient in its exploration of a most probable future.

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 © 2016 Successful Endeavours Pty Ltd.

Top Programming Languages

We previously look at the Top Programming Languages for 2014 and IEEE Spectrum have released the same information for 2015.

Top 10 Programming Languages 2015

Top 10 Programming Languages 2015

One interesting thing is that use of C, the oldest of the top 5 languages, is increasing.

You can read the full article at The 2015 top ten programming languages including how they assessed which languages are used. They also have a App you can purchase if you want finer detail and to always be up to date.

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 © 2015 Successful Endeavours Pty Ltd.

Product Development

As a process, Product Development can be handled a number of different ways. And if your product only requires input from a single technical discipline which you are very experienced in, then you can usually predict everything you need to do and just make sure it all happens the right way.

But if the product is complex, involves many disciplines, and has unknowns about the technical direction to take, then it can sometimes resemble a roller coaster ride more than it does a straight forward journey. And there can be unexpected bumps along the way.

Our most recent employee brought this video to my attention and I thought it covered this topic really well. We used it for an in house lunch and learn session so I recommend you check it out to. It isn’t short so you might want to set aside a time you can sit back and enjoy it.

The presented is Andrew “Bunnie” Huang and the conference he is presenting at is linux.conf.au 2013. 

Quite a list of things you can run into just getting a fully package embedded computing device ready for market. The HDMI Man In The Middle exploit was my favourite part.

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 © 2015 Successful Endeavours Pty Ltd.

Top Programming Languages

A recent survey of the most used Software Languages, also known as the Top Programming Languages,  has revealed what most would have guessed as to the most popular Software Development Languages in use. The survey was published on IEEE Spectrum and usefully allows you to look at the statistics for 4 types of software development in any combination you want to. The categories used for the breakdown of the statistics are:

  • Web
  • Mobile
  • Enterprise
  • Embedded

Web Development Languages

The most popular Web Development Language was Java followed by Python, C# and PHP. I was surprised that Python ranked so highly. I understand the Google use it but hadn’t realised it had become so prevalent. So I learnt something new from that part. This is one of the advantages of being part of the professional body like IEEE. The world we live keeps changing and expanding and this is one way to stay up with those changes.

Mobile Software Development

For Mobile Software Development the winner was again Java with C, C++ and C# coming next. So here we are still very C oriented even on the most modern platform around. And of course Java is also very C like in its structure having been developed to address some system level issues such as memory management and garbage collection that C requires you to handle manually.

Enterprise Software Development

Enterprise Software Development sees Java again a the winner with C, C++, Python and C# coming next. Again Python is higher than I expected but the rest makes sense. Given that this area represents one of the core infrastructure requirements of modern scale-able companies it is interesting to see how narrow we still are with the Software Languages we use.

Embedded Software Development

And finally to the world we mostly deal with, Embedded Software Development. The clear winner here is C followed by C++ and Assembler. I took a snapshot of the complete rankings. Embedded C remains the primary language for software development in embedded systems.

Top Programming Languages - an IEEE published survey

Top Programming Languages

You can see the full survey results at Top Programming Languages

The overall winner was Java when you take all 4 categories into account and that isn’t hard to accept given Java was the Top Programming Language in 3 of the 4 categories. So if you are thinking about what Software Languages you should learn, it depends on where you want to work and what you want to work on. For Embedded Software Development, it is still C and C++. For everything else, Java is core with C, C++, C# and Python all playing a part.

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

Viewpoints matter

How does the world look to you?

 This is often one of the areas where Engineers and Customers can get out of step. And in particular, is a big issue for Software Development and IT systems. Check out the image below.

Round or Square Columns

Round or Square Columns

Technical professionals such as Engineers and Software Developers tend to be detail driven and so probably look at the system from the ground up. So we would see round columns.  

Entrepreneurs and Business Owners tend to see the world from the top down and so would see square columns. And this difference in perspective can be a problem in implementing a solution that works for the customer.

So here we have an image that represents the potential difference between the Engineer Viewpoint and Customer Viewpoint.

Requirements Management

The real issue here is Requirements Management. This is one aspect of Software Development where I like the V Model for Software Development and the European Space Agency Software Engineering process. It splits the problem down into steps and also lets you know whose language the documents at the step are written in. So User Requirements are written in the language of the use. Technical Requirements are written in the language of the technical professionals. And Requirements Analysis is required to determine the relationship between the different viewpoints. For most projects the analysis is used to translate User Requirements to Technical Requirements. So now we can all have a viewpoint that we understand and it is linked.

The V Model for Software Development

V Model

The general steps are:

  • User Requirements – in the language of the user
  • Product Requirements – in the language of the user and relevant standards and market needs
  • Technical Requirements – derived from both the above and in the language of the technician
  • Functional Decomposition – breaking the problem down into specific functions to be performed
  • Architectural Decomposition and Requirements Allocation – working out that is done in hardware, software, locally, remotely …
  • Detailed Design and Module Specifications – specific modules to be designed and tested

So we move from user language to technical language in a structured way that allows us to understand was is required and make sure nothing has been missed.

User Requirements and Technical Requirements

Requirements Analysis

Product Development Process

The Product Development Process is intended to ensure that the product meets its requirements and is delivered on time and on budget. And regardless of the size of the project the above steps are required. Who does them and how they are done is less important than that they are done. Smaller projects might not require a formal approach but any significant project certainly does. And this also helps to overcome the difference in viewpoint between Technical Professionals and their Customers.

 The image for today’s blog post was provided courtesy of Dr Marc Dussault, The Exponential Growth Strategist who is always on the look out for examples of antimimeticisomorphism, which I am sure you’ll agree this is!

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

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?

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

So 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 2 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.

Computer Programming

When we think of Computer Programming, we are generally thinking of electronic based computing engines with code running out of some form of electronic memory and typed in using some form of keyboard. Even punch cards partially fit this paradigm. And they seem ancient now.

So would it surprise you to know that the first acknowledged computer programmer was born in 1815, and was a woman?

Ada Lovelace - also known as Lady Ada King, Countess of Lovelace

Ada Lovelace

Ada Lovelace

Introducing Ada Lovelace, or more formally Lady Ada King, Countess of Lovelace. Only daughter of a mathematics loving mother she was educated in science, logic and mathematics and eventually became a good friend of Charles Babbage. She was fascinated by his mechanical clockwork computing engines and although he never built one, she was able to describe them, there operation and programming algorithms for them in better detail than he was. Her papers became the primary works for describing these machines and their use, and eventually inspired Alan Turing in the 1940s that led to the modern computing machine concepts we now take for granted.

She died at 36. I can’t image what else she might have achieved given more time. Her contribution is celebrated on Ada Lovelace Day.

This link leads to a pictorial copy of one of the programs she wrote Ada Lovelace Computing Program.

Here are some references for those wanting tho know more:

As an interesting aside, before the invention of magnetic media, even the software was still hardware.

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 © 2013 Successful Endeavours Pty Ltd.

 

 

Embedded Development

This is the second in a series of interviews between Ray Keefe of Successful Endeavours and Lance Harvie of People 4 Embedded. Lance is a LinkedIn connection of mine has wanted to do a series of interviews with Embedded Developers to go over issues, tips and career advice from those of us who have been in the industry for a while. We touch on topics such as:

  • Operating Systems
  • Software Testing
  • Design Methodologies
  • Hardware versus Software and trade-offs. 

 The first Interview is at Embedded Development.

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 © 2013 Successful Endeavours Pty Ltd.

Embedded Development

Embedded Development is the process of creating a computing system that is encapsulated within a self contained object. This object may or may not be part of a larger system. In it’s own right it is an Embedded System. So how do you go about creating an Embedded System?

Lance Harvie of People 4 Embedded and a LinkedIn connection of mine has wanted do do a series of interviews with Embedded Developers to go over issues, tips and career advice from those of us who have been in the industry for a while. For our first attempt we decided to try a Skype video call and record it. But Skype was not working well. So then we thought we would try out a Google Hangout and video record the interview.

First tip: never try a process that isn’t fully debugged when it has to work first time.

Second tip: have a backup plan.

From that you might be able to tell that both the Skype and Google Hangout processes didn’t go to plan.

Third tip: don’t rely on debugging during a live demo.

Those who don’t regularly read this blog won’t know that I got into electronics because I was the electric lead guitarist that thought it would be cool to be able to design and build my own amplifiers, racks and effects. I have a post covering my background in Music Electronics.

So I had an audio recorder with me and recorded the audio from the speakers of my laptop. I know there are other ways to do this but I hadn’t expected this to end up being the only thing that worked on the night and I had to make it work right then and there. So the audio you hear is Lance from my speakers sounding a little thin and far away and me in the room. This is also why the video is static but it does have our contact details on it.

Fourth tip: have a fallback position you know will work. 

There will be a transcript soon but you can check out the conversation above. If you want to get a copy of the transcript then either subscribe to the blog or leave a comment. 

 

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 © 2013 Successful Endeavours Pty Ltd.

Next Page »