Programming Pearls Col 5 – A Small (but very important)Matter of Programming

Col 5 is all about the Science and Art of Testing (rules and where, when and how to apply the rules).

-Define expected output

-Cover all cases

-C/C++ Compile-time assertions:

Further reading: https://www.embedded.com/electronics-blogs/programming-pointers/4025549/Catching-errors-early-with-compile-time-assertions

-When the algorithm is part of a big program, use scaffolding/automated testing/line-by-line debugger

-When the algorithm is stand-alone, print statements might be faster

-Be wary of bugs in different environments, experiment with them frequently to gain insights for fixing bugs

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s