Mostrar mensagens com a etiqueta C++. Mostrar todas as mensagens
Mostrar mensagens com a etiqueta C++. Mostrar todas as mensagens

quinta-feira, 2 de abril de 2020

Unit Testing: cmocka - unit testing framework for C

A unit testing FW for Embedded? Yep.
Details here:
cmocka - unit testing framework for C



Quoting:

"

cmocka is ...

an elegant unit testing framework for C with support for mock objects. It only requires the standard C library, works on a range of computing platforms (including embedded) and with different compilers.

"




domingo, 29 de março de 2020

SW Development: MISRA Coding Standards

An article (from a tool provider, not affiliated) on MISRA C and C++ coding standards and some example rules:
https://www.perforce.com/resources/qac/misra-c-cpp

SW Development: About C++ Adoption (in Embedded)

An article on (the lack) of the latest C++ adootion, C++ 17 and the possible reasons, and the statement that 70% of embedded systems being developed in C:

https://www.perforce.com/blog/qac/should-i-adopt-cpp17

Quoting:
"

Pros and Cons of C++17 Features

The latest version of C++ includes features that improve your code, performance, and security. While these are nice features, they're not earth-shattering. 

Algorithm Optimization

One of the biggest additions is the introduction of the parallel algorithms library.

Multi-processor systems are required for computer-intensive programs and artificial intelligence. The parallel algorithms library makes it easier to execute standardized algorithms on this type of system. 

Cleaner Code

There are two features that will enable cleaner code:

  • Selection statements with initializer.
  • Structured bindings.

This also reduces keystrokes for those who understand the syntax.

So, these features provide a step up for cleaner code. 

Interested in writing cleaner code? Get coding best practices for C++ >>

Better Performance

“Guaranteed copy elision” is designed for improved compiler optimization. So, it may improve runtime performance. 

Safety and Security

The latest C++ features will improve the safety of your program and ensure secure coding, including the following:

  • Removal of trigraphs and dynamic exception specifications.
  • Stricter order of expression evaluation. 
  • Introduction of std::byte type.

The first two features prevent unspecified or undefined behavior. 

The std::byte feature improves type safety. It distinguishes byte-oriented access to memory from accessing memory as a character or integral value. It also improves readability. The intent of the code is clearer.

Learn more about the changes from C++14 to C++17"

quinta-feira, 18 de julho de 2019

Security: A proactive approach to more secure code (MSRC, article)

Security starts at the coding activity... See he quote:

A proactive approach to more secure code – Microsoft Security Response Center

Quoting:

"Since 2004, the Microsoft Security Response Centre (MSRC) has triaged every reported Microsoft security vulnerability. From all that triage one astonishing fact sticks out: as Matt Miller discussed in his 2019 presentation at BlueHat IL, the majority of vulnerabilities fixed and with a CVE assigned are caused by developers inadvertently inserting memory corruption bugs into their C and C++ code. As Microsoft increases its code base and uses more Open Source Software in its code, this problem isn’t getting better, it’s getting worse. And Microsoft isn’t the only one exposed to memory corruption bugs—those are just the ones that come to MSRC."

The PDF presentation can be found here:

https://github.com/microsoft/MSRC-Security-Research/raw/master/presentations/2019_02_BlueHatIL/2019_01%20-%20BlueHatIL%20-%20Trends%2C%20challenge%2C%20and%20shifts%20in%20software%20vulnerability%20mitigation.pdf



quarta-feira, 4 de abril de 2018

TOOL: Coco Code Coverage

Multiple-platform/compiler code coverage tool:
https://www.froglogic.com/coco/free-trial/

Quoting:
"Coco

Cross-platform and cross-compiler code coverage analysis for C, C++, C#, SystemC, Tcl and QML code.


Coco utilizes source code instrumentation to analyze the applications’ source code.

No changes to the source code are necessary.

Executing a test suite against an instrumented application produces data that can later be analyzed. This analysis can be used to understand how much of the source code has been hit by tests, which additional tests need to be written, how the code coverage changed over time and more."

segunda-feira, 26 de março de 2018

SW Construction: Rust, the new safe, performant language (from Mozilla)?


Quoting:
"Rust is meant to be fast, safe, and reasonably easy to program in. It’s also intended to be used widely, and not simply end up as a curiosity or an also-ran in the language sweepstakes. Good reasons abound for creating a language where safety sits on equal footing with speed and development power. After all, there’s a tremendous amount of software—some of it driving critical infrastructure—built with languages where safety wasn’t the first concern."
(...)
"The Rust team is conscious of many of these issues, and it has plans on the 2017 Rust roadmap to improve them. For example, to make Rust easier to work with C and C++, the Rust team is investigating whether to expand projects like bindgen, which automatically generates Rust bindings to C code."

quinta-feira, 27 de outubro de 2016

SW Construction: Let's do it like they do it on space? | NASA Coding Conventions

So I remembered that some (oldie but for sure goldie) coding conventions are freely available from NASA JPL, several languages available:
https://www.google.pt/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=nasa%20jpl%20coding%20standards

FFR. But meanwhile you can start applying it (and doing "IT" like they do it on - i,e. for - space)