Lately I’ve been hearing a lot about Functional Programming (FP), so I felt inspired to give some love to object oriented programming (OOP) and object oriented design (OOD) as well, since they are still very relevant when we design our systems.
With your permission, I’d like to start our journey with SOLID principles, which are class-level, object-oriented design concepts that, in conjunction with an extensive test suite, helps you avoid and combat code rot. Coined by every coder’s favorite uncle, Robert C. Martin (Uncle Bob), SOLID is actually a conglomerate of five other acronyms–SRP, OCP, LSP, ISP, DIP–that I’ll go into more deeply below; among other things, SOLID principles help you to keep the primary value of your software high.
Software has two quality metrics, external and internal quality. External quality is how well the system meets the needs of its customers and users (is it functional, reliable, available, responsive, etc.), and internal quality is how well it meets the needs of its developers and administrators (is it easy to understand, easy to change, etc.).
For measuring external quality, we have to write acceptance tests that test our system end-to-end. An end-to-end test interacts with the system only from the outside: through its user interface, by sending messages as if from third-party systems, by invoking its web services, by parsing reports, and so on. At ZeroTurnaround, we rely on Selenium for acceptance testing, so it was cool to find out a couple of months ago about Selenide (we suspect it’s pronounced as SEL-le-nide, rhymes with tide), which we now use for tests for UI activities in LiveRebel, our “bulletproof release tool”…