Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Test Automation Mindset & Best Practices

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.

Test Automation Mindset & Best Practices

It was an offline event in Cairo, Egypt about the Test Automation Mindset & Best Practices including the following topics:
- Challenges
- Importance of Testing
- Test Automation Mindset
- Quality at Scale
- Integrating AI into Software Testing

Avatar for Moataz Nabil

Moataz Nabil

June 21, 2024
Tweet

More Decks by Moataz Nabil

Other Decks in Technology

Transcript

  1. Test Automation Mindset & Best Practices Moataz Nabil Manager, Quality

    Engineering - Platform Engineering Coworker, RTG Cairo, Egypt June 10, 2024
  2. WHO AM I? • EX. Cequens, Integrant, Zalando SE, Delivery

    Hero SE and Bitrise. • I've worked in a variety of business sectors, including (Agriculture, Telecom, Healthcare, Fashion and Food Delivery) • Participate in and design various test automation frameworks for Web and Mobile applications using various tools and languages. • Implementing various CI/CD pipelines with various tools. • Book Author of Mobile DevOps Playbook, AWS Community Builder, Technical Trainer and Speaker. /in/moataz-nabil/ @moatazeldebsy moatazeldebsy
  3. AGENDA • Challenges • Importance of Testing • Test Automation

    Mindset • Quality at Scale • Integrating AI into Software Testing • Q&A
  4. Testing helps to evaluate if the software meets the specified

    requirements and functions as intended. It uncovers bugs and defects, ensuring the delivery of a high-quality product. Importance of Testing
  5. Challenges • Pressure to deliver new features can hinder thorough

    testing. • Siloed teams cause communication breakdowns and lack of collaboration. • Outdated legacy systems and technical debt challenge new testing approaches. • Manual testing is time-consuming, making it hard to keep up with development pace. • Developer costs spent on finding and fixing errors. • Live Incidents. • Shipping code (releasing) is a painful process, releasing every 3 months. • Customers Churn.
  6. Based on the book Accelerate: The Science Behind DevOps There

    are 6 key processes for accelerating software development and delivery in a company.
  7. Key capabilities to accelerate Software Delivery 1. Use a trunk-based

    development process (feature branches, small batches) 2. Implement test automation 3. Shift-left on testing and security 4. Automate the deployment process 5. Support test data management 6. Implement Continuous Integration (CI) and Continuous Delivery/Deployment (CD)
  8. Team burnout is a common issue in software testing roles,

    often caused by the repetitive nature of tasks. testers may struggle to consistently perform these tasks, particularly as software apps evolve and grow. Why it's important to build reliable automated tests?
  9. A good Test Automation Strategy is: • A cost-effective test

    automation strategy with a result-oriented approach. • Helps businesses keep pace with the market and avoid any major technology failures. Test Automation is a project that requires a strategy
  10. Why Testing Strategy is necessary? • Apps become more complex

    and modules become more diverse • Teams are growing and become Large Engineering Team • Serving millions of customers everyday
  11. Automation Testing Strategy • Test strategies are guidelines that QA

    teams follow in order to achieve the quality-related objectives they set for software products • Deciding on the scope of automation. • Balancing short-term and long-term goals. • Risk-based testing approach. • It explains how testing will be conducted in a way that is understandable to all parties.
  12. The Benefits of Test Automation Reduce the cost of development

    by reducing the delays and defects: • Will find the defects as early as possible In the development stages(test early and often) • Reduce debugging time. ◦ If we have valuable automated tests this will reduce the debugging time by figuring out the root cause. • Reduce delays because with manual tests the developers will wait till the QAs/QCs engineers to finish the tests.
  13. But we have challenges due to… • Rapid Development Cycles

    • Complexity of the Application • Choosing the Right Test Cases • Integration Issues • Tool Limitations • Test Data Management • Maintenance Overhead • Skill Set Requirements • Integration with CI/CD Pipelines • Flaky Tests • Environmental Dependencies • Costs
  14. Transformation in the Quality mindset 1. Quality is a shared

    responsibility 2. Preventing instead of detecting 3. Continuous testing over testing at the end (DevTestOps)
  15. 1# Quality is a shared responsibility Transformation in the Quality

    • Sharing the automated testing ownership between Test Engineers and Developers. ◦ Encouraging collaboration between developers, testers, and other stakeholders. • Promoting a test automation mindset across the team. ◦ Continuous learning and skill enhancement. ◦ Staying updated with latest trends and technologies.
  16. Shift-Left Testing • Integrating testing in the early stages of

    SDLC makes it easier and more cost-effective to fix any issues found, compared to finding them later in the development process. • Thorough testing before release helps minimize bugs and frustrations for end-users, leading to better user experience and satisfaction. • By catching bugs early, testing helps developers focus on writing better code and streamlines the overall development lifecycle.
  17. Techniques for shift-Left Testing • Static code analysis (Does the

    code have errors or Lint warning?) • Unit (Do a unit work as expected?) • Integration (Do multiple units work together?) • E2E (Do complex flows across various pages or brands work? Can a user accomplish a complete journey or flow?) • Regression (Do the changes to a feature or function have broken other parts of a app or the system?)
  18. Choosing the right Test Automation Tool ▪ Handle most of

    the challenges ▪ Flexibility (ex: handling locators) ▪ Easy to understand ▪ Collaborate between development and test engineers ▪ Learning resources and documentation ▪ Community support
  19. • Writing Maintainable Tests ◦ Code quality and readability. ◦

    DRY principle (Don’t Repeat Yourself). ◦ Modular and reusable test components. • Test Design ◦ Creating stable and reliable tests. ▪ Writing tests that are independent and isolated. ▪ Using data-driven and keyword-driven approaches. Best Practices
  20. Shift-Right Testing • Continuously monitoring the performance, stability, and user

    behavior in the live environment • Helps identify issues and optimization opportunities that were missed during earlier testing • Identifying issues that were missed during earlier testing • Using automated scripts to simulate user interactions and test the system's behavior
  21. Techniques for shift-Right Testing • Synthetic testing/monitoring • Canary releases

    • A/B testing • Monitoring and observability ◦ Application performance monitoring (APM) ◦ Error tracking and logging
  22. Unifying Shift-Left and Shift-Right Testing Shift-Left Testing ◦ Begin testing

    early in the software development lifecycle. ◦ Focus on unit tests, integration tests, and API tests. ◦ Use automation to identify defects as soon as possible. Shift-Right Testing ◦ Gather feedback from real users to improve the quality of the product. ◦ Utilize monitoring, observability and logging tools for continuous feedback. ◦ Automating deployment and rollback processes Implementing both shift-left and shift-right strategies, teams can enhance software quality while accelerating delivery cycles.
  23. QA Golden paths ~ The idea behind having QA Golden

    Paths is not to limit QA engineers. With Golden Paths, teams don’t have to reinvent the wheel, to show how we do things. ~ Have fewer decisions to make, and can use their productivity and creativity for higher objectives.
  24. Golden paths are… ~ Supported: Golden paths should be supported

    by documentation, tools, and training. This will help developers to understand and follow the golden path. ~ Path to ‘build something’: these paths are not just about the technical aspects of software development. They also include the business requirements and the overall goals of the project.
  25. Advantages of QA Golden Paths • Consistency across the teams.

    • Knowledge sharing and onboarding process. • Improved quality and reduced costs over time. • Better Quality Experience.
  26. Challenges with Golden Paths • Balancing Innovation and Standardization: Engineers

    may feel limited by predefined guidelines, preventing them from exploring new ideas or adopting cutting-edge technologies. • Compatibility and Integration: Golden paths often recommend specific technologies, frameworks, or libraries that work well together. • Careful consideration is necessary to ensure smooth integration and minimize potential conflicts or issues.
  27. 3# Continuous testing over testing at the end (DevTestOps) Test

    Early and often Transformation in the Quality
  28. In DevTestOps, prioritize continuous testing by running automated tests at

    every stage of software delivery to quickly assess product quality and functionality. This involves various automation techniques integrated into the DevOps toolchain for rapid execution and ensuring software stability despite frequent updates. DevTestOps
  29. DevTestOps Principles (Manifesto) • Continuous Testing over testing at the

    end. • Embracing all testing activities over automating everything. • Testing what gives value, based on customer usage, over testing everything. • A whole team approach to testing over testing in siloed testing departments. https://www.mabl.com/blog/the-road-to-devtestops
  30. Continuous Testing • Automated tests are executed as part of

    the software delivery pipeline in order to obtain feedback as quickly as possible. • Seamlessly integrated into the software delivery pipeline and DevOps toolchain. • Test Automation is a vital part of DevOps. • CI/CD is our coordination process.
  31. It’s build and release process to achieve quick and frequent

    releases Key elements of DevOps practices: • Continuous Communication and Planning • Continuous Integration, Delivery, and Deployment • Continuous Testing and Monitoring DevOps
  32. People Processes Tools Mobile DevOps • Culture • Mindset •

    Collaboration • Agile/Scrum • RFC • Code Review/Owners • Incident Management • CI/CD • Test Automation • Reporting • Releasing • Monitoring
  33. Execution best practices • Scheduling and triggering automated tests. •

    CI/CD pipeline • Using Cloud devices • Parallel test execution and managing test environments. • Effective logging and reporting. • Identifying and handling false positives and negatives. • Tracking and communicating test results to stakeholders. • Regular updates and refactoring. • Handling changes in application under test (AUT).
  34. AI Thinking Understand how AI works and the difference between

    Artificial Intelligence and Human Intelligence. It is also necessary to learn how to work alongside AI, and to know when to delegate tasks to machines while focusing on the human aspects of a project. - Dr. Li Jiang, Director of Stanford AIRE program Survival Strategies in the Era of AI Taught by Stanford | Stanford AIRE Director
  35. Generative AI Traditional AI systems mainly recognize patterns and make

    predictions from available data. In contrast, Gen AI surpasses this by producing innovative and imaginative results. Generative AI is a category within Artificial Intelligence (AI) that focuses on creating fresh content like images, texts, or music. One example of generative AI is the GPT language model.
  36. ChatGPT is a large language model developed by OpenAI that

    has been trained on a huge and diverse range of internet text. ChatGPT is an AI chatbot that uses advanced language processing to generate human-like responses. It's trained on a large amount of text data and can provide relevant replies. ChatGPT operates by predicting and generating text based on the input it receives. ChatGPT
  37. A prompt is a question or set of instructions used

    to start or guide a task or conversation. When it comes to language processing and AI, a prompt is an input that the model uses to make a response or output. It could be a question, a set of instructions, or a statement. The Prompt
  38. • Be specific and descriptive. • Break down tasks into

    chunks. • Model the output with examples. • Refine and experiment. General prompt crafting guideline
  39. • List the exact steps a user would take for

    the scenario • Be more context-specific, gradually increasing the level of detail (in addition to steps, context can involve e.g. partial source code) • Split more complex requests into a chain of simpler prompts A few tips to improve the results of this step are
  40. Testing AI apps • Verifying and validating AI models and

    algorithms to ensure they function correctly and meet the intended requirements. • Ensuring that the core AI algorithms and logic produce the expected outcomes in various scenarios is crucial. This involves testing the AI's decision-making processes, its ability to learn from data, and its performance in different conditions. • Ensuring that the data used to train the AI models is representative and free from biases that could skew the system's outputs • AI applications must be tested for their ability to scale and perform under different loads, ensuring that they can handle real-world usage scenarios effectively. https://learn.deeplearning.ai/courses/automated-testing-llmops
  41. Challenges of AI and ML testing • Non-Deterministic: They tend

    to show different behaviors for the same input • The lack of test data: ML rely on data and algorithms. • Bias: As it requires a thorough understanding of the training data and the potential sources of bias
  42. Integrating AI in testing Activities • AI-powered visual testing tools

    can automatically detect visual differences in the UI (Applitools). • AI can recommend the most relevant tests to run based on code changes, optimizing the testing process and reducing unnecessary test executions. (Predictive Test Selection) Gradle Enterprise (Develocity) • AI can enable self-healing test automation, where test scripts adapt to changes in the application's UI. (Testsigma)
  43. AI for Specific Testing Activities • Prepare Test Plan for

    Automation Testing • Generate UI Automation Script in Different Languages • Test Scenario Generation • Test Data Generation • Classify Positive and Negative Test Scenarios
  44. AI-Powered Codeless Testing Codeless automation testing enables quicker and easier

    automation without the requirement to learn new languages. AI and machine learning have enhanced scriptless/codeless test automation.
  45. AI-Powered Reporting Tooling ReportPortal is a powerful reporting and analysis

    platform that enhances AI-driven testing tools. Let's delve into how it fits within the realm of intelligent software test reporting. With ReportPortal's innovative AI-powered failure reason detection capability, a groundbreaking solution is introduced. https://reportportal.io/
  46. GitHub Copilot AI coding assistants designed to help developers craft

    high-quality code more efficiently, Copilot is driven by the OpenAI Codex language model Amazon CodeWhisperer Innovative code generator powered by machine learning by offering real-time code recommendations directly within their IDE. Codiumate Your code integrity AI mate - analyzes your code and generates meaningful tests to catch bugs before you ship (powered by GPT-3.5& 4 & Test PT-1) AI Coding Assistant Tools
  47. Code Generation Generate code snippets based on natural language prompts

    Code Explanation Explain the purpose and function of specific lines of code, helping beginners understand how different code components work together Debugging Identify and explain errors in code, helping beginners learn how to debug and troubleshoot their own code Practical Uses of AI With Test Automation Code Completion Complete partially written code, providing guidance on the next steps
  48. Ways to use GitHub Copilot • Automating repetitive tasks •

    Exploring and learning • Run terminal commands from GitHub Copilot Chat • Generate a commit message • Locate a file in the project “@workspace Where is the Dockerfile defined” Remember: Single, specific, short comments help GitHub Copilot provide better context.
  49. Investigate and resolve issues faster by using natural language to

    interact with all of your observability data. AI and DevOps Introducing Bits AI, Your New DevOps Copilot | Datadog New Relic AI Pulumi AI AI for Infrastructure Management Accelerate creating IaC with Terraform and GitHub Copilot Chat
  50. Sometimes, LLMs aren’t right • Limited knowledge and outdated information

    • Lack of context • Training data biases and limitations • Overconfidence
  51. AI is helpful, but it isn’t perfect • While LLMs

    are trained on large amounts of data, they don’t understand programming concepts the way humans do. • As a result, the code they generate may contain syntax errors, logic flaws, or other issues. • That’s why developers need to rely on their coding competence and knowledge to make sure that they aren’t pushing faulty code into production.
  52. Resources • How We Use Golden Paths to Solve Fragmentation

    in Our Software Ecosystem • How Spotify Leverages Paved Paths and Common Tooling to Improve Productivity • Supercharge Testing with Katalon's AI-Powered Features • Self-Healing Locators and Selectors | Applitools • Natural Language Processing Test Builder - Applitools • App Quality Copilot • AI-Augmented Testing Solution | Kobiton • AI-powered, low-code test automation platform • https://reportportal.io/features#ai-based • https://www.mabl.com/ • https://www.datadoghq.com/dg/apm/synthetics/ai-ui-testing/ • DLAI - Automated Testing for LLMOps • Survival Strategies in the Era of AI Taught by Stanford | Stanford AIRE Director • Self Healing Test Automation | Tests that do Not Require Maintenance • GitHub Copilot Tutorial | How useful is it for Cloud and DevOps?