Continuous Testing
Total Page:16
File Type:pdf, Size:1020Kb
THE ULTIMATE GUIDE TO CONTINUOUS TESTING Everything you need to know to shift-left testing and reach testing maturity CONTINUOUS TESTING: TODAY’S GOLDEN STANDARD At Abstracta, we believe that Agile development, There are several software quality assurance activi- along with the practices that it promotes such as ties to focus on that will help you in your efforts to continuous integration, continuous testing and reach an efficient continuous integration environ- continuous delivery (CI/CT/CD), is the key to remai- ment, allowing for the quality checks you want to ning competitive in today’s technological landscape. have in each build. For an Agile environment to flourish in your organi- In this guide, we will tackle the various areas in zation, testing needs to happen earlier on in develo- which we can group these activities so you may pment than it does in traditional development envi- have a clear picture of what your team must work ronments like waterfall. We call this “shift-left on in order to make progress in your testing matu- testing” and it’s imperative for Agile teams to truly rity and, ultimately, reach continuous testing! succeed. Let’s Begin! TABLE OF CONTENTS ABOUT THE AUTHOR Introduction Federico Toledo is a co-founder and director of Abstracta and holds a PhD in The Source Code Computer Science from UCLM, Spain. Environments and Infrastructure With over 10 years of experience in quality engineering, he's helped many companies Bug and Incident Management to successfully improve their application Test Management quality. He is dedicated to testing educa- Functional Testing tion, having written one of the first books in Spanish on testing and formed Abstrac- Test Automation ta Academy. He is also a co-organizer of Performance Testing TestingUY, the biggest testing conference in Latin America. Security Testing Usability Testing Levels of Testing Maturity Conclusion P2.1 [email protected] © Abstracta. THE ULTIMATE GUIDE TO CONTINUOUS TESTING INTRODUCTION INTRODUCTION "Agility basically facilitates competitiveness. To When you shift testing left, among many other bene- compete in today's environment, you must act and fits, you can achieve continuous testing, executing react fast, otherwise your competition will simply automated checks as part of the software delivery beat you to it. Today, the barrier to compete is mini- pipeline to obtain immediate feedback on the mal, and the only way to defend one's stature is by business risks associated with a software release innovating in short iterations and basically mea- candidate. Continuous testing also involves early and ning adopting Agile." frequent testing, proper code management, and adjusting the various quality-related tasks over time — Alon Girmonsky, CEO, BlazeMeter to maximize the efficiency of the whole process. Some of the key benefits of continuous testing include: Lower the cost of development Reduce waste Reduce risk upon release Increase system reliability Release to production faster Compete more fiercely in the marketplace Many teams today are trying to build or refine their continuous testing machine. We believe that in order PEOPLE to improve the results of software production, it’s necessary to consider three fundamental pillars that are closely linked together: processes, tools and people. Teams can improve by bettering their proces- ses, but the tools and the team members must also TECHNOLOGY PROCESSES adapt in order for the new and improved processes to stick. For example, within Agile, teams may find themselves in frameworks like Scrum that create a process, for which they will find themselves using various types of tools for everything from communication to task management and there will typically be great focus on the motivation and commitment of the team. All aspects of Agile approaches are well designed to be adaptable to change, which is its main focus. The idea is to assume that what the customer needs is not fixed nor established in a contract. Thus, it is essential to work on constant adaptations in a way that does not cause the project costs to skyrocket or become unmanageable. What is needed to adapt to change and yet maintain a high level of quality? For any team, the most typical problem that arises when introducing changes in a system is fear: fear of breaking something that was already working before and not realizing it until after it has reached the customer's hands. When a user is given a new version of the application, there is nothing worse than finding that what always used to work no longer does. P2.1 [email protected] © Abstracta. THE ULTIMATE GUIDE TO CONTINUOUS TESTING INTRODUCTION THE SOURCE CODE To address this problem, teams must be able to There are dozens of tools to support these automa- detect any errors of any kind as soon as possible. ted systems, some as old as Ant, Maven and MSbuild, When speaking of errors, we are referring to any kind configuration management tools as Chef, Puppet or of error or bug: a miscalculation, performance Ansible, to popular CI tools such as Jenkins, Cruise- problems, security vulnerability, aspects of usability, Control, Bamboo and TeamCity. And if that were not maintainability problems (e.g., code quality factors) enough, there are also cloud solutions like Amazon or anything that may inconvenience a user. And what Pipeline Code, TravisCI, CircleCI, Codeship and Micro- we mean by “as soon as possible” is as soon after soft’s Visual Studio Team Services (to name a few). when the error was inserted into the system as possi- ble. So, all one has to do to have continuous testing and continuous integration is simply implement Thus, important practices like continuous testing, one of these CI tools and then quality will be which goes hand in hand with continuous integra- baked into everything. Right? tion (CI), emerge and gain importance for Agile teams. Wrong. Basically, continuous integration proposes building The problem is that many teams fall into this very and testing the solution frequently, building a poten- fallacy and overlook many preconditions for conti- tially customer-shippable product with a frequency nuous testing and CI that must be met beforehand, that depends on each team, varying from one new resulting in failure. Some of the preconditions include version after each commit to one every day or week. the proper handling of code version management, Continuous integration tools allow for defining a incident management, data and environment mana- sequence of tasks to be performed automatically, gement, automated checks at different testing levels among which typically include: (unit, build tests, API, UI), performance tests, internal code quality and so on. Updating code to the latest version Building the solution Fortunately, this guide will help you navigate Automated checks through several of the hoops your test team Code quality checks has to jump through on your path to conti- Security checks nuous testing (the highest level of testing maturity according to our maturity model) all And the list can go on with hundreds of integrations the while igniting the shift from traditional and tests that one may wish to add. quality assurance to quality engineering. THE SOURCE CODE Code Management With code being such an important asset, a risk that’s This is one of the most precious assets of any develo- essential to have under control is making sure to pment team because in it lies all of the work. In fact, it properly manage it and any amendments made is the only artifact that every project will always need thereto. There are specific tools to do this that are to build. Many teams don’t document it, nor make made for working with a centralized repository where certain types of tests for it, but without code, there all team members can reliably store it. is no software. So, code is the one thing that softwa- re development teams will always have. This provides Today’s tools have evolved in terms of task focus, the guideline that it’s a fundamental area to pay going from simple schemes like CVS to more sophisti- attention to in order to control quality and reduce cated and flexible ones like Git. What they allow, risks and costs, no matter what the organization’s some to a lesser or greater extent, is to have the code goals and context may be. in a centralized location. Each developer can submit code, consult it, retrieve previous versions (which is When considering source code, we are referring to useful when your code is not working properly and several things, but we’re mainly referring to code you need to go back to the previous working version), management and code quality. Both aspects should be add comments to each “commit” made (e.g., considered in order to achieve a good continuous comments indicating why one decided to send testing approach. certain code to the repository) and much more. P2.1 [email protected] © Abstracta. THE ULTIMATE GUIDE TO CONTINUOUS TESTING THE SOURCE CODE These tools are also accompanied by a methodology. standards and coding conventions nor implementing In particular, this is reflected in how the branches of unit testing) then at that very moment, “debt” accu- the versions are administered (approved, removed, mulates. The system is owed whatever it may be that merged, etc.), which allows for different people to was hastily foregone, for example, unit tests, putting work on different versions of the code. There are them off for when time allows. those that maintain a branch for each customer (if each has different code), or a branch for larger What’s the problem with that? Besides repaying the versions of code, or at a finer level, where a new debt, “interest” will be added on so to speak, since it’s branch is opened for each functionality or fix someo- likely to take longer and more energy to fix things ne makes.