My Recipe For Quality Units Of Work - Software Dev

FreeEMS topics that aren't specific to hardware development or firmware development.
Post Reply
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

My Recipe For Quality Units Of Work - Software Dev

Post by Fred »

I was explaining to someone what I do to achieve a generally good hit rate for regression-free improvements to the firmware. This is it, in brief:
  1. Work and work until I get the result I want. (make it work)
  2. Tidy up what I can see is obviously wrong. (make it right...)
  3. Run 'git difftool' and review every single change in every single file.
  4. Ensure that only a narrow set of changes are present to commit.
  5. Revert any changes that are stylistic or unrelated.
  6. Run 'git difftool' again and look for omissions and mistakes by reviewing every line of change in every file
  7. Repeat that until a full check results in no changes - because each change has the chance to introduce a new mistake.
  8. Final test to ensure it still works as required. < For me this stage = try more than one decoder/user config. For you it might mean unit tests, launching the app with different flags, different action paths to the same feature, whatever. It needs to be as thorough as possible, though.
  9. If any changes repeat self-review process until clean again.
  10. Commit
  11. Push to dev branch for others to review/test.
  12. Push to master branch for mainstream use.
I really do do this. I often run git diff and git difftool as many as 30+ times before finally committing my work. It's through this thorough self-review that I ensure the quality of my work is high. You might think that it's a lot of work, but it pays off when you don't have to diagnose and fix stuff later. If your platform allows for unit testing in a straight forward way DO IT. Any automated testing and code quality review is worthwhile and a time saver and quality booster in the short medium and long terms.

Fred.
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
Post Reply