Showing posts with label Software Safety. Show all posts
Showing posts with label Software Safety. Show all posts

Friday, November 23, 2012

Yet More Government Responses on Software License Questions and Study Guide

This month I received responses from Maryland and Idaho to the questions I asked in August, and IEEE-USA has released the Study Guide for New Software Engineering Exam. See my previous blogs on the subject at Do you have your license to write firmware? and Government Responses on Software License Questions.

The Idaho Board of Professional Engineers and Professional Land Surveyors, sent me a formal written response via Snail Mail:


November 9th, 2012

Dear Mr. Paddock:

At its meeting on November 7 and 8, 2012 the Idaho Board of Licensure of Professional Engineers and Professional Land Surveyors voted not to utilized the NCEES Principles and Practice of Software Engineer examination at this time for licensing professional engineers in Idaho, but they may reconsider that decision in the future.

Please call if you have any questions.

Sincerely, David K. Bennion , P.E. Board Chair.


Nov. 13 2012

Dear Mr. Paddock:

In your e-mail of August 12, 2012 you asked a number of questions regarding the NCEES Software Engineering, Principles and Practice of Engineering Examination. Please excuse us for not responding sooner, but I needed to consult the Board in detail to be able to provide you answers to your questions.

You asked if the "Software Engineering" license will be required in Maryland. Maryland does not license engineers by discipline. So no a "Software Engineer License" is not required (because there is no Software Engineer license), However, the practice of any engineering discipline including software engineering in the State of Maryland, does require a Professional Engineer License, subject to the exception provided in statute.

You asked: "Should such a license be required by the state, will there be any distinction made between types of computer systems such as your desktop PC, your Smart Phone or an Embedded System (those that run your microwave and your car)?" The practice of engineering is defined in Maryland statue as including: consultation; design; evaluation; inspection of construction to ensure compliance with specifications and drawings; investigation; planning; and design coordination. The planning, design, evaluation of any kind of software that could affect the health, safety or welfare of the public would fall be included in this definition and be considered the practice of engineering in Maryland.

You asked: "What will the prerequisites for taking the test, should it become required? Software is significantly different than any of the current required licenses." The requirements for taking the exam are the same as any other Principles and Practice of Engineering Examination (see § 14-304 and § 14-305). You also stated that you are concerned that there "..will there be academic requirements that will exclude those that have been practicing in the industry for years, yet have do not have a degree from a state recognized institution" Current Maryland Statute provides a path for licensure without a degree (see § 14-304 and § 14-305).

You asked: "Does Maryland license by comity?" Yes, Maryland does license by comity.

You asked: "How often will this license have to be renewed and what is the expense?" A Professional Engineering License in Maryland is renewed once every two years. The cost to renew is currently $68.00.

Finally you asked: "As a holder of a CSQE, will there be any ramifications of using the word 'Engineer' on my business card or web site?" Only Licensed Professional Engineers may practice, attempt to practice or offer to practice engineering in the State of Maryland. This includes using the title "engineer" on business cards, web sites or any other forms of communications.

I hope this clarifies the issues you were concerned with regarding software engineering and the practice of engineering in Maryland.

Please feel free to contact me again if you need any additional clarification on these issues or additional information.

Pam Edwards Executive Director - DLLR's Division of Occupational and Professional Licensing [Maryland].




News Release: Study Guide for New Software Engineering Exam Now Available:

WASHINGTON (31 October 2012) - A study guide for those planning to take the new software engineering exam is now available from IEEE-USA. It includes 40 representative questions and solutions, a suggested reference list and test specifications.

The Principles and Practice of Engineering (PE) Software Engineering exam - PE Software exam -- will be offered by NCEES, The National Council of Examiners for Engineering and Surveying, for the first time in April 2013.

IEEE Fellow Dr. Phillip Laplante, a professor of software engineering at Penn State University's Malvern, Pa., campus and chair of the Software Engineering Licensure Examination Development Committee, said the study guide is an essential tool in preparing for the exam.

"All prospective exam takers would be well-served to review the book to help identify weaknesses in their knowledge prior to taking the exam," Laplante said.

The study guide is $39.99 for IEEE members and $49.99 for nonmembers. http://ieeeusa.org/communications/ebooks/info.asp?Keyword=career&Product=Software+PE+Exam+%96+Sample+Questions+and+Solutions#=

PE Software exam registration begins 17 December. Check http://ncees.org/exams to find out about your state's approval and registration process. See exam specifications at http://engineers.texas.gov/downloads/ncees_PESoftware_2013.pdf...



Just as I predicted the people that have been pushing this have a vested interest in selling training material. What prices should there be on safety?


Saturday, October 6, 2012

"A Methodological Framework for Software Safety in Safety Critical Computer Systems"

The Journal of Computer Science is frequently overlooked in the Embedded Space for the solutions to many problems, for example the September issue covered topics as diverse as, Speed Control of Switched Reluctance Motor Using New Hybrid Particle Swarm Optimization for the hardware types and among us, and Fuzzy Cost Enabled Cluster Based Multipath Routing Algorithm for Mobile Ad-Hoc Networks for those putting together the latest sensor net.

Of particularly interest to me is A Methodological Framework for Software Safety in Safety Critical Computer Systems [PDF] by P. V. Srinivas Acharyulu and P. Seetharamaiah. These authors have put together one of the best introductions to issues related to the safety of systems controlled by software, from defining the terms to building a model system out of a real model train set to demonstrate the techniques described.

Abstract

"Software safety must deal with the principles of safety management, safety engineering and software engineering for developing safety-critical computer systems, with the target of making the system safe, risk-free and fail-safe in addition to provide a clarified differentaition for assessing and evaluating the risk, with the principles of software risk management. Problem statement: Prevailing software quality models, standards were not subsisting in adequately addressing the software safety issues for real-time safety-critical embedded systems. At present no standard framework does exist addressing the safety management and safety engineering priniciples for the development of software safety in safety-critical computer systems. Approach: In this study we propose a methodological framework involving safety management practices, safety engineering practices and software development life cycle phases for the development of software safety. In this framework we make use of the safety management practices such as planning, defining priniciples, fixing responsibilities, creteria and targets, risk assessment, design for safety, formulating safety requirements and integrating skills and techniques to address safety issues early with a vision for assurance and so on. In this framework we have also analysed integration of applicability of generic industrial heirarchy and software development heirarchy, with derived cyclical review involving safety professionals generating a nodal point for software safety. Results: This framework is applied to safety-critical software based laboratory prototype Railroad Crossing Control System (RCCS) with a limited complexity. The results have shown that all critical operations were safe and risk free. Conclusion: The development of software based on the proposed framework for RCCS have shown a clarified and improved safety-critical operations of the overall system peformance."

