Keyword Based Testing Automation Keyword-based test automation’s elegant, structured approach simplifies work even further, reducing the time and expense of test design, automation, and execution by allowing team members to focus on their.
Software development |
---|
Core activities |
Paradigms and models |
Methodologies and frameworks |
Supporting disciplines |
Practices |
Tools |
Standards and Bodies of Knowledge |
Glossaries |
Outlines |
In software testing, test automation is the use of software separate from the software being tested to control the execution of tests and the comparison of actual outcomes with predicted outcomes.[1] Test automation can automate some repetitive but necessary tasks in a formalized testing process already in place, or perform additional testing that would be difficult to do manually. Test automation is critical for continuous delivery and continuous testing.
There are many approaches to test automation, however below are the general approaches used widely:
- Graphical user interface testing. A testing framework that generates user interface events such as keystrokes and mouse clicks, and observes the changes that result in the user interface, to validate that the observable behavior of the program is correct.
- API driven testing. A testing framework that uses a programming interface to the application to validate the behaviour under test. Typically API driven testing bypasses application user interface altogether. It can also be testing public (usually) interfaces to classes, modules or libraries are tested with a variety of input arguments to validate that the results that are returned are correct.
One way to generate test cases automatically is model-based testing through use of a model of the system for test case generation, but research continues into a variety of alternative methodologies for doing so.[citation needed] In some cases, the model-based approach enables non-technical users to create automated business test cases in plain English so that no programming of any kind is needed in order to configure them for multiple operating systems, browsers, and smart devices.[2]
What to automate, when to automate, or even whether one really needs automation are crucial decisions which the testing (or development) team must make.[3] A multi-vocal literature review of 52 practitioner and 26 academic sources found that five main factors to consider in test automation decision are: 1) System Under Test (SUT), 2) the types and numbers of tests, 3) test-tool, 4) human and organizational topics, and 5) cross-cutting factors. The most frequent individual factors identified in the study were: need for regression testing, economic factors, and maturity of SUT.[4]
A growing trend in software development is the use of unit testing frameworks such as the xUnit frameworks (for example, JUnit and NUnit) that allow the execution of unit tests to determine whether various sections of the code are acting as expected under various circumstances. Test cases describe tests that need to be run on the program to verify that the program runs as expected.
Test automation, mostly using unit testing, is a key feature of extreme programming and agile software development, where it is known as test-driven development (TDD) or test-first development. Unit tests can be written to define the functionality before the code is written. However, these unit tests evolve and are extended as coding progresses, issues are discovered and the code is subjected to refactoring.[5] Only when all the tests for all the demanded features pass is the code considered complete. Proponents argue that it produces software that is both more reliable and less costly than code that is tested by manual exploration.[citation needed] It is considered more reliable because the code coverage is better, and because it is run constantly during development rather than once at the end of a waterfall development cycle. The developer discovers defects immediately upon making a change, when it is least expensive to fix. Finally, code refactoring is safer when unit testing is used; transforming the code into a simpler form with less code duplication, but equivalent behavior, is much less likely to introduce new defects when the refactored code is covered by unit tests.
Some software testing tasks (such as extensive low-level interface regression testing) can be laborious and time-consuming to do manually. In addition, a manual approach might not always be effective in finding certain classes of defects. Test automation offers a possibility to perform these types of testing effectively.
Once automated tests have been developed, they can be run quickly and repeatedly. Many times, this can be a cost-effective method for regression testing of software products that have a long maintenance life. Even minor patches over the lifetime of the application can cause existing features to break which were working at an earlier point in time.
While the reusability of automated tests is valued by software development companies, this property can also be viewed as a disadvantage. It leads to the so-called 'Pesticide Paradox', where repeatedly executed scripts stop detecting errors that go beyond their frameworks. In such cases, manual testing may be a better investment. This ambiguity once again leads to the conclusion that the decision on test automation should be made individually, keeping in mind project requirements and peculiarities.
Test automation tools can be expensive and are usually employed in combination with manual testing. Test automation can be made cost-effective in the long term, especially when used repeatedly in regression testing. A good candidate for test automation is a test case for common flow of an application, as it is required to be executed (regression testing) every time an enhancement is made in the application. Test automation reduces the effort associated with manual testing. Manual effort is needed to develop and maintain automated checks, as well as reviewing test results.
In automated testing, the test engineer or software quality assurance person must have software coding ability since the test cases are written in the form of source code which when run produce output according to the assertions that are a part of it. Some test automation tools allow for test authoring to be done by keywords instead of coding, which do not require programming.
API driven testing[edit]
API testing is also being widely used by software testers as it enables them to verify requirements independent of their GUI implementation, commonly to test them earlier in development, and to make sure the test itself adheres to clean code principles, especially the single responsibility principle. It involves directly testing APIs as part of integration testing, to determine if they meet expectations for functionality, reliability, performance, and security.[6] Since APIs lack a GUI, API testing is performed at the message layer.[7] API testing is considered critical when an API serves as the primary interface to application logic.[8]
Continuous testing[edit]
Continuous testing is the process of executing automated tests as part of the software delivery pipeline to obtain immediate feedback on the business risks associated with a software release candidate.[9][10] For Continuous Testing, the scope of testing extends from validating bottom-up requirements or user stories to assessing the system requirements associated with overarching business goals.[11]
Graphical User Interface (GUI) testing[edit]
Many test automation tools provide record and playback features that allow users to interactively record user actions and replay them back any number of times, comparing actual results to those expected. The advantage of this approach is that it requires little or no software development. This approach can be applied to any application that has a graphical user interface. However, reliance on these features poses major reliability and maintainability problems. Relabelling a button or moving it to another part of the window may require the test to be re-recorded. Record and playback also often adds irrelevant activities or incorrectly records some activities.[citation needed]
A variation on this type of tool is for testing of web sites. Here, the 'interface' is the web page. However, such a framework utilizes entirely different techniques because it is rendering HTML and listening to DOM Events instead of operating system events. Headless browsers or solutions based on Selenium Web Driver are normally used for this purpose.[12][13][14]
Another variation of this type of test automation tool is for testing mobile applications. This is very useful given the number of different sizes, resolutions, and operating systems used on mobile phones. For this variation, a framework is used in order to instantiate actions on the mobile device and to gather results of the actions.[15][better source needed]
Another variation is script-less test automation that does not use record and playback, but instead builds a model[clarification needed] of the application and then enables the tester to create test cases by simply inserting test parameters and conditions, which requires no scripting skills.
Framework approach in automation[edit]
A test automation framework is an integrated system that sets the rules of automation of a specific product. This system integrates the function libraries, test data sources, object details and various reusable modules. These components act as small building blocks which need to be assembled to represent a business process. The framework provides the basis of test automation and simplifies the automation effort.
The main advantage of a framework of assumptions, concepts and tools that provide support for automated software testing is the low cost for maintenance. If there is change to any test case then only the test case file needs to be updated and the driver Script and startup script will remain the same. Ideally, there is no need to update the scripts in case of changes to the application.
Choosing the right framework/scripting technique helps in maintaining lower costs. The costs associated with test scripting are due to development and maintenance efforts. The approach of scripting used during test automation has effect on costs.
Various framework/scripting techniques are generally used:
- Linear (procedural code, possibly generated by tools like those that use record and playback)
- Structured (uses control structures - typically ‘if-else’, ‘switch’, ‘for’, ‘while’ conditions/ statements)
- Data-driven (data is persisted outside of tests in a database, spreadsheet, or other mechanism)
- Hybrid (two or more of the patterns above are used)
- Agile automation framework
The Testing framework is responsible for:[16]
- defining the format in which to express expectations
- creating a mechanism to hook into or drive the application under test
- executing the tests
- reporting results
Test automation interface[edit]
Test automation interfaces are platforms that provide a single workspace for incorporating multiple testing tools and frameworks for System/Integration testing of application under test. The goal of Test Automation Interface is to simplify the process of mapping tests to business criteria without coding coming in the way of the process. Test automation interface are expected to improve the efficiency and flexibility of maintaining test scripts.[17]
Test Automation Interface Model
Test Automation Interface consists of the following core modules:
- Interface Engine
- Interface Environment
- Object Repository
Interface engine[edit]
Interface engines are built on top of Interface Environment. Interface engine consists of a parser and a test runner. The parser is present to parse the object files coming from the object repository into the test specific scripting language. The test runner executes the test scripts using a test harness.[17]
Object repository[edit]
Object repositories are a collection of UI/Application object data recorded by the testing tool while exploring the application under test.[17]
Defining boundaries between automation framework and a testing tool[edit]
Tools are specifically designed to target some particular test environment, such as Windows and web automation tools, etc. Tools serve as a driving agent for an automation process. However, an automation framework is not a tool to perform a specific task, but rather infrastructure that provides the solution where different tools can do their job in a unified manner. This provides a common platform for the automation engineer.
There are various types of frameworks. They are categorized on the basis of the automation component they leverage. These are:
- Code-driven testing
What to test[edit]
Testing tools can help automate tasks such as product installation, test data creation, GUI interaction, problem detection (consider parsing or polling agents equipped with test oracles), defect logging, etc., without necessarily automating tests in an end-to-end fashion.
One must keep satisfying popular requirements when thinking of test automation:
- Platform and OS independence
- Data driven capability (Input Data, Output Data, Metadata)
- Customization Reporting (DB Data Base Access, Crystal Reports)
- Easy debugging and logging
- Version control friendly – minimal binary files
- Extensible & Customization (Open APIs to be able to integrate with other tools)
- Common Driver (For example, in the Java development ecosystem, that means Ant or Maven and the popular IDEs). This enables tests to integrate with the developers' workflows.
- Support unattended test runs for integration with build processes and batch runs. Continuous integration servers require this.
- Email Notifications like bounce messages
- Support distributed execution environment (distributed test bed)
- Distributed application support (distributed SUT)
See also[edit]
References[edit]
- ^Kolawa, Adam; Huizinga, Dorota (2007). Automated Defect Prevention: Best Practices in Software Management. Wiley-IEEE Computer Society Press. p. 74. ISBN978-0-470-04212-0.
- ^Proceedings from the 5th International Conference on Software Testing and Validation (ICST). Software Competence Center Hagenberg. 'Test Design: Lessons Learned and Practical Implications. doi:10.1109/IEEESTD.2008.4578383. ISBN978-0-7381-5746-7.
- ^Brian Marick. 'When Should a Test Be Automated?'. StickyMinds.com. Retrieved 2009-08-20.
- ^Garousi, Vahid; Mäntylä, Mika V. (2016-08-01). 'When and what to automate in software testing? A multi-vocal literature review'. Information and Software Technology. 76: 92–117. doi:10.1016/j.infsof.2016.04.015.
- ^Vodde, Bas; Koskela, Lasse (2007). 'Learning Test-Driven Development by Counting Lines'. IEEE Software. 24 (3): 74–79. doi:10.1109/ms.2007.80.
- ^Testing APIs protects applications and reputations, by Amy Reichert, SearchSoftwareQuality March 2015
- ^All About API Testing: An Interview with Jonathan Cooper, by Cameron Philipp-Edmonds, Stickyminds August 19, 2014
- ^Produce Better Software by Using a Layered Testing Strategy, by Sean Kenefick, Gartner January 7, 2014
- ^Part of the Pipeline: Why Continuous Testing Is Essential, by Adam Auerbach, TechWell Insights August 2015
- ^The Relationship between Risk and Continuous Testing: An Interview with Wayne Ariola, by Cameron Philipp-Edmonds, Stickyminds December 2015
- ^DevOps: Are You Pushing Bugs to Clients Faster, by Wayne Ariola and Cynthia Dunlop, PNSQC October 2015
- ^Headless Testing with Browsers; https://docs.travis-ci.com/user/gui-and-headless-browsers/
- ^Headless Testing with PhantomJS;http://phantomjs.org/headless-testing.html
- ^Automated User Interface Testing; https://www.devbridge.com/articles/automated-user-interface-testing/
- ^Testmunk. 'A Beginner's Guide to Automated Mobile App Testing | Testmunk Blog'. blog.testmunk.com. Retrieved 2015-09-17.
- ^'Selenium Meet-Up 4/20/2010 Elisabeth Hendrickson on Robot Framework 1of2'. Retrieved 2010-09-26.
- ^ abc'Conquest: Interface for Test Automation Design'(PDF). Retrieved 2011-12-11.
- Notes
- Elfriede Dustin; et al. (1999). Automated Software Testing. Addison Wesley. ISBN978-0-201-43287-9.
- Elfriede Dustin; et al. (2009). Implementing Automated Software Testing. Addison Wesley. ISBN978-0-321-58051-1.
- Mark Fewster & Dorothy Graham (1999). Software Test Automation. ACM Press/Addison-Wesley. ISBN978-0-201-33140-0.
- Roman Savenkov: How to Become a Software Tester. Roman Savenkov Consulting, 2008, ISBN978-0-615-23372-7
- Hong Zhu; et al. (2008). AST '08: Proceedings of the 3rd International Workshop on Automation of Software Test. ACM Press. doi:10.1145/1370042. ISBN978-1-60558-030-2.
- Mosley, Daniel J.; Posey, Bruce (2002). Just Enough Software Test Automation. ISBN978-0130084682.
- Hayes, Linda G., 'Automated Testing Handbook', Software Testing Institute, 2nd Edition, March 2004
- Kaner, Cem, 'Architectures of Test Automation', August 2000
External links[edit]
- Test Automation Snake Oil by James Bach
- When Should a Test Be Automated? by Brian Marick
- Success Factors for Keyword Driven Testing by Hans Buwalda
- Automation That Learns: Making Your Computer Work for You by Jeremy Carey-Dressler
- Automation Testing Resources & Best Practices by Joe Colantonio
Retrieved from 'https://en.wikipedia.org/w/index.php?title=Test_automation&oldid=947027344'
Why is Automation Testing critical in a Software Lifecycle?Imagine this.On your first day as a QA, you have to test an application that includes about 100 fields that require input. When conducting exploratory testing, you have to insert input manually in each field. This takes about 10 minutes to do if you are really fast.You press Submit. An error message appears. It looks like an unhandled exception. You report the bug and feel really good about a job well done. You repeat the process, find a few more bugs and have a generally productive first day.The next day, the developer fixes the issues and you have to test the new version of the software, repeating the same steps as the day before.
Job well done. A good user experience ensured, thanks to your efforts.On the third day, developers have released a newer version with newer features. But in order to ensure that the new features have not broken the older working features, you have to repeat the process again. No issues found.A month onwards, developers are releasing newer versions continuously, which means you have to keep testing the software, repeating the same process (inserting field input) every time.
You are bored and tired. Your accuracy begins to waver, as a result of which you eventually end up missing a bug – possibly a rather obvious one.Believe it or not, this is a fairly common scenario for most QAs. It is not possible to do the same thing over and over again and be perfect at it every time. This is where automation testing comes in.
Can a software test another software?Yes. That is the whole point of automation testing. When it comes to regression testing, investing manual effort is futile and wasteful. Instead of expecting humans to repeat the same steps with the same speed, accuracy and energy, it is far more logical to program a machine to do the same.
What tests should be automated?Before creating an automation strategy, let’s have a look at which tests are most feasible for automation:.: Regression suites are ever-increasing, and require the same variables to be filled numerous times to ensure that new features do not tamper with older functions. This can easily be automated.
Testing of complex functionalities: Automate all tests requiring complex calculations, something prone to human error. Smoke testing: Run automated suites to verify the quality of major functionalities. This saves time by offering a quick analysis of whether a build requires more in-depth testing. Data-driven testing: Automate tests to validate functionalities that must be tested repeatedly with numerous data sets. Performance testing: Automate tests that monitor software performance under different circumstances.
Doing this manually would be extremely painstaking and time-consuming.: Every time a developer submits a PR, functional testing needs to be executed quickly and provide immediate feedback. This is impossible to achieve without automation, especially as organizations scale up.Getting Started with Automation TestingWhen transitioning from manual to automation testing, keep the following points in mind:.
Do not aim for 100% test automation. Not all tests can be automated. Even among tests that can be automated, do not set an initial target of complete automation. Set a realistic goal. For example, start by moving a few tests to automation. Write smaller test cases that can be easily reused in future tests of the same software.
Map test cases with corresponding functions to provide better test coverage. Label test cases so that teams can have clarity on what to automate as well as report more effectively. Explore new areas of the application with automation. When chalking out automation strategies, ensure that business requirements are taken just as seriously as technical considerations.
Know what not to automate. This helps to decide the scope of automation early in the ideation process. The following tests are best left to manual coverage:. User experience testing: Tools cannot replicate any user journey in its entirety.
It is impossible for an algorithm to predict how individual users will interact with an application. In order to actually judge the quality of user experience, stick to human testers. Try using manual interactive testing tools like. Accessibility testing: When testing how accessible an application is, there is no substitute for human usage. A tool cannot measure accessibility because every people often have different opinions on what counts as accessible. It is not possible for a tool to recognize if software workflow is providing easy access for actual humans. Select the right toolsAutomation testing is entirely dependent on tools.
Here’s what to consider when choosing the right tool:. The nature of software: Is the application being tested web-based or mobile-based? To test the former, use a tool like to automate your tests.
For the latter, is one of the best possible tools for automation. Programmer Experience: Choose frameworks, languages, and tools that match testers’ comfort and experience. Some of the most popular languages used for automation testing include Java, JavaScript, Ruby, C#, etc. Open Source or not: Depending on budget constraints, one may choose to use open-source tools such as Selenium or Appium for automation purposes. However, it is important to remember that all open-source tools are not inferior to their commercially available counterparts.
For example, is an open-source tool that is most highly favored by automated testers around the world. Select the right test gridThe test grid refers to the infrastructure that all automated tests will run on. It comprises a series of devices, browsers and operating systems (multiple versions) that software is to be tested on.
It is always best to automate tests on. This will ensure that software is being tested in.Additionally, the ideal test grid should enable. This means that testers should be able to run multiple tests on multiple devices simultaneously.
This cuts down on test time, expedites results and offers results within shorter deadlines.