DEV Community


Discussion on: What programming best practice do you disagree with?

gergelypolonkai profile image
Gergely Polonkai

During my 18 years of professional career unit tests saved my life so many times.

I agree that you probably donʼt need it for UI components, but the business intelligence should be thoroughly tested. Put the BI stuff in its own function, write tests for that function, then bind it to any UI element you like. Now if you change another thing your BI depends on, your BI related unit tests will fail regardless of your button.

Unit tests are what they advertised as: utilities to test your units. The smaller these units are, the easier to test.