Code complexity

One of the leading causes of bugs in software is the complexity of the system. Simple, well-written code is less buggy and more easily maintainable. Complex code is hard to write bug-free, and subsequently hard to maintain. 

One measurement we can use to assess our code's maintainability is called cyclomatic complexity, best described as the number of paths that go through one piece of code. The more paths going through part of our system, the more likely it is to be complex and have to cater to different parameters or conditions. This makes the code harder to read and comprehend, and therefore more likely to contain or introduce bugs.

Unreadable code is the biggest single source of bugs in software, mainly because it's hard to discern all the different paths through it, and what consequences a particular change will have on them. Thus, testing captures most, but not all, scenarios.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.135.202.203