Config Control & Testing

Thread Starter

sirch2

Joined Jan 21, 2013
1,037
I pretty much wasted a day over the weekend tracking down what I thought was a hardware fault on a project I am developing but turned out to be the result of a software change I had made the night before. This is not the first time this kind of situation has occurred and I got to thinking that if I had a test rig and a set of regression tests for the project I may have spotted the problem more quickly. On the other hand this is home/hobby stuff and time is short so I am not convinced spending time putting together a test rig and test code would really pay back. I currently use Subversion for source code control but that’s about it.

I was just wondering what other people do, is it worth the effort of setting up a test rig and having some sort of structured test procedure or do you just take it on the chin and carry on?
 

THE_RB

Joined Feb 11, 2008
5,438
Take it on the chin. :)

Get more practice, get better and get less bugs (and faster solutions to the few bugs you still get).

It helps to re-use proven code and hardware systems you have already refined. That eliminates a heap of wasted time.
 

Papabravo

Joined Feb 24, 2006
21,158
I can summarize the secret of success in embedded programming in one word:

SCAFFOLDING

This means adding code for controlability and observability of critical functions. Part of the problem comes from being so focused on the application code that we ignore the ability to observe, control, and verify behavior.
 

Thread Starter

sirch2

Joined Jan 21, 2013
1,037
I have some of that, although probably not enough and probably not as well implemented as it should be. However I'm not sure any amount of scaffolding will solve stupidity.

I was trying to reduce the power consumption and intended to set unused pins to output/low, however I accidentally set a pin that was in use as an input to output during sleep, this caused the circuit attached to that pin to source a bit of current through that path. That particular circuit is switched off by a MOSFET when not in use but I was seeing it draw some power, hence I thought the MOSFET was dodgy. If I had had a half decent test procedure I could have tested that sub-circuit and checked the MOSFET and other functions before I started unsoldering bits.

I think your point is useful though, better organization of the code and verification of exactly what state things are in may well have helped.
 

Papabravo

Joined Feb 24, 2006
21,158
It never hurts to add code for checking things like the state of pins periodically. This kind of thing can be difficult to find without some assistance from the processor.
 
Top