Cyclomatic complexity is rightfully reduced using private methods?

Using private methods to reduce CC by refactoring some decision points into separate methods reduces the CC of the actual method and makes it easier to read, but it does not reduce the effort to get full branch coverage during testing.

Is it justified? What do you feel on the field?

+5
source share
5 answers

Sometimes, making application code less complex and more readable, as a result, your test code becomes more complex and less readable. However, this is not a reason not to do refactoring. The readability of production code is more important than your tests.

CC , , Mockito, .

+1

, : , . , ORM- , -... , , API, , .

, , . , , , . , . . , .

+2

. , . - ​​ , , , .

, .

.

. ? , - . , - ?

+2

, , Cyclomatic Complexity

, . CC - !

, . , , , ? , , .

+2

- , , , . , ( , ), .

Cyclomatic Complexity - , , , . , Cyclomatic Complexity , . CC . , , - . CC , . , "".

: , , . , , ( ).

switch, , . . , , . ? ? , , , , , . , , .

- , Cyclomatic Complexity , . , Micheal . .

0

All Articles