当前位置:网站首页>Embedded development: skills and tricks -- seven skills to improve the quality of embedded software code
Embedded development: skills and tricks -- seven skills to improve the quality of embedded software code
2022-07-04 22:19:00 【Guangdong embedded Education】
For developers , Nothing is worse than trying to maintain and update code of such poor quality . For many development teams , Software code quality is not required . To improve code quality , Here are a few tips that embedded developers can follow , And integrate it into your own process , This will help improve their code quality .
skill 1—— Follow coding standards
Developers interested in improving code quality should start by examining industry standards . Developers can use many industry standards to improve the way they write code , Include :
l MISRA-C
l Cert-C
l IEC 12207
l IEC 62304
These standards establish a framework for developing high-quality software . Anyone who wants to improve software quality should review what has been done , And start implementing industry recommendations .
skill 2—— Analyze and maintain software complexity
It has been proved many times , Minimizing software complexity also minimizes error rates . The more complex the software is , The greater the change , Not only will there be software bug, And the maintenance of the system will also increase bug. Developers should monitor their function complexity by using cyclomatic complexity .
skill 3—— Conduct regular code reviews
Code review has proved to be the most effective way to reduce software errors . Integrating peer reviews into the development cycle is crucial to ensure that software quality remains at a high level . In order to have an effective code review process , Embedded developers should follow several key factors :
Limit code reviews to 60 Within a
Don't comment more than 400 individual LOC
Schedule a code review at least once a week ( If you generate more than per week 400 individual LOC, More )
skill 4—— Requirements must be traceable
If a requirement cannot be tested and verified in some way , It's better to be automated , Then it is not a real demand . Even before the development starts , Requirements should be broken down into traceable test cases , These use cases can be used later to verify that all requirements have been met . Of course , Needs change , Will use different design methods , But there needs to be a way to track software features and functions , Trace back to the requirements that produced them , And prove that they work as expected .
skill 5—— Compile without errors and warnings
Many teams and developers who ignore compiler warnings , Sometimes there are only oneortwo warnings that developers need to dig deep , Or trivial , So they were ignored , Just hang there . If the compiler does not trust the code and gives a warning , Then developers should treat it as a compiler error and resolve the warning . Warnings are the way the compiler says it doesn't like something . honestly ,C Compilers like everything , So if it has problems with something , So as embedded developers, we should do the same . Code quality means no errors and warnings .
skill 6– Static analysis
Static code analyzer is one of the fastest ways to find potential problems in embedded software . Static code analyzer can find syntax problems 、 Potential glitches , And identify the non portable structure in the code , The static analyzer can even check whether the coding standard is followed , Integrating static analyzers into a continuous build process is a good way to improve code quality and minimize software errors .
skill 7—— All code must be thoroughly tested
Many small and medium-sized enterprises release products without completely testing the software . These companies tend to carry out high-level spot checks , To see if the system works as they expect , Then send them to the wild . When most readers learn that the products of these companies encounter problems in this field , May not be surprised . As an embedded developer , We can't think that our code is working properly just because we don't see the improper behavior of the system . Our code needs to be fully tested ! Comprehensive testing means :
l High level test cases have been verified
l Unit tests have been performed
l Integration tests have been performed
l Code coverage testing has been completed , To verify that each line of code is executed during the test
l System tracking analysis , To verify the time 、 Performance and system behavior are correct , It's not just right for users .
If a line of code is not executed during the test , There is no way to know whether this line of code contains errors that will occur when users use the system one day .
Conclusion
Improving code quality is not necessarily a major 、 Expensive tasks . These suggestions are easy to implement , It can even be completed in a few weeks or months . The end result will be higher quality software , Provide a better user experience , At the same time, reduce the cost of embedded development .
边栏推荐
- 我在linux里面 通过调用odspcmd 查询数据库信息 怎么静默输出 就是只输出值 不要这个
- ApacheCN 翻译、校对、笔记整理活动进度公告 2022.7
- 大厂的广告系统升级,怎能少了大模型的身影
- Nat. Commun.| 机器学习对可突变的治疗性抗体的亲和力和特异性进行共同优化
- i. Mx6ull driver development | 24 - platform based driver model lights LED
- 复数在数论、几何中的用途 - 曹则贤
- What is business intelligence (BI), just look at this article is enough
- File read write
- 湘江鲲鹏加入昇腾万里伙伴计划,与华为续写合作新篇章
- el-tree结合el-table,树形添加修改操作
猜你喜欢
From repvgg to mobileone, including mobileone code
Zhiyang innovation signed a cooperation agreement with Huawei to jointly promote the sustainable development of shengteng AI industry
Nat. Commun.| Machine learning jointly optimizes the affinity and specificity of mutagenic therapeutic antibodies
VS2019 C# release下断点调试
PMO:比较25种分子优化方法的样本效率
Use blocconsumer to build responsive components and monitor status at the same time
力扣98:验证二叉搜索树
With this PDF, we finally got offers from eight major manufacturers, including Alibaba, bytek and Baidu
30余家机构联合发起数字藏品行业倡议,未来会如何前进?
常用的开源无代码测试工具
随机推荐
TCP协议三次握手过程
MongoDB聚合操作总结
i.MX6ULL驱动开发 | 24 - 基于platform平台驱动模型点亮LED
网上开户哪家证券公司佣金最低,我要开户,网上开户安全吗
Interview question 01.01 Determine whether the character is unique
# 2156. 查找给定哈希值的子串-后序遍历
时空预测3-graph transformer
Why should garment enterprises talk about informatization?
283. Moving zero-c and language assisted array method
服装企业为什么要谈信息化?
赋能数字经济 福昕软件出席金砖国家可持续发展高层论坛
How to transfer to software testing, one of the high paying jobs in the Internet? (software testing learning roadmap attached)
NAACL-22 | 在基于Prompt的文本生成任务上引入迁移学习的设置
Mysql root 账号如何重置密码
WebGIS framework -- kalrry
ACM multimedia 2022 | counterfactual measurement and elimination of social prejudice in visual language pre training model
短视频系统源码,点击屏幕空白处键盘不自动收起
HDU - 2859 Phalanx(DP)
Use blocconsumer to build responsive components and monitor status at the same time
复数在数论、几何中的用途 - 曹则贤