Journal of Computer Science
DOI: 10.3844/jcssp.2012.1564.1575
Volume 8, Issue 9
Pages 1564-1575

Do keep in mind it is an introduction, a real Rail Road Crossing Control System (RCCS) would be made from two or more systems running parallel, using different processors, different hardware developed by different teams in different languages such C and ADA. The real fun part is developing a system that must run for a few decades and not the eighteen month life span for many components today.


Sunday, September 23, 2012

Short a pin? There ain't no more up!

Picture Kentucky Coal Miner on the phone to the maker of their Man-Hoist ("Coal Miner" for open air elevator, beats any Amusement Park ride, only next to the 'Man-Trips', the Roller-Coaster like ride that takes you into the Mine, where you may lose your head at any moment).

Our Hoist only goes up. We've run out of cable, it is all on the spool. There ain't no more up!

I'm sure you have experienced the frustration of needing just one more pin on your Micro. Here is why you don't let the Boss force you into take shortcuts to increase company profits, in the shortsighted short-term. Seems the Hoist designers used two inputs one for Run/Stop and one for Up/Down. Up/Down faulted to 'Up', no mater what you wanted it to do, you only went up.

They should have used four inputs, Run, Stop, Up, Down. Seeing both Up and Down asserted simultaneously would then signal a fault.

The morale of this design tip: Do not take short cuts, people ultimately pay the price. Warrant Repairs are expensive when you have to travel to the mine.


Saturday, March 31, 2012

Dan Saks three day C++ Seminar comes to Cleveland in May

If you missed the evening with Dan Saks earlier this month, you have a second chance to meet Dan and partake of his Embedded C++ Wisdom, in his first ever three day course, on May 21st through the 23rd, 2012.

USA Firmware and DeVore Technologies, are bringing Dan Saks into the Cleveland area, in the suburb of Beachwood, minutes from downtown Cleveland, famous for the Rock'n Roll Hall of Fame, to give a three day long course in using C++ for Embedded Systems designes.

Dan Saks is one of the world's leading experts on the C and C++ programming languages and their use in developing Embedded Systems. Dan publishes his monthly column Programming Pointers, on Embedded.com.

Advanced registration is required. Until April 23rd the price for the three days is $1650, after which time the price goes up.


Sunday, February 5, 2012

Quite, Please: The Power of Introverts in a World That Can't Stop Talking

Last month I covered Susan Cain's GroupThink, where we covered that many of us are more productive when working alone, than in a sea of cubicles or 'open spaces'.

Now Ms. Cain has released her book: Quiet: The Power of Introverts in a World That Can't Stop Talking, on how today's workplaces are designed for extroverts with open plan cubical farms, at the expense of the creative introverts. Rarely are the loudest ideas, the best ideas. Take the Are You an Introvert or an Extrovert? quiz and listen to her interview at NPR. I'll give a full review after I've finished reading the book...


Saturday, January 21, 2012

Development has become the game. Whats your Potty Mouth Score today?

To be clear I'm not talking about developing a game, I'm talking about development being the game. This week Microsoft released their Visual Studio Achievements plug-in. The plug in 'scores' a number of things such as the number of curse words in a file, and goes down hill from there.

