Like in anything we do there is the way you are currently doing it and there are people doing it in a way that makes sense, it makes so much sense that once you hear about it, you will do it that way too.
A principle is a law or rule that has to be, or usually is to be followed, or can be desirably followed, or is an inevitable consequence of something, such as the laws observed in nature or the way that a system is constructed.
Schools have principles, nurses have principles too, so it’s not even a new idea
Nothing is ever as easy as it looks…
Baking can often be referred to as the chemistry of cooking. All ingredients must be accurately measured, and measurement is critical.
Back to SOLID principles, Wikipedia says:
In computer programming, SOLID (single responsibility, open-closed, Liskov substitution, interface segregation and dependency inversion) is a mnemonic acronym introduced by Michael Feathers for the “first five principles” named by Robert C. Martin in the early 2000s that stands for five basic principles of object-oriented programming and design.
The principles of SOLID are guidelines that can be applied while working on software to remove code smells by providing a framework through which the programmer may refractor the software’s source code until it is both legible and extensible. It is part of an overall strategy of agile and Adaptive Software Development.
One of the biggest struggles that developers have is the integration their code into the live environment. As part of this continuous integration process automation also needs to be planned, designed, developed, maintained and extended over time.
When SOLID principles are not applied, your automation scripts might become fragile, hard to maintain and extend at some point.
What Are The SOLID Principles?
SOLID stands for:
- S – Single Responsibility Principle (SRP)
- O – Open Closed Principle (OCP)
- L – Liskov Substitution Principle (LSP)
- I – Interface Segregation Principle (ISP)
- D – Dependency Inversion Principle (DIP)
I found a video that explains SOLID with some good examples
I found another video series that explains SOLID principles in more detail.
Automation testing is now seen as an important role in the Continuous Integration software life cycle process, so it makes sense to have SOLID guiding principles were testers can become more efficient with their testing.