Global Sources
EE Times-India
Stay in touch with EE Times India
 
EE Times-India > Embedded
 
 
Embedded  

Structured method for embedded software source control

Posted: 16 Nov 2015     Print Version  Bookmark and Share

Keywords:embedded system  software development 

New standards such as ISO26262 and IEC61508 continue to materialise to bring more standardisation in the embedded system development. There is a pressing need to follow a disciplined software development approach to adhere to these standards—and help improve software quality. Effective usage of a source control system can support this cause and this article highlights some best practices for deployment with GIT source control.

Some of the best practices that we employ in our embedded software development include the following:
1. Modularized GIT commit comments
2. GIT ignore feature to avoid unnecessary/debug/test data in release package
3. 'Inline patch review' for quicker code-review process without needing a separate tool

Git is a distributed version control system with good speed. It supports distributed non-linear workflows. It is one of the most widely adopted version control systems used for software development. You can refer to Getting-Started-Git-Basics to get a basic understanding of the GIT version control system.

Modularized GIT commit comments
When working with legacy code containing many MISRA-C violations, tracking code changes made to fix them becomes difficult especially when there are multiple contributors. Furthermore, it can become more unmanageable due to added factors including:
 • Different contributors may use different tools for static code analysis like Klocwork, LDRA etc. Reports from various tools may be inconsistent at times on account of being evolved independently i.e. one MISRAC violation under LDRA may not come from Klocwork and vice-versa.
 • Multiple contributors may work on same modules addressing the same MISRA-C violations independent of each other, leading to a cumbersome integration.

Here we show some simple examples using GIT commands and structured GIT commit messages which we have used to easily manage MISRA-C fixes in our products. Some of these approaches have been incorporated as guidelines in our configuration management.

Approach

The figure below shows our recommended GIT commit message format that can be used for the git code commits related to MISRA-C fixes.

Using such commit messages for every code commit made for fixing the MISRA-C violations enables effective tracking of the code changes. Once every developer starts adapting such methodology it reduces confusion and enables developers to effectively manage and fix the MISRA errors.

The benefit of a structured approach include:

Easy Tracking: Using git log and shortlog with grep option can provide very useful information on code changes, i.e. to find out Who/Which/How aspect of it—Who made MISRAC fixes, how many were made, and which tool was used to find a particular rule violation.

List all Fixes with commit ids: The ability to get a full list of MISRAC fixes and see details of a particular fix comes in handy during code-review process when only a particular type of patches are in scope e.g., MISRA-C fixes.The command shown above prints out all the commits with their commit IDs and one-line information about them. To find more detail of that commit, one can run git show .


1 • 2 Next Page Last Page



Comment on "Structured method for embedded softw..."
Comments:  
*  You can enter [0] more charecters.
*Verify code:
 
 
Webinars

Seminars

Visit Asia Webinars to learn about the latest in technology and get practical design tips.

 

Go to top             Connect on Facebook      Follow us on Twitter      Follow us on Orkut

 
Back to Top