How we change what others think, feel, believe and do

| Menu | Quick | Books | Share | Search | Settings |

C Style: Standards and Guidelines (contents)

CHAPTER 10 : Programming Usage


CHAPTER 10 : Programming Usage
10.1 Elegant programming
10.2 Performance programming
10.3 Defensive programming
10.4 Error handling
10.5 Diagnostics
10.6 Integrity and Recovery
10.7 Testability
10.8 Portability
10.9 Localization
10.10 Usability
10.11 Summary

<--Prev page | Next page -->


10.7  Testability

Testing code is a very difficult and often laborious task. Making the code testable from the beginning will almost always save much time during the test period, and will make maintenance much easier.

There are several characteristics of testable code which can be aimed for during design and coding:

10.7.1  Minimize function inputs/outputs

To test a function fully, all combinations of inputs should be used and all ranges of output generated. If there are many inputs or possible outputs (parameters or other data), it will be impossible to fully test the function.

10.7.2  Minimize nesting

Each level of nesting implies a branch of some kind, which will follow or not follow the nesting. To fully test a function, all combinations of paths through the code should be exercised. Many branches means many possible paths and a geometric increase in required tests.


<--Prev page | Next page -->


Site Menu

| Home | Top | Settings |

Quality: | Quality Toolbook | Tools of the Trade | Improvement Encyclopedia | Quality Articles | Being Creative | Being Persuasive |

And: | C Style (Book) | Stories | Articles | Bookstore | My Photos | About | Contact |

Settings: | Computer layout | Mobile layout | Small font | Medium font | Large font | Translate |


You can buy books here

More Kindle books:

And the big
paperback book

Look inside


Please help and share:


| Home | Top | Menu |

© Changing Works 2002-
Massive Content -- Maximum Speed