Aussie AI

Code Quality

  • Book Excerpt from "Generative AI in C++"
  • by David Spuler, Ph.D.

Code Quality

Everyone has their own opinions on the best way to write software, so I'll choose to simply offer some possible options for you to discuss. Here is my list of some of the more pragmatic and useful ways to ensure code reliability as a professional software developer:

  • Lots of unit tests.
  • Lots of assertions.
  • Lots of bigger regression tests.
  • Automated acceptance testing in CI/CD.
  • Nightly builds that automatically re-run all the bigger tests that are too slow for CI/CD.
  • Warning-free compilation (as a coding policy goal).
  • Running Valgrind or other memory checkers in the nightly builds (Linux).
  • Run big multi-platform tests in the nightly builds.
  • Check return codes (as a coding policy).
  • Validate incoming function parameters (as a coding policy).
  • Use an error logger.
  • Use a debug tracing library.
  • Add some debug wrapper functions.
And here's an extra bonus one: have an occasional “testing day.” Programmers are good at random testing of OPC, but they tend not to do it much.

 

Next:

Up: Table of Contents

Buy: Generative AI in C++: Coding Transformers and LLMs

Generative AI in C++ The new AI programming book by Aussie AI co-founders:
  • AI coding in C++
  • Transformer engine speedups
  • LLM models
  • Phone and desktop AI
  • Code examples
  • Research citations

Get your copy from Amazon: Generative AI in C++