Sign up for a live Kubernetes or DevSecOps demo

Click here

Greg Sypolt

Posts by Greg Sypolt

Blog

Contributing to Open-source Projects

We love open source, and it is taking over the world. In fact, Sumo Logic has contributed code to a number of repositories, many of which are listed on the Open-source at Sumo Logic page. To have a strong and successful following, an open source project needs contributors, purpose, value, users, and great leadership. Contributors are the lifeline of open source projects, and there are loads of open source projects that unfortunately haven’t been touched in years. A great way to keep an open source project alive is to get involved and make contributions to an existing project you’re currently using. Why should you contribute? Why do firefighters volunteer? The reasons are actually similar: Give back to the community Be part of a team Fulfill a family tradition Passion for the career Where can you start to contribute? Selenium is one open source project to pay attention to. Personally, as a consumer of Selenium, it can feel good to give back to the project that I use every day, and be part of the team that has one of the hottest open source projects out there today. By contributing, you can gain exposure and experience. You don’t actually have to code to be a contributor. Let’s start reviewing the different types of roles you can take on as a contributor: Open-source Project Roles There are many skills and roles involved in an open source project. You only need to understand a project’s roles to find your place in the project. Project Lead or Committee Provides technical leadership for the project as a whole. The responsibilities include driving the project’s direction, working as a maintainer of code, enforcing standards and quality, and more. This role will be the only one with write access to the repository. They will review all pull requests from existing or new contributors. Developer Will contribute code by fixing bugs and implementing feature requests, building a formal website or re-design, or contributing logos and/or icons approved by project lead or committee. Verifier Activities may vary. You may be reproducing bugs, identifying important test coverage, preventing bugs, introducing new testing solutions, or reviewing documentation. (Yes, open source projects need testing.) Support Provides multiple ways to contribute to an open project. Some of the responsibilities include answering questions on discussion boards or mailing lists, writing and reviewing documentation, developing Get Started tutorial material, corresponding with the community, or creating screencasts on features, or tutorials on how to use the project. Getting Involved and Becoming an Open-source Contributor As technologists, we use our free time to learn new technologies. We can also use our time to contribute to an open source project that we love. Doing so is a great opportunity to work with talented people in the same field. Plus, contributing to open source projects allows you to network far outside your stiletto network of friends and co-workers. In addition, contributing allows you to brand yourself, develop new skills, and gain that valuable experience working on a virtual project. If you’re contributing to non-code tasks, ask yourself how your contribution will help others. Let’s review some contribution activities: Code As a developer, your first step towards contributing will probably be fixing a bug that has been approved by triage committee. The effort doesn’t have to start with a bug fix, but these types of contributions help the consumers of the project. You can implement a feature request or help build or re-design a formal website (for instance, Selenium). All code to be committed to the project needs to pass the existing unit and functional tests before a pull request is sent. Moderator Join a discussion board or mailing list to help answer questions about the project, features, review documentation, and more. Tutorials As a new user, the project may benefit from detailed boot camp tutorials (test automation) — initial setting up of environment, and getting to know and understanding of all the possible features, writing tests, executing tests, or exploration of how to integrate cloud solutions and continuous integration servers. Documentation You will find that documentation comes in two flavors: outdated and new. The most common problem with any software project is outdated documentation, especially when configuring your environment. Before committing updates or new documentation, ensure that you understand the project style guide. Bug Triage You can help manage project issues reported. You only need to be familiar with the open source project. As a triager, you will have conversations with the bug reporter and then either close the bug or move it into a bucket. A GitHub project may use labels to organize the bugs, features, documentation, or organize for upcoming releases. Testing Start by reviewing the existing test coverage. Then determine whether there are any critical tests are missing from the project that would help prevent bugs before merging the pull request. The coder is responsible for writing tests for new code introduced into the project. Open-source Projects for Test Automation As a test automation technologist, some projects looking for all types of contributors include Selenium, Appium, Protractor, and NightwatchJS. Conclusion One beneficial element when contributing to an open source project is that you decide what type of tasks to work on and how often you want to contribute. It’s exactly why people contribute to open source projects — It keeps things fun. One thing that prevents most people from contributing is getting past the fear. It is an amazing feeling to find out that something has been accepted by the public. I always feel rewarded when I see that one of my published blog posts has been tweeted. If you’re interested in giving back and you’ve never contributed to open source before, I strongly recommend that you give it a go. Find an open source role and set a goal for 2016. You will gain some great experience, exposure, and meet talented technologists along your new journey of open source. About the Author Greg Sypolt (@gregsypolt) is a senior engineer at Gannett and co-founder of Quality Element. He is a passionate automation engineer seeking to optimize software development quality, while coaching team members on how to write great automation scripts and helping the testing community become better testers. Greg has spent most of his career working on software quality — concentrating on web browsers, APIs, and mobile. For the past five years, he has focused on the creation and deployment of automated test strategies, frameworks, tools and platforms.

Blog

Automated Testing in a DevOps World

