What I Learned about Tests while being a Software Developer
Paulo Figueiredo
Sr Platform Engineer | AWS SA Pro Certified, Python, Cloud Infrastructure, Software Development.
Nowadays, testing is not only an act of pushing buttons, testing has an intrinsic relation to programming. One of my responsibilities, in addition to programming, is to increase test coverage through automation. This includes diversifying scenarios by running tests on a great variety of operational systems and browsers.
It is interesting to observe that a simple test code for a scenario that opens a browser, accesses a web page and pushes a button can take an exceptional dimension. Imagine running the same scenario in the browsers most known by the market, in the operational systems most used by customers, moreover in the 32 and 64 bits architecture, well, the following table help with the math:
The math is simple, multiply the amount of versions by the amount of architectures and then with the amount of browsers, in other words, a simple scenario that consists of pushing a button on a web page can have 72 executions. Imagine now, hypothetically 85 interaction scenarios in a web page, tested in the same scope, the total amount of tests will jump to 6120 executions.
The variation of the same scenario into different environments does not only avoid bugs, but it also does contribute to identify corner cases, which are problems caused by unexpected parameters that fail when environment variables and process conditions are in their higher levels.
In addition, this automated heterogeneous environment can also provide data to identify flaky tests, the kind of test proposed by Google in this analysis and shows the relation between environment resources with tests that passes and fails on the same code.
As stated, the most interesting part of creating test scenarios is not only composed of buttons actions but on the automation itself, that in addition to writing code, enables the acquisition and maintenance of an integrated view of the software that can also contribute to the corporation’s business model. For mature developers, the impact occurs not only in the code quality but in the feeling of achievement of having written a piece of code that works.
In summary, tests are really important! They help you identify bugs even before they occur in production. Finally, in addition to the fact that testing and automation practices brings benefits to software quality, it also makes you a better programmer.
Originally here in Portuguese.