RainerHahnekamp
Refactoring in Angular
via Metrics, Modularity & Testing
Rainer Hahnekamp
18. June 2024
Slide 2
Slide 2 text
RainerHahnekamp
About Me...
Professional
NgRx
https://www.youtube.com/
@RainerHahnekamp
https://www.ng-news.com
https://github.com/softarc-consulting/sheriff
● Rainer Hahnekamp
ANGULARarchitects.io
● Developer / Trainer / Speaker
Modern Spring
for Angular
@RainerHahnekamp
RainerHahnekamp
Example: cyclomatic complexity
● Counts branches per function
● Runs on a function-level
● Supported by most tools
● Invented in 70s by Thomas McCabe
Identify Implement Verify
File-level
RainerHahnekamp
Reduce complexity via divide and conquer
● Avoids intermingling
● Reduces impact of changes
● Scales teams and code
Identify Implement Verify
Module-level
RainerHahnekamp
Identify Implement Verify
Module-level
Domain
Feature
(Container Cmp.)
Data UI
(Presentational Cmp.)
Models
Domain
Feature B
Infrastructure
Feature A Feature C
Submodules: Variation I
Submodules: Variation II