Sunday, March 21, 2010

How to improve the code readability/maintenability

After reading this thedailywtf-Unit-Tested article.
I thought that i can add my knowlege how switch from bad code to readable code.

The main concept of the article that i read, that if you add code coverage and a lot of unit test, its great way to improve the software project. And this is only half of the true.

The true is, that when you upgrade to testable code , you just change some code metrics .
This metrics can be calculated by your IDE, the name of the metrics is Coupling and Cyclomatic Complexity.
After that i am play with this metrics (in this game, you need to reduce as much as possible the coupling and CC), the readability of my code is improved drastically and the bugs start to disapear.

No comments:

Post a Comment