If you're within the business of making Quality software package, daily will offer a surprise or 2. however one overcomes these every day challenges typically defines the course of your success. Here's one such challenge we have a tendency to recently faced , we have a tendency to thought of sharing with you. we might like to hear your feedback.
Like any sensible software package developer, we have a tendency to tend to treat breaking backward compatibility as against the law and work flat out to shield our end-users from facing any consequences ensuing from sudden changes. That said, we have a tendency to sleep in a world wherever modification is that the solely constant! it is usually a challenge to soak up the changes.
For our Scriptless check Automation platform, we have a tendency to use element WebDriver to move with the Browsers. we have a tendency to typically use a stable version of element webdriver as a final analysis for our own development. However, we have a tendency to find yourself supporting multiple versions and mixtures of supported browsers/OS mixtures, as our customers demand it. throughout the regression section of a selected product update unharness, our QA team reported a problem that every one the mouse actions (MouseHover, MouseUp, MouseDown) weren't operating with the atomic number {34|chemical element|element|antioxidant} WebDriver version 3.6+
We investigated the difficulty and patterned that within mouse actions (in the Qualitia Engine code), we have a tendency to use Locatable Apis. we have a tendency to found that these Locatable API had been refactored (as well as deprecated) by atomic number {34|chemical element|element|antioxidant} community in SE 3.6+ and also the community counseled to use Actions API that they supported since SE three.0+.
Though the challenge, henceforth, was getting to be maintaining backward compatibility with atomic number {34|chemical element|element|antioxidant} versions in Qualitia (at least post SE 3.0), any of the higher than changes would be straightforward if we have a tendency to did not care concerning backward compatibility. on the other hand ideally we've users exploitation varied atomic number {34|chemical element|element|antioxidant} 3.x versions. we have a tendency to had no possibility however to mend this issue in Qualitia five.0 in an exceedingly manner that works across all the atomic number {34|chemical element|element|antioxidant} 3.x versions.
We additionally discovered that Locatable may be a primitive manner of accessing mouse actions that the community was forced to maneuver to Actions API and therefore, they did not care refactoring them. This basically caused breaking changes. once group action, we have a tendency to might come back up with many approaches as solutions for this issue:
Potential resolution 1: The seemiingly obvious resolution was to switch Locatable package statements with new package structure statements (which SE three.6 had introduced) and compile the code with atomic number {34|chemical element|element|antioxidant} 3.6. The code would have with success compiled. However, it might have thrown runtime exception for those mouse actions (MouseHover, MouseUp, MouseDown). this may happen since Java would not realize the package structure in earlier versions, that is supposed for SE three.6. we have a tendency to born this resolution.
Potential resolution 2: Use Locatable Apis associate degreed write code to handle Mouse actions in element version in an agnostic manner. the concept was, if mouse actions fail at runtime (due to sudden package import) catch that Exception (which means that user should be exploitation pre-SE three.6 version) and expressly decision the Pre SE three.6 package structure (i.e. older totally qualified Locatable package to invoke Mouse actions on Pre SE three.6).
The pseudo code would look one thing as follows:
try
catch(RunTimeException e)
This element version specific exception based mostly code and exploitation deprecated Locatable did not appear to be clean and promising manner. creating element version assumptions for the run-time exception will flip anytime into a disaster.
Potential resolution 3: Use Actions API and alter the whole implementation whereas maintaining the backward compatibility. Since Actions API is supported post three.0+, it might be terribly safe to use them. Moreover, SE community additionally recommends to use them over primitive manner of exploitation Locatable mouse action. we have a tendency to additionally accomplish backward equivalence. There would be virtually no impact to the Qualitia user, since for her, in her scriptless Qualitia steps, mouse action name and parameters would stay a similar. (Although, technically speaking, the parameters would get neglected within the latest API, however that will not break something for the user.)
We set to travel for resolution three. For the Qualitia User, nothing changes as we have a tendency to set to measure with optionally acceptive the parameters, that don't seem to be employed by the API. The recent check cases can still operate with none impact. The Qualitia user would blissfully be unaware of the changes happening below the hood!
With support from its vivacious community and also the perpetually evolving landscape of browser-based technologies, element can still evolve! it is also expected that when in an exceedingly whereas we've to face breaking changes. we should always attempt to stay our code the maximum amount future-proof as potential and maintain backward compatibility, whereas doing therefore.
Writing Quality software package may be a powerful job! particularly once the surroundings encompassing you is consistently evolving.
No comments:
Post a Comment