Make Validation Explicit
Posted onDoes the following method have single responsibility?
Does the following method have single responsibility?
Validation of input parameters are at the beginning of the method. If the method has code after validation, then it has not a single responsibility. How can we separate validation code for input parameters and rest of the code?
Let’s create a class that it stores a list of values and it can compute some value based on stored values. Internally elements are stored in a List. When class is created form the list of values, we can create a collector for it. There is no need for public constructor.
Cumulative time is increasing by executing tests through time. Is every lost second important?