I do not believe that competition belongs in the development process, it should remain in the arena of sports (Being the classic Nerd, I don't think there should be sports, but that is a topic for an other time...). In my view any manager that promotes composition between teams or people, is doing a disservice to everyone from the people competing to the shareholders. How is it a good use of energy and resources?

I find this concept so abhorrent to the development of quality bug free systems, delivered on time, that I don't even know what to say about it. What are your thoughts? Here are a couple of mine:

If you score bug fixes, does someone that fixes ten simple bugs (why are they there at all if they are simple? Put deliberately so they could be 'found' to raise their score??), do they get a higher score than some one that fixed the single bug that has been there since the beginning of time that no one else could find?

What do you put down on your Time-Card for the time you spent "playing" development?

Is "Reached Level 256 in Visual Studio Achievements" really going to be a good thing on a resume?

In a different, but related mater, what I'd like to know is when did IDEs switched from being tools to improve productivity, to crutches that people do not how to program without using? For example you ask someone what "compiler are you using?" and they reply Code::Blocks.

The best 10xers in productivity are going to develop their own tools, frequently, and not be part of the herd worrying about out scoring anyone in a commodity IDE.

Most of these problems come down to our broken concept of education, and that many places already consider developers and engineers nothing but replaceable bags of meat. Companies try to get their proprietary development environments inflicted on the young and impressionable, with a bit of interest to learn, to capitalize on the Baby Duck Syndrome (You'll like environments that are similar to your first, and dislike others).

To much time is spent teaching the tools and language of the day, rather than teaching concepts and how to learn. Someone with a good understanding of the fundamentals can pickup any language quickly, from 'BF' (this is a family friendly blog), the hardest language I every toyed with, to Zonnon, in the list for 428 computer languages.

I don't know what the full solution to creating better embedded systems might be, however I'm sure it is not making it in to a game with scores...


Saturday, January 14, 2012

'Saftey Valve' to disable your Cell Phone?

John Fischer wrote an interesting article "Two Years Gone, Two Million More Accidents...When Will We Realize Cell Phones Need Safety Valves?" over at the Injury Board. Mr. Fischer explains why bans don't work, due to a Cell Phone causing a neuro-chemical addiction in the brain [1]. The above article then leads us to his own site Try Safety First, where we find a more data on how bans don't work, well worth your time to read, then purposes a solution.

The purposed solution is to standardize a protocol that disables the cell phone when it receives a transmission from a local low power transmitter. Such transmitters are placed in class rooms, prisons, automobiles etc. The publicly available "White Paper" marked "CONFIDENTIAL", seems rather odd to me, describes the bases of the system. No link here, because after all the paper is marked "CONFIDENTIAL"...

Personally, what seems disingenuous to me is that the "White Paper" wants to charge a dollar per Cell Phone per month for this "safety" function. Not clear where this money actually goes, tho the web site does have a section seeking "investors". They also claim to have filled 17 patents on this technology. My altruistic view of the world would not lock up safety functions behind patents and fees.

I'm sure you have been in places where you wish Cell Phones were not allowed, just as I have. Alas Cell Phone Jammers are illegal. The above proposed protocol does mention security being important to prevent the technology from being circumvented. What I didn't see was anything that said there was something that prevented the local transmitter from being overridden, other than laws, so the Cell Phone would not be able to receive the lockout protocol message...

[1] What I find interesting was the drawing Ben Tannenbaum, The Value of Mobile Phones and the Uberconnected Individual had on his site. We've now come exactly to the point predicted by futurist Alvin Toffler in his 1970 book Future Shock :

I've covered various distractions before:


Thursday, January 5, 2012

NASA's new Open Source Code Portal

NASA has opened a new portal: Code, that is meant to unify and expand NASA's Open Source activities.

I wonder if they will be following their Software Safety Guide Lines?

[January 4th, 2012] we are launching code.nasa.gov, the latest member of the open NASA web family. Through this website, we will continue, unify, and expand NASA’s open source activities. The site will serve to surface existing projects, provide a forum for discussing projects and processes, and guide internal and external groups in open development, release, and contribution.

In our initial release, we are focusing on providing a home for the current state of open source at the Agency. This includes guidance on how to engage the open source process, points of contact, and a directory of existing projects. By elucidating the process, we hope to lower the barriers to building open technology in partnership with the public.

Phase two will concentrate on providing a robust forum for ongoing discussion of open source concepts, policies, and projects at the Agency. In our third phase, we will turn to the tools and mechanisms development projects generally need to be successful, such as distributed version control, issue tracking, continuous integration, documentation, communication, and planning/management. During this phase, we will create and host a tool, service, and process chain to further lower the burden to going open.

Ultimately, our goal is to create a highly visible community hub that will imbue open concepts into the formulation stages of new hardware and software projects, and help existing projects transition to open modes of development and operation. We are going to need your help to get there! Please use “Share your Ideas,” comment on this post, or email us at opengov@nasa.gov to let us know how code can help you, where you would like to see the site go, and how we might best fulfill our purpose.

We believe that tomorrow’s space and science systems will be built in the open, and that code.nasa.gov will play a big part in getting us there. Will your code someday escape our solar system or land on an alien planet? We’re working to make it happen, and with your help, it will.

More "Coming Soon" than anything else, but still looks like it will be a fun place to watch, and learn. Especially when the Forum comes on line.


Sunday, October 16, 2011

Is there any training on "Software Safety" available?

I was recently asked if there was any specific training or certification on the topic of Software Safety.

Sadly my answer is I don't think so. I've seen some training specific to DO-178B, some related to FDA device compliance, and an occasional course at the MISRA office in the UK.

Part of the problem is defining what exactly do we mean by "Software Safety", as it always depends on the context. My simple working definition is that I never have to tell a person to "just push the reset button" or "you must reboot to recover". Do you really want to push the reset button on your defibrillator?

It also always must be kept in mind that even if the software is safe, it is still part of a system as a whole. If the system as a whole is unsafe, then having perfect software will not make a safe system.

Michael Barr at Netrino does offer Critical Software Safeguards Course: Lint and MISRA-C, for the Embedded space.

Jack Ganssle also offers his How to Develop Better Firmware Faster, one day class, again for the Embedded Space.

Do you know of any courses that would be relevant? If someone put together such a course what should be in it?


Saturday, September 3, 2011

Firmware Engineers of Northeast Ohio Meeting Sept. 13th 2011

Firmware Engineers of Northeast Ohio are holding their monthly meeting on September 13th 2011, 6:00 PM to 9:00 PM EDT.

Agenda:
  1. Catered meal provided [Munchies are always the most important thing of any meeting aren't they?]
  2. Opening Remarks
  3. Lightning 1 Talks:
    • IEEE Cleveland Computer Society/FENEO event, 'Lightning 1'. Chris Cole's inspiration; four very focused 15 minute talks by four different IEEE Cleveland Computer Society and FENEO members are planed. All are welcome but space is limited, please RSVP here.
      Presentation Topics:
    • When UNIX was a Pup by Dr. Robin Lake
    • Software in the Hardware World by Mike Dahlhausen
    • Real World Examples of Using Open Source Tools in Embedded Development by Christopher Cole
    • TDD for Kernel Module Development by Nick Barendt
  4. Networking. Burned out because of to many years at your current gig? This might be your chance to find something new and exciting.
Location:
DeVore Technologies, Inc.
3593 Green Rd.
Commerce Park Four
Suite 525
Beachwood, OH 44122
440-232-3846
Be sure to bring in the flier to receive 1 CPD credit.

Sunday, July 31, 2011

Judge Finds Ford Fraudulently Concealed Electronic Causes of Unintended Acceleration

This week, July 27 2011, Safety Research & Strategies, Inc published two documents taken from the court of Senior Judge William T. Swigert of the Fifth Judicial Circuit in Sumter County, Florida.

This 51-page decision, by Judge Swigert excoriated Ford for systematically concealing a long history, stretching back to the 1970s, of studying the problem of electromagnetic interference and unintended acceleration.

SRS has an on going page devoted specifically to new Toyota Sudden Unintended Acceleration studies. It is interesting to note that in 2004 Toyota licensed some of its technology to Ford.

Last week July 21,2011, SRS published How NHTSA and NASA Gamed the Toyota Data, covering issues of Tin Whiskers (see my past blogs Soldering Defect Database: How many ways can a solder joint fail? More than you might think and The Anatomy of a Race Condition: Toyota vs AVR XMega), 'losing' the data the NASA report was based on, and other dubious practices. What NHTSA's Data Can Tell Us about Unintended Acceleration and Electronic Throttle Control Systems. by R. A. Whitfield of Quality Control Systems Corporation gives a brief analysis of the raw National Highway Traffic Safety Administration (NHTSA) data.

In my past blog entry The Anatomy of a Race Condition: Toyota vs AVR XMega on NASA's on Toyota's sudden acceleration problem, I went into some of the details as to what I believe is happening. I explain why the Sudden Acceleration issue would not issue a diagnostic code if the problem is based in the firmware of the engine control unit, which is something I never seen covered in any of these reports. Guess they are all done by people with no experience in designing the systems they are reporting on?


Sunday, May 15, 2011

"Case Studies in Software Safety: Accidents and Lessons Learned", Aug 2nd 2011, by Hardy at NASA GSFC

If you happen to be in the area of NASA Goddard Space Flight Center (GSFC) Building 3 Auditorium on August 2nd, 2011 stop in for the Systems Engineering Seminar on Software Safety. You must register at least four days in advance, see below. For those that can't make it will be available on-line sometime after the 2nd.


The Mission Engineering and Systems Analysis Division (MESAD) of the Applied Engineering and Advanced Technology Directorate(AETD), the Office of Human Capital Management, and the Innovative Partnerships Program (IPP) Office of NASA Goddard Space Flight Center (GSFC) are co-sponsoring a series of seminar presentations on Systems Engineering concepts, philosophies, principles, and practices.


NASA
Goddard Space Flight Center


Systems Engineering Seminar



Case Studies in Software Safety: Accidents and Lessons Learned


Presented by:

Terry Hardy, Director, Safety & Risk Management, Great Circle Analytics, LLC


August 2,
2011, 1:00 p.m.

Building 3 Auditorium


Abstract:

Case Studies in Software Safety: Accidents and Lessons Learned

The complexity of our systems is increasing, especially with the use of software and computing systems. System safety approaches are therefore necessary to help manage risk and prevent accidents in these complex systems. An essential element in preventing accidents in the future is learning from past failures. This lecture will present case studies from many different industries describing accidents and mishaps related to software and computing systems. Such case studies can help us identify what can go wrong in our own systems. The focus of the talk will be on software safety as part of a broader system safety effort, and lessons learned will be discussed related to the system safety process. Recommendations will be provided based on lessons learned from those accidents as well as personal experience.





Biography:

Terry Hardy leads efforts in system safety and software assurance at Great Circle Analytics. Mr. Hardy has over 25 years of experience and numerous publications in the areas of launch vehicles, space propulsion, cryogenics, software, safety analysis, and risk management. Prior to founding Great Circle Analytics, he led software safety and assurance efforts at Special Aerospace Services and at NASA Goddard Space Flight Center; responsibilities included membership on the Constellation Safety Engineering Review Panel. Mr. Hardy also was the Principal Engineer for Reliability in FAA’s Office of Commercial Space Transportation, leading efforts to develop safety, reliability, and risk management regulations, guidance documents, and training. Mr. Hardy holds a BS degree in chemical engineering, an MS degree in chemical engineering, and an MS degree in civil engineering. He also has been certified as a Reliability Engineer, Quality Engineer, and Software Quality Engineer through the American Society for
Quality.



The Fine Print:

  • ***YOU MUST STOP AND SIGN IN AT THE MAIN GATE***
  • ***BRING PHOTO IDENTIFICATION***
  • ***ALL VISITOR CARS WILL BE INSPECTED BY GSFC SECURITY***
  • Please allow 30 minutes for security check in.
  • Please bring a photo identification.
  • Badging for special situations may be at the Visitor Center Badging Trailer

The really important fine print:

Registration for a visitor badge:
  • Employees and visitors with a Goddard badge need not register.
  • Visitors without a GSFC badge must register for a visitor badge.
  • To register, please send your Name, Citizenship, Organization, Phone, and Email at least FOUR days prior to seminar to: Lindsay Macleod, 301.286.6493, Lindsay.B.Macleod [At] nasa.gov
  • The SE Seminar Committee is only able to process Visitor Registrations for US Citizens.

Sunday, April 17, 2011

Vala a modern language for embedded, validated with VCC for C?


I'm always in search of the mythical 'Silver-Bullet' language that will let all of us write bug free software for our Embedded Systems. This week I came across Vala. Vala is a new programming language that aims to bring modern programming language features to GNOME developers, its syntax is taken from C# amd Java. What piqued my interest is that Vala is a front end that compiles to native C code. So there is some hope that it would be run on an Embedded Micro, tho it would have to have some beefy memory to support GObject.
Some of the features of Vala are:
  • Assertions and Contract Programming.
  • Signals/Asynchronous Methods; With asynchronous methods it is possible to do programming without any blocking. [Yes, the masochistic could do this with raw function pointers.]
  • Anonymous Methods / Closures.
  • Multi-Threading.
  • Resource Control.
Still there are a few kinks I see in Vala. The Vala Tutorial gives some examples of where the language will let you shoot yourself in the foot. A language should do all it can to prevent errors by the programmer. If we want to use a language that lets us shoot ourselves in the foot we can keep using forty year old C, or Programming A Problem-Oriented-Language by Charles H. Moore, written ~ June 1970.

I don't know how close Vala's asynchronous queues are to a true message passing system like Erlang. Hopefully close enough to have to avoid the whole issues of threads and locks, but I don't think this is the case from look at a bit of the code. Threads and locks simply do not scale, especially after you get past about 64 cores. Linux multi-core scalability is a good paper to start with on the issue. I'd like to see a language similar to Vala that enforced single assignment variables and true message passing, that complied down to something that ran on our small micros.

Chips with 144 independent F18A computers are just starting to come on the market now, so we collectively need to get our acts together on doing multi-core programming, without archaic notions of shared variables, threads and locks.

Something else I came across this week over at CodePlex was VCC from Microsoft: "VCC is a mechanical verifier for concurrent C programs. VCC takes a C program, annotated with function specifications, data invariants, loop invariants, and ghost code, and tries to prove these annotations correct. If it succeeds, VCC promises that your program actually meets its specifications."

I wonder how you could convince Vala to output VCC annotated source code to feed VCC to prove a 144 core program is correct on one of Chucks Chips? I do realize chips from Chuck Moore will be using Forth...

Anyone want to buy my Small-C Handbook collection?

My wife and I keep working at downsizing our home. We are tired of having our lives determined by "stuff". Move it from 'there' to 'here', spend time to inventory, dust it, move it back, etc. All of which takes time from our goals in Life.

[The Small-C book set below has found a new home, so they are no longer available.]

Anyway if anyone wants the following set of books I'll send them to whomever wants to pay for their shipping. I'll only ship to the Continental US, sorry. About five pounds shipping weight.
I just can't bring myself to toss this in the trash as they are still good teaching tools, and Jim Hendrix says Small-C is still being ported to devices to this day.
  • The Small-C Handbook by James E. Hendrix.
  • Small-Mac User's Manual for CP/M Release 1.2.
  • Small-Tools User's Manual for CP/M and MS/PC-DOS Release 1.2.
  • Dr. Dobb's Handbook of C. 700+ page hardback in like new condition.
  • Dr. Dobb's Journal A small C Compiler for the 8080's and Runtime Library for the Small C Compiler by Ron Cain. Reprint, with permission, from the May and September, 1980 issues of Dr. Dobb's Journal.
While I'm in a selling mood, if anyone wants to acquire the domain name dsPIC.org for any dsPIC projects send me an email. Don't really use it, and it is just more "stuff" that needs maintenance once in a while.

Sunday, March 27, 2011

Test Driven Development in Embedded C class synopsis

This week I spent three days with James Grenning, and ten other gentlemen, to be educated in Test Driven Development for Embedded C at the LeanDog boat in Cleveland Ohio.

For some background Jack Ganssle did a two part interview with Mr. Grenning last summer [2010], on the subject of TDD in Embedded Development:
A majority of the course is based on James' about to be released new book [May 2011] Test Driven Development for Embedded C, and a lot of insights drawn from his background in agile development methods, James was one of the signers of the Agile Manifesto and Embedded Systems.



The premise of TDD is that you write the tests for the code that needs to be created, before the first line of code is ever written. How can you possible know if your code is bug free if you can not figure out how to write a test for it? As each small test case is written, you watch it fail, then write the code that is being tested, then run the test again to see that it passes. In the method of design from the top down and build from the bottom up, our products now are being built from a solid foundation of small tested functions, rather than on untested code full of unknown bugs, sinking in the Big Ball of Mud.

More thought is put into the upfront requirements (the what of the product and how it gets validated) and specifications (the how the product gets built and verified), rather than seeing the schedule slip month by month trying to get all of the bugs out of the code by heroic effort at the end of the development process.

In the words of Confucius: "I hear and I forget. I see and I remember. I do and I understand." A large part of the class was hands on examples of writing tests for supplied examples, and then seeing how our version compared to that written by James. Some of the examples had deliberate bugs and build traps that those new to TDD would fall into, such as a module being pulled from a library causing a name clash when a header file gets edited. There is the real production code, test code, and sometimes fake or 'mock' code. The 'mock' code takes the place of some item that does not yet exist or would be to time consuming to test. If things were not set up correctly the fake/mock code would collide with the real production code. Myself in this one case I still think I prefer using Makefiles and different build directories rather than James' linker library method. Neither is right or wrong, but a mater of taste and style.
All of the tests were run using the test harness cppUTest, which can test plan old C code and C++ code.

TDD is not just for brand new projects, it is equally suited to cleaning up the tangled mess that some legacy code has become after years of changes by different people. Part of the class was on 'refactoring' and the difference between that and redesigning the code, and how to apply the test cases. Pick out a single area of code with the end target to be a single well tested function. When tests have been established for the existing code the code is incrementally moved, in small steps, to get visibility points for more tests, until the code can be replaced with new tested clean code. James and the book are far more eloquent at describing the process than I have been here. James' blog and papers, several covering Embedded Systems, are a great resource to take advantage of, for example: Legacy Code Change - a Boy Scout Adds Tests.

One of the other tools mentioned, but not actually used in class is FitNesse acceptance testing framework.

Alas TDD is not a panacea for all of our collective code problems. It may not cover integration issues such has multi-threading race conditions [Use the Erlang principles of modify nothing and everything is a message, and threading issues vanish, even on MultiCore parts], it also might not find issues that are dependent on the target hardware integer size, when the host and target differ, unless the tests can also be run on the target, which is strongly recommended when possible.

At lunch Jon Stahl, our gracious host for the three day class, the owner of LeanDog, gave us lunch time talks, such has the one on Agile & Lean From The Top Down: Executives Practicing Agile and Seeing Constraints, Kanban Explained. Take a look at the slides to see the LeanDog Boat, the floating office, and the Lean Dog's themselves, Otis and Iggy. Talk to Jon about improving your bottom line in your business area and/or your software development area.

Also it is always good to get out, as sometimes you learn things at lunch that you would never know about such as The Tau Manifesto on how Pi is (still) wrong [YouTube Video]...

If you have the opportunity to take James TDDinC class when he is in your area, make the time for it, and if you are in Cleveland stop and say hello to Otis and Iggy, and sign up for some traning.

Saturday, March 5, 2011

NASA to outsources Validation and Verification. Do you want the job?

Sometimes you run into things that just want you to shake your head and wonder, what is going on here? Case in point the National Highway Traffic Safety Administration outsourced the study of Toyota's Sudden Acceleration problem to NASA because they where perceived to be the best around to study this problem. Now this week we find that NASA wants to outsource their Validation and Verification work. Good enough for cars but not space shots??

Before getting to the NASA solicitation I want to define what Validation and Verification mean. Like many people confuse Weather Watches and Warnings many people are unclear on the difference between Validation and Verification.

  • Weather watch is used when the risk of an event has increased, but its occurrence and timing is still uncertain.
  • Weather warning is used for conditions posing a threat to life or propert.
Definition of Terms:

The FDA's Glossary of Computerized System and Software Development Terminology, defines many of the terms used on in this blog and our Software Safety site.

Defect:  The difference between the expectation and the actual results.

Validation and Verification:
Validation and Verification are a set of terms you find when working with Software Safety.  Many people do not understand how they differ from each other.

These are my working definitions for Validation and Verification (V&V):
  • Validation: Have we built the correct device?  Do we meet the customer's requirements?
  • Verification: Have we built the device correctly? Did we find and remove all of the 'bugs'?

Requirements and Specifications:

Clarifying the distinction between the terms "requirement" and "specification" is important.

My working definitions for Requirements and Specifications:

Requirements are a statement of what the customer wants and needs.  Requirements are used for validation.  Specifications are the documentation of how the customer requirements are met by the system design.  Specifications are used for verification.

A requirement can be any need or expectation for a system or for its software. Requirements reflect the stated or implied needs of the customer, and may be market-based, contractual, or statutory, as well as an organization's internal requirements. There can be many different kinds of requirements (e.g., design, functional, implementation, interface, performance, or physical requirements). Software requirements are typically derived from the system requirements for those aspects of system functionality that have been allocated to software. Software requirements are typically stated in functional terms and are defined, refined, and updated as a development project progresses. Success in accurately and completely documenting software requirements is a crucial factor in successful validation of the resulting software, and the project as a whole.

A specification  "means any requirement with which a product, process, service, or other activity must conform." (See 21 CFR§820.3(y).) It may refer to or include drawings, patterns, or other relevant documents and usually indicates the means and the criteria whereby conformity with the requirement can be checked. There are many different kinds of written specifications, e.g., system requirements specification, software requirements specification, software design specification, software test specification, software integration specification, etc. All of these documents establish "specified requirements" and are design outputs for which various forms of verification are necessary.

Device failure (21 CFR§821.3(d)). A device failure is the failure of a device to perform or function as intended, including any deviations from the device’s performance specifications or intended use.

Now with that background under our belt we can get a better grasp of what NASA is seeking in their, Proposals For Software Verification And Validation. This contract will provide resources for NASA-directed software verification and validation services; software safety assurance support for agency missions; and potential software development work for other government agencies.

NASA INDEPENDENT VERIFICATION AND VALIDATION SERVICES
Solicitation Number: NNG11310421R
Agency: National Aeronautics and Space Administration
Office: Headquarters
Location: Office of Procurement (HQ)

Synopsis:

Added: Sep 21, 2010 3:02 pm Modified: Mar 02, 2011 5:35 pm

NASA/Goddard Space Flight Center announces the release of the final RFP for NASA Independent Verification and Validation Services. Proposals submitted in response to this RFP shall be submitted by April 5, 2011, at 3:00pm Eastern Standard Time.The due date for questions or comments is March 24, 2011 to ensure our timely response. All questions and comments must be submitted in writing via email to the following email addresses: Laura.E.Freeman[-a-t-despaming]nasa.gov. Telephone questions will not be accepted. Technical documents related to this procurement can be obtained from the Procurement Proposal Library at: http://www.nasa.gov/centers/ivv/recompete/index.html. Documents related to this procurement will be available over the Internet. These documents will reside on a World Wide Web (WWW) server, which may be accessed using a WWW browser application. The Internet site, or URL, for the NASA/HQ Business Opportunities home page is http://prod.nais.nasa.gov/cgi-bin/eps/bizops.cgi?gr=D&pin=04 Offerors are responsible for monitoring this site for the release of the solicitation and any amendments. Potential offerors are responsible for downloading their own copy of the solicitation and amendments (if any).

Here is the link to NASA's V&V Facility, and I'll repeat the link I gave last week to NASA's Software Safety Guidebook. NASA has other standards and programs that are worth studying such as their Standards and Technical Assistance Resource Tool, for example the Software Formal Inspections Standards and Langley's Formal Methods.

So do you think you and I should team up and add ourselves to the Interested Vendors List for this V&V opportunity, or maybe one of the other 23,000+ opportunities?

Mazda6 "Bugs" and real world design considerations

While we may never know for sure if Toyota's have software bugs, we do know for certain than Mazada6 Sedans have them. Okay, for the purists it is not a bug but an arachnid, specifically a Yellow Sac spider. Seems these spiders like building nests in the fuel system. I know from experience that some spiders are attracted to cretin smells, like propane, and can be a problem to keep out of backup generator systems.

Designing for rodents and other creepy crawlies is one of those things I've never seen show up in any project requirement document, yet experience has tought that these kind of real world problems must be considered in any system design.

Ever consider what happens when a Red Ant walks across the high impedance A/D sensors traces on the circuit board? One of those cases that once you see it, the problem is obvious but all of the field reports and remote debugging facilities made no sense at all.

Conformal coating is an obvious solution to this 'bug' problem, but coating is not a panacea for all problems. Like all things in hardware design there are always tradeoffs.

A very common misconception is that Conformal Coating is a Hermetic Seal. It is used a lot in the Coal Mines, and the Electronic Industry in general, to keep the caustic dust, and other contaminants, off circuit boards.

As Conformal Coating is not a hermetic seal, what real happens is the impurities in the water are kept away from the circuit, but the water itself reaches the traces. Since the water is now fairly devoid of contaminates the water acts more like a dielectric insulator. You never notice it in a low impedance digital circuit, but unless debugging is an obsession don't let it get near a RF tuning circuit or a high impedance Wireless Sensor Network circuit.

Saturday, December 4, 2010

Where is that kick back for the SQL Injection on the Free Software Foundation you promised me?

Of course I had nothing to do with the Free Software Foundation attack, which Joab Jackson of IDG News goes into more details in his article Free Software Foundation's Software Repository Hacked. However the subject line gives me the opportunity to talk about Full Disclosure and the collectively pathetic job we are all doing in learning from past mistakes when it comes to Secure Coding.

business.ftc.gov | Your Link to the Law

The Federal Trade Commission (FTC) has in place their Endorsement Guides that require all blogger's to fully disclose any compensation a blogger receives from an other party. The FTC Business Center Blog tells us how these new rules came about, and why I'm bring them up now.

If you want more information, read The FTC’s Revised Endorsement Guides: What People are Asking or watch this video.

My current earnings from this blog are, as of moments ago, $9.73 via Google Ad Sense, and earnings from the Amazon Book Associate program so far has been nothing (No one wants to read books anymore?). You can see that I'm not going to be giving up my day job anytime soon to become a full time blogger, unless someone does come up with some great largesse to do so, which I'd disclose here.

The products I've mentioned here are ones I've used in some manner, or have hopes of using in the future, and no one has paid me to mention them.

The one priceless item for my blog here is Michael Barr's gracious linking to us from his Embedded Gurus site, which I link back to over on that menu to your right (if you using a web browser and not the RSS feed), hope you have checked out those resources.

Now with the legal like stuff out of the way lets move on to something usable in our products.


According to the FSF, attackers breached the FSF server Nov. 24 by using SQL injection attacks against the Savane bug tracking application.

On Black Friday (For our international readers: Black Friday is the day after the US Thanksgiving Holiday, when merchants hope people buy enough stuff to put them into black ink, verses red ink meaning loss, to have a profitable year), I coincidentally picked up the book SQL Antipatterns: Avoiding the Pitfalls of Database Programming by Bill Karwin, from The Pragmatic Bookshelf. Yearly on Black Friday they have a very generous discount for the frugal among us.

"Bill Karwin has helped thousands of people write better SQL and build stronger relational databases. Now he's sharing his collection of antipatterns—the most common errors he's identified in those thousands of requests for help.

Most developers aren't SQL experts, and most of the SQL that gets used is inefficient, hard to maintain, and sometimes just plain wrong. This book shows you all the common mistakes, and then leads you through the best fixes. What’s more, it shows you what’s behind these fixes, so you’ll learn a lot about relational databases along the way."

Chapter 21 is devoted exclusively to how SQL Injection work, and what is needed to do to stop them from happening. In a nutshell someone enters an SQL fragment into a web form on a site, and that site accepts the data without proper sanitizing of the inputs. This problem has existed for years, yet we still allow it to happen. Why? The other, related, and most common attack is some type of buffer overflow exploit. Again a problem that has been around for decades, and we still have not learned that it needs prevented in our code. Bill goes into great detail of the proper way to prevent a SQL injection.



The XKCD Carton on how Mom legally named her son "Robert`); Drop Table" to crash any database that tried to collect his identity.


Even if you have no reason to be interested in SQL Bill's book is still worth checking out because of some of the other chapters, such as the one on readable passwords and social engineering to get them, and what needs done to prevent such attacks. Like 'salting' a password. That is append random data to what they user enters so that dictionary attacks will not work. The random string is saved in the users account, the user has no knowledge of such a string.

As the issue of buffer overflows have been around a long time, there are already organizations like CERT (CERT is not an acronym; it is a name and a registered trade mark of Carnegie Mellon University) that have developed best practices Secure Coding Standards, for C, C++ and Java.

"Easily avoided software defects are a primary cause of commonly exploited software vulnerabilities. CERT staff has observed, through an analysis of thousands of vulnerability reports, that most vulnerabilities stem from a relatively small number of common programming errors. By identifying insecure coding practices and developing secure alternatives, software developers can take practical steps to reduce or eliminate vulnerabilities before deployment.

As part of the CERT Secure Coding Initiative, members of the Secure Coding team work with software developers and software development organizations to reduce vulnerabilities resulting from coding errors before they are deployed. We strive to identify common programming errors that lead to software vulnerabilities, establish standard secure coding standards, educate software developers, and to advance the state of the practice in secure coding."

CERT is currently researching survivable systems engineering that includes analyzing how susceptible systems are to sophisticated attacks and finding ways to improve the design of systems.

We can find a good introduction to the problem of buffer overflows and injection attacks in Robert C. Seacord's 2006 paper Safer Strings in C: Using the Managed String Library.

CERT has a few libraries that you can use to make your code more secure, such as the Managed String Library:

The managed string library was developed in response to the need for a string library that can improve the quality and security of newly developed C-language programs while eliminating obstacles to widespread adoption and possible standardization. As the name implies, the managed string library is based on a dynamic approach; memory is allocated and reallocated as required. This approach eliminates the possibility of unbounded copies, null-termination errors, and truncation by ensuring that there is always adequate space available for the resulting string (including the terminating null character). The one exception is if memory is exhausted; that is treated as an error condition. In this way, the managed string library accomplishes the goal of indicating either success or failure. The managed string library also protects against improper data sanitization by (optionally) ensuring that all characters in a string belong to a predefined set of "safe" characters.

String Manipulation Errors:

Many software vulnerabilities in C programs arise through the use of the standard C string manipulating functions. String manipulation programming errors include buffer overflow through string copying, truncation errors, termination errors and improper data sanitization.

Buffer overflow can easily occur during string copying if the fixed-length destination of the copy is not large enough to accommodate the source of the string. This is a particular problem when the source is user input, which is potentially unbounded. The usual programming practice is to allocate a character array that is generally large enough. However, this fixed-length array can still be exploited by a malicious user who supplies a carefully crafted string that overflows the array in such a way that the security of the system is compromised. This remains the most common exploit in fielded C code today.

In attempting to overcome the buffer overflow problem, some programmers limit the number of characters that are copied. This can result in strings being improperly truncated, which in turn results in a loss of data that may lead to a different type of software vulnerability.

A special case of truncation error is a termination error. Many of the standard C string functions rely on strings being null terminated. However, the length of a string does not include the null character. If just the non-null characters of a string are copied, the resulting string may not be properly terminated. A subsequent access may run off the end of the string, corrupting data that should not have been touched.

Finally, inadequate data sanitization can also lead to software vulnerabilities. In order to properly function, many applications require that data not contain certain characters. Ensuring that the strings used by the application do not include illegal characters can often prevent malicious users from exploiting an application.

Take a look at 07. Characters and Strings (STR) for some specific examples.

Alas the String Library uses errno and depends on malloc()and realloc(), which are not MISRA compliant. So it becomes a design decision on how to best proceed with any given project.

Vulnerabilities are not limited to Strings. Integer overflows are a security issue as well. To that end CERT also provides the secure integer library IntegerLib, which was developed by the CERT/CC and is freely available.

While the CERT information is invaluable the presentation of it is hideous. Popup links that are impossible to click on, most pages start with the top half of the page with a completely useless blue box that you must scroll over to see the Interesting Stuff, then once on the blue pages have to click the top bold link to really get to what you want to see.

Sunday, November 7, 2010

Microsoft Open Sources F#. Will Functional Languages save us?

Michael Barr recently [September, 2010] wrote a column on The Sad State of Embedded Software Process, which tells us that the first embedded system was done about forty years ago, and we still are doing a collectively poor job at building them.

The VDC Research Report What languages do you use to develop software?, tells us that after those forty years 81.9% of our Embedded Systems are still using the language 'C'.

Perhaps there is a connection to using a forty year old language,with not having any great improvements in reliability after forty years?

Why can't any modern language gain significant traction in the Embedded Space? Whom has the clout to develop and promote a new, safe, language for limited resource hard real time (dead line can not be missed without catastrophic consequences) Embedded Systems that will actually gain traction?

I do not have those answers. I'm sure I could come up with a language, as I'm sure you could too, but how to get it used is the question?

Some of the 'safest' languages don't even make VDC's list, unless they are perhaps grouped into the 'Other' category of 11.5%, languages like Esterel and Erlang for example.

To me Esterel seems to be the most obscure language that is used in the most safety critical applications such as flight controls and railroad safety. Esterel has the company Esterel Technologies behind it, as well as an Open Source implementation of an Esterel Compiler. To get a feel of what it is like at the top end of the Safety Critical scale check out some of the Webinars such as Software and Hardware Foundations for Safety Critical.

Next in my obscure list of safe languages would be Erlang. Erlang runs a large percentage of the worlds telephone network, and is considered a 'soft' real time system (dead line can be missed without catastrophic consequences). There has been no larger and longer running networked system than the telephone company. I'm always amused to see such things as 'new' networking technologies rediscovering and reinventing problems and solutions that Erlang solved over a decade ago.


Because Erlang almost has what I'm looking for such as being small (in the sense of running on small micros), and meeting hard real time deadlines, Erlang is the one Functional Language that I play with the most, but does not meet those two criteria.

Functional Languages, in contrast to Procedural Languages like C, take a different approach and mind set to creating safe code.

WikiPedia details the concepts behind Functional programming, the two most important concepts being:

  • Functions have no side effects; a function can not change a global variable for exmple.
  • Data is immutable. Variables are single assignment; Variables don't change value after being set the first time.

Eliminating side effects can make it much easier to understand and predict the behavior of a program, because you are never asking yourself questions like "What is the value of X right now?", X can only be assigned once, so you always know its value.

Professor Stephen A. Edwards whom is a tenured associate professor in the Computer Science Department of Columbia University, once told me that freshman students to his class that had no programming experience picked up Functional Languages, and languages like Esterel quickly, while people that had experience with programming languages such as 'C', struggled to make the transition. Variables that never vary their value can be tough to get your mind around at first, if you programmed in 'C'.

Professor Edwards has put fourth his paper High-level Synthesis from Functional Languages proposing that Functional Languages can be directly compiled to FPGA hardware.

Functional Languages where destined to live in obscurity until this week [Nov. 5th, 2010] when Don Syme of Microsoft announced that the F# Compiler plus Library Source Code is now available as a free download.

While F#,which has its roots in Objective CAML, has little hope of running on a microprocessor based Embedded System, Functional Languages just got a big push in to being more main stream with potential integration to things like Visual Studio. It is my hope that soon there will be a micro friendly Functional Language, that gains widespread adoption.

Will Functional Languages save us? We can only hope.

In closing it is worth mentioning that UML comes in at 5.8% on the VDC report, so I thought I'd mention Miro Samek's new graphical modeling tool QM, that I'm just starting to learn myself. The QM tool is available now for a free download and free, unrestricted use.

Saturday, September 11, 2010

MISRA tutorial and seminar announcement. Standards or Guidelines?

If you are a world traveler, The Motor Industry Software Reliability Association (MISRA) just announced a tutorial and seminar:

"A tutorial and seminar in collaboration with the Safety-Critical Systems Club (SCSC) will be held on 24 and 25 November 2010 in London, UK. On the first day there will be two half-day tutorials, on the MISRA C and MISRA C++ guidelines for the use of these languages in critical systems. The second day will be a seminar that will consider how the MISRA guidelines support safety-related systems development in various industry sectors, and we are particularly keen to feature presentations of case studies. If you would like to speak at this seminar, please discuss your idea with me in the first instance.

Further details of the programme will be available in due course.

There will also be a small exhibition on the second day. Details of the exhibition are available from Joan Atkinson at the SCSC

____________________
Dr David Ward
MISRA Project Manager
Article:

http://www.misra.org.uk/forum/viewtopic.php?f=210&t=1058&p=2032#p2032"

For those not familiar with MISRA, MISRA publishes a set of 'Guidelines' on 'Best Practices' for the languages C and C++. For example what languages constructs are bug prone and should be avoided in embedded systems used in vehicles. Many companies outside of the automotive industry have adopted the use of these guidelines, to help keep bugs out of their products.

Netrino also has a similar set of guidelines, with some links to some real world tips: Embedded C Coding Standard.

A technical semantic nit I want to pick is that these are guidelines. Standards are set by recognized bodies like IEEE and IEC - International Electrotechnical Commission. I frequently see things like "MISRA Standard". The distinction is a subtle one, but could be important to a product liability suite. Which is not to say that a company can not set 'internal standards' for coding practices. English is such a wonderful language... :-(

IEEE P730 Standards Software Quality Assurance, IEEE/EIA 12207.0 Standard for Information Technology - Software Life Cycle Processes, and IEC 61508 Functional safety of electrical/electronic/programmable electronic safety-related systems, are all example of standards used in Embedded Systems. There are more examples at my Software Safety site.