panic
panic copied to clipboard
Investigation: Spot code related improvements in the Channels Manager source code
Rationale
In this ticket we should go through the Channels Manager source code to spot areas that can be re-written in a better way. Such code improvements may include the following:
- Decomposing complex/long logic into granular functions
- Decomposing large if clauses into functions for better readability
- Investigate whether we can use some already established design patterns that can improve the code-base
- Make variable names more readable where necessary
- Remove code duplication where necessary (meaning we should abstract out functionality that is commonly being done across functions/classes)
Points 1 and 2 above will enable us to write more granular, effective and readable unit tests. Therefore, after completing the refactoring we should visit the unit tests and perform the following:
- Each unit test must be designed in such a way that it tests out a specific requirement of the component
- Each unit test should be granular and checks one specific case. If more related cases are to be tested, we should use
parameterized.expand - We should not add unit tests just for code-coverage.
- We should create variables that are used in many
setUpfunctions inside thetest-utilsfolder. This will enable us to have shorter test scripts and remove code duplication.
For ticket closure
We must create a ticket for every type of improvement we aim to do.