Quantcast
Channel: Unit Testing – Reskilling IT
Viewing all articles
Browse latest Browse all 16

A Quick Way to Identify Code with Low Testability

$
0
0

Following is a quick way to identify code with low testability and hence low maintainability: Take any specific public method of the class Count for number of decision points such as following: - If - For - While - Switch - Inline ifs If the number of decision points in a method is more than 15 or so, it could be taken as indication that it may get difficult to write unit tests covering all possible flows. Thus, the code will have lower testability. The number of decision points in a method is also used to define/measure cyclomatic complexity of the method, or more specifically, McCabe Cyclomatic Complexity. Thus, mathematically …

Continue reading

The post A Quick Way to Identify Code with Low Testability appeared first on VitalFlux.com | The Technology Flux.


Viewing all articles
Browse latest Browse all 16

Trending Articles