The objective of automated testing is to simplify as much of the testing effort as possible with a minimum set of scripts. Automated testing tools are capable of executing repeatable tests, reporting outcomes, and comparing results with faster feedback to the team. Automated tests perform precisely the same operation each time they are executed, thereby eliminating human errors – and can be run repeatedly, at any time of day. Below I’ve outline five steps how to get up and running (the right way) with automation. Step 1: Laying the Foundation The foundation is the most important element of any building, be it a house or a high-rise. It may seem like a simple part of the overall construction process, but getting the foundation right is incredibly important. Mistakes made in the foundation will only get worse as you go up. It’s known as compounding defects and it means that mistakes grow. Wait! How does this relate to automation? Proper planning will lay a solid automation foundation for project success; without it your project will be shaky and a maintenance nightmare. To avoid these potential pitfalls and keep on task, you need a good road map – start by: Planning your automation objective; Design the architecture; Training the team; Begin developing test scripts; Releasing to the wild. Throughout the onboarding process, it is important educate everyone. One of the common misconceptions of automation is that automation is a magic bullet – the initial setup and step creation will take time and effort. Automation requires effort to maintain. This needs to be factored into any planning and estimation. The principles of good programming are closely related to principles of good design and engineering. By enforcing standards, you can help developers become more efficient and to produce code which is easier to maintain with fewer defects. It’s a great opportunity to start shaping your new testing portfolio by educating everyone – they need to understand what type of testing belongs at unit, integration, and api layers when having those conversations during the sprint planning phase. Step 2: Selecting a Technology You’ve found the perfect plan and know where you want to build. The excitement is building. It’s time to start thinking about the details that can make all the difference. Choosing the right products and materials for your new home can be overwhelming. The same applies when choosing a testing framework for your automation. It is a critical part of the process. Since there are so many different testing frameworks available, it’s important to create a list of requirements to review when evaluating a framework. To help you, here are some questions to ask as you round out your requirements: Are you looking for Behavior Driven Development (BDD) framework for unit and front-end UI testing? Do you need to support browsers, mobile web, or mobile native apps? Are you looking to run your selenium test locally or in the cloud? Do you need cross-browser testing? Do you need keyword driven framework for non-technical resources? Does your team have sufficient programming knowledge for automation development? Are you practicing continuous integration and need a tool that integrates seamlessly? Step 3: Configuration Find the right pro who specializes in exactly the type of work you need done. You would never hire a plumber to do electrical work. Right? This stage is critical and can be frustrating with a lack of experience. It would be ideal to find an automation expert to design your automation architecture, teach the team the fundamental skills how to write quality tests, and continuous mentoring. If hiring an expert is not an option, I strongly suggest finding an on-site training course for everyone planning to write tests. Step 4: The Basics Every construction trade require basic knowledge of the service. I couldn’t even imagine building interior framing wall without any basic knowledge. The framing basics of your wall include the sill plate on the bottom, the wall studs (which are the vertical beams), and the top sill plate (which is the beam running across the top). It sounds simple in theory, but to get a wall plumb and square takes basic knowledge and a lot of practice. The same applies when writing automation scripts. One of the basic principles of automation is to understand how to find locators and NEVER use xPaths. It is critical that engineering teams are designing software with automation in mind. What does that mean exactly? Educate engineers how to define unique and predictable locators needed for automation. The most efficient way and preferred way to locate an element on a web page is by HTML element ID or CSS Selector. The ID and CSS are the safest and fastest locator option and should ALWAYS be the first choice. Let’s start with, only use xPath if that is the ONLY possible way, personally this is great opportunity to push back to engineering to provide predictable locators for your scripts. Here are example how to write an automation script from predictable HTML elements; HTML code with well defined locators: <div class="grid location-search-result js-store js-search-result" data-showclosed="true" data-substituted="false" data-delivery="false" data-carryout="true" data-online="true" data-orderable="Carryout Delivery" data-open="true" data-type="Carryout" data-storeid="4348" data-services="Carryout"> <a class="js-orderCarryoutNow js-carryoutAvailable btn btn--block" data-type="Carryout" data-ordertiming="current" href="#/section/Food/category/AllEntrees/">Order Carryout</a> </div> Write a script using Capybara testing framework: expect(page).to have_css('.js-orderCarryoutNow') find('.js-orderCarryoutNow').click Step 5: Let’s Code FINALLY, the construction begins! Here are my tips for getting started with writing great automation scripts. Repeatable. Automated scripts must be repeatable. You must be able to measure an expected outcome. Design Test for Scalability. The whole point of automation is to provide rapid feedback. Creating and executing large-scale automated tests need a thoughtful approach to elements in the process and a close eye on test design. Keep tests lean and independent. Easy to Understand. Scripts should be readable. Ideally, your scripts also serve as a useful form of design and requirement documentation. Speed. Your automated tests should run quickly. The end goal is to make the overall development process faster by establishing rapid feedback cycles to detect problems. Sample test using Capybara: describe "on the google homepage -", :google, :type => :feature do before :each do visit 'https://google.com/' end it "the search input field is present" do expect(page).to have_css('input#lst-ib.gsfi') end end Takeaways Your road to automation can be difficult, but it’s worth it. To it well you need the right attitude. Sometimes you will hit roadblocks. If something didn’t work, you really learn to problem solve here. The training phase is so important and incredible opportunity to master your new craft – pay attention, have the right attitude, adapt, be engaged, and never stop learning… About the Author Greg Sypolt (@gregsypolt) is a senior engineer at Gannett and co-founder of Quality Element. The last 5 years focused on creation and deployment of automated test strategies, frameworks, tools, and platforms.