DEV Community

Discussion on: What coding concept or practice seem commonly understood, but you never learned?

Collapse
 
tinussmit profile image
Tinus Smit

Unit Tests. It comes from years of inheriting code that did not follow proper OOP guidelines, and thus not easy to write tests for. When entire swaths of business logic sits behind Button1_Click in Blah.aspx.cs, then there's just no easy way to introduce testing.

I've since learned that it's easier to put such logic in a Class Library project, and I even sometimes just have an additional Console Application that references it and I can easily step through without all the manual steps of the UI. I understand the concept, but I just don't have the practical experience 😅