Config Control & Testing

Discussion in 'General Electronics Chat' started by sirch2, May 7, 2014.

  1. sirch2

    Thread Starter Well-Known Member

    Jan 21, 2013
    1,008
    351
    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?
     
  2. THE_RB

    AAC Fanatic!

    Feb 11, 2008
    5,435
    1,305
    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.
     
  3. Papabravo

    Expert

    Feb 24, 2006
    10,152
    1,793
    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.
     
  4. sirch2

    Thread Starter Well-Known Member

    Jan 21, 2013
    1,008
    351
    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.
     
  5. Papabravo

    Expert

    Feb 24, 2006
    10,152
    1,793
    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.
     
Loading...