This document provides an introduction to software testing. It defines key terms like error, fault, failure and incident. It discusses different types of testing including black box vs white box testing and testing at different lifecycle phases. It also provides an overview of using agile processes for testing and discusses unit testing with Maven and JUnit. Finally, it presents a case study of implementing agile testing practices at the Telecommunication Software & Systems Group (TSSG).
Agile and DevOps, when integrated into business process, can empower organizations to drive CI In support of market demands, in a significantly efficient and cost effective manner.
Key Concepts:
This presentation covers the test aspects of the Continuous Integration process. In a CI implementation automated tests are necessary, but not sufficient. The CI test framework (CITF) allows immediate build verification on multiple test tools and multiple test environments in parallel. CITF provides an interface for incorporating new releases, applications, resources, test tools. It offers multi-purpose standardized reports and presents a flexible interface for presenting the test results, and for reviewing, updating, and summarizing the information.
Learning Objectives:
How to design test objects that mirror the build infrastructure.
How to design a test infrastructure that mirrors the architecture and requirements.
How to describe the test environments and build them dynamically; optimize the usage of limited resources.
How to combine a variety of test tools within the same framework, in order to standardize the test results presentation and the debugging.
Automation test is an interesting research problem in recent years. There are many reasons why we use automation test in the software development. In the traditional approach, automation test has been used for regression test, functional test, performance test… in order to find or prevent bugs and software quality assurance. In this research, we have a novel approach using automation test to build software monitoring solution. The purpose of automation scripts use as monitoring software to capture images and write logs. The architecture pattern of automation for monitoring based on automation test tool, cloud service, and scheduler. The proposed architecture pattern has been applied for online advertisement monitoring. Instead of reporting passed/failed, automation scripts will monitor whether the advertisement is display or not, and how often it was display on multiple platforms. The proposed architecture pattern can also apply for video advertisement monitoring solution.
Splitting The Check On Compliance and SecurityNew Relic
Often times, developers and auditors can be at odds. The agile, fast-moving environments that developers enjoy will typically give auditors heartburn. The more controlled and stable environments that auditors prefer to demonstrate and maintain compliance are traditionally not friendly to developers or innovation. We'll walk through how Netflix moved its PCI and SOX environments to the cloud and how we were able to leverage the benefits of the cloud and agile development to satisfy both auditors and developers.
Agile and DevOps, when integrated into business process, can empower organizations to drive CI In support of market demands, in a significantly efficient and cost effective manner.
Key Concepts:
This presentation covers the test aspects of the Continuous Integration process. In a CI implementation automated tests are necessary, but not sufficient. The CI test framework (CITF) allows immediate build verification on multiple test tools and multiple test environments in parallel. CITF provides an interface for incorporating new releases, applications, resources, test tools. It offers multi-purpose standardized reports and presents a flexible interface for presenting the test results, and for reviewing, updating, and summarizing the information.
Learning Objectives:
How to design test objects that mirror the build infrastructure.
How to design a test infrastructure that mirrors the architecture and requirements.
How to describe the test environments and build them dynamically; optimize the usage of limited resources.
How to combine a variety of test tools within the same framework, in order to standardize the test results presentation and the debugging.
Automation test is an interesting research problem in recent years. There are many reasons why we use automation test in the software development. In the traditional approach, automation test has been used for regression test, functional test, performance test… in order to find or prevent bugs and software quality assurance. In this research, we have a novel approach using automation test to build software monitoring solution. The purpose of automation scripts use as monitoring software to capture images and write logs. The architecture pattern of automation for monitoring based on automation test tool, cloud service, and scheduler. The proposed architecture pattern has been applied for online advertisement monitoring. Instead of reporting passed/failed, automation scripts will monitor whether the advertisement is display or not, and how often it was display on multiple platforms. The proposed architecture pattern can also apply for video advertisement monitoring solution.
Splitting The Check On Compliance and SecurityNew Relic
Often times, developers and auditors can be at odds. The agile, fast-moving environments that developers enjoy will typically give auditors heartburn. The more controlled and stable environments that auditors prefer to demonstrate and maintain compliance are traditionally not friendly to developers or innovation. We'll walk through how Netflix moved its PCI and SOX environments to the cloud and how we were able to leverage the benefits of the cloud and agile development to satisfy both auditors and developers.
How to go from waterfall app dev to secure agile development in 2 weeks Ulf Mattsson
Waterfall is based on the concept of sequential software development—from conception to ongoing maintenance—where each of the many steps flowed logically into the next.
Join this webinar presentation to learn:
- Why DevOps cannot effectively work in waterfall
- How to use DevOps tools to optimize processes in either development or operations through automation
We will also discuss what is needed to support full DevOps
Todays' IT industry has vastly grown in multiple segments serving many time critical offerings. Need of the hour is continuous nature of requirements with the expectation of continuous delivery. Challenge in Agile methodology is managing 3 stages viz. requirements gathering, development & testing simultaneously. This nature of process has changed the traditional model of Waterfall process where each segment was controlled independently and process called Continuous Integration or Automated Integration is evolving. In this program, we will discuss about one virtual project having continuous mode of changing requirements and define Test Driven Development model using Open Source Tools combination.
Continuous delivery applied (DC CI User Group)Mike McGarr
These are slides I used to present to the DC Continuous Integration, Delivery and Deployment User Group on
Writing code is fun, but deploying to production is not. Production releases are scary events that last all weekend, and you find yourself worrying about how it will go. Did we miss a configuration file? Is the database schema the same as the one in the test environment? Does the last minute hot fix we just applied break any other features? Did I forget to include an installation instruction for the system administrators?
Continuous Delivery is a collection of principles and practices aimed at addressing the problems teams typically face when releasing changes to production. By applying rigorous automation, testing and configuration management, teams are able to confidently and consistently deploy changes from version control to production without fear.
In this talk, Mike McGarr will provide listeners with an introduction into the world of Continuous Delivery. After an introduction into the concepts and principles of Continuous Delivery, he will discuss many of the techniques for implementing Continuous Delivery and recommend some tools that can be used on your development project.
Finding Bugs, Fixing Bugs, Preventing Bugs — Exploiting Automated Tests to In...University of Antwerp
With the rise of agile development, software teams all over the world embrace faster release cycles as *the* way to incorporate customer feedback into product development processes. Yet, faster release cycles imply rethinking the traditional notion of software quality: agile teams must balance reliability (minimize known defects) against agility (maximize ease of change). This talk will explore the state-of-the-art in software test automation and the opportunities this may present for maintaining this balance. We will address questions like: Will our test suite detect critical defects early? If not, how can we improve our test suite? Where should we fix a defect?
(Keynote for the SHIFT 2020 and IWSF 2020 Workshops, October 2020)
Presented at STPCon 2016. With the extensive amount of testing performed nightly on large software projects, test and verification teams often experience lengthy wait times for the availability of test results of the latest build. As we strive to identify and resolve issues as fast as possible, alternative methods of test execution have to be found. Learn how to use Jenkins to launch tests in parallel across a number of Virtual Machines, monitor execution health, and process results. Learn about various Jenkins plugins and how they contributed to the solution. Learn how to trigger downstream jobs, even if they are on separate Jenkins instances.
Curiosity and Xray present - In sprint testing: Aligning tests and teams to r...Curiosity Software Ireland
This webinar was co-hosted by Xray and Curiosity Software on 18th May 2021. Watch the on demand recording here: https://opentestingplatform.curiositysoftware.ie/xray-in-sprint-testing-webinar
In-sprint testing must tackle three pressing problems:
1. You must know exactly what needs testing before each release. There’s not time to test everything.
2. You need up-to-date and aligned test assets, including test cases, data, scripts and CI/CD artefacts.
3. Test teams must know what needs testing, when, and have on demand access to environments, tests and data.
These problems are near-impossible to crack at organisations who struggle with application complexity, rapid system change, and overly-manual testing processes. Challenges include:
1. Test creation time. Manually creating test cases, data and scripts is slow and unsystematic, resulting in low coverage tests.
2. Slow test maintenance. Changes break tests, with little time in sprints to check test cases, scripts, and data.
3. Knowing when testing is “done”. There is little measurability or peace of mind when systems “go live”.
This webinar will set out how maintaining a “digital twin” of the system under test prioritises testing time AND maintains rigorous tests in-sprint. You will see how:
1. Intuitive flowcharts generate optimised test cases, scripts, and data.
2. Feeding changes into the models maintains up-to-date tests.
3. Pushing the tests to agile test management tooling then makes sure that teams know which tests to run, when, with full traceability and a measurable definition of ‘done’.
James Walker, Curiosity’s Director of Technology, and Sérgio Freire, Head of Product Evangelism for Xray, will set out this cutting-edge approach to in-sprint testing. Günther-Matthias Bär, Test Automation Engineer at Sogeti, will then draw on implementation experience to discuss the value of the proposed approach.
Quality in a Square. K8s-native Quality Assurance of Microservices with TestkubeQAware GmbH
Jfokus 2023, Februar 2023, Stockholm, Schweden, Mario-Leander Reimer (@LeanderReimer, CTO @QAware).
== Dokument bitte herunterladen, falls unscharf! Please download slides if blurred! ==
Continuous delivery is everywhere. Really?! Many teams still struggle to deliver well-tested product increments on a regular basis. Usually with the same old excuse: the (non)-functional tests are too complex and too expensive to implement thoroughly. But exactly the opposite is the case! In this talk, we briefly review the importance of early and regular testing of cloud-native applications and explain why monolithic CI pipelines are a dead end. We then show how easy it is to run integration, performance, security and acceptance tests continuously using Testkube directly on your Kubernetes cluster, fully integrated with a GitOps approach.
Delivering Quality Software with Continuous IntegrationAspire Systems
Learn about:
1> Best Practices In Distributed Environment
2> Potential Challenges Of Not Following CI
3> Tools & Frameworks That Help You Implement CI Better
How to go from waterfall app dev to secure agile development in 2 weeks Ulf Mattsson
Waterfall is based on the concept of sequential software development—from conception to ongoing maintenance—where each of the many steps flowed logically into the next.
Join this webinar presentation to learn:
- Why DevOps cannot effectively work in waterfall
- How to use DevOps tools to optimize processes in either development or operations through automation
We will also discuss what is needed to support full DevOps
Todays' IT industry has vastly grown in multiple segments serving many time critical offerings. Need of the hour is continuous nature of requirements with the expectation of continuous delivery. Challenge in Agile methodology is managing 3 stages viz. requirements gathering, development & testing simultaneously. This nature of process has changed the traditional model of Waterfall process where each segment was controlled independently and process called Continuous Integration or Automated Integration is evolving. In this program, we will discuss about one virtual project having continuous mode of changing requirements and define Test Driven Development model using Open Source Tools combination.
Continuous delivery applied (DC CI User Group)Mike McGarr
These are slides I used to present to the DC Continuous Integration, Delivery and Deployment User Group on
Writing code is fun, but deploying to production is not. Production releases are scary events that last all weekend, and you find yourself worrying about how it will go. Did we miss a configuration file? Is the database schema the same as the one in the test environment? Does the last minute hot fix we just applied break any other features? Did I forget to include an installation instruction for the system administrators?
Continuous Delivery is a collection of principles and practices aimed at addressing the problems teams typically face when releasing changes to production. By applying rigorous automation, testing and configuration management, teams are able to confidently and consistently deploy changes from version control to production without fear.
In this talk, Mike McGarr will provide listeners with an introduction into the world of Continuous Delivery. After an introduction into the concepts and principles of Continuous Delivery, he will discuss many of the techniques for implementing Continuous Delivery and recommend some tools that can be used on your development project.
Finding Bugs, Fixing Bugs, Preventing Bugs — Exploiting Automated Tests to In...University of Antwerp
With the rise of agile development, software teams all over the world embrace faster release cycles as *the* way to incorporate customer feedback into product development processes. Yet, faster release cycles imply rethinking the traditional notion of software quality: agile teams must balance reliability (minimize known defects) against agility (maximize ease of change). This talk will explore the state-of-the-art in software test automation and the opportunities this may present for maintaining this balance. We will address questions like: Will our test suite detect critical defects early? If not, how can we improve our test suite? Where should we fix a defect?
(Keynote for the SHIFT 2020 and IWSF 2020 Workshops, October 2020)
Presented at STPCon 2016. With the extensive amount of testing performed nightly on large software projects, test and verification teams often experience lengthy wait times for the availability of test results of the latest build. As we strive to identify and resolve issues as fast as possible, alternative methods of test execution have to be found. Learn how to use Jenkins to launch tests in parallel across a number of Virtual Machines, monitor execution health, and process results. Learn about various Jenkins plugins and how they contributed to the solution. Learn how to trigger downstream jobs, even if they are on separate Jenkins instances.
Curiosity and Xray present - In sprint testing: Aligning tests and teams to r...Curiosity Software Ireland
This webinar was co-hosted by Xray and Curiosity Software on 18th May 2021. Watch the on demand recording here: https://opentestingplatform.curiositysoftware.ie/xray-in-sprint-testing-webinar
In-sprint testing must tackle three pressing problems:
1. You must know exactly what needs testing before each release. There’s not time to test everything.
2. You need up-to-date and aligned test assets, including test cases, data, scripts and CI/CD artefacts.
3. Test teams must know what needs testing, when, and have on demand access to environments, tests and data.
These problems are near-impossible to crack at organisations who struggle with application complexity, rapid system change, and overly-manual testing processes. Challenges include:
1. Test creation time. Manually creating test cases, data and scripts is slow and unsystematic, resulting in low coverage tests.
2. Slow test maintenance. Changes break tests, with little time in sprints to check test cases, scripts, and data.
3. Knowing when testing is “done”. There is little measurability or peace of mind when systems “go live”.
This webinar will set out how maintaining a “digital twin” of the system under test prioritises testing time AND maintains rigorous tests in-sprint. You will see how:
1. Intuitive flowcharts generate optimised test cases, scripts, and data.
2. Feeding changes into the models maintains up-to-date tests.
3. Pushing the tests to agile test management tooling then makes sure that teams know which tests to run, when, with full traceability and a measurable definition of ‘done’.
James Walker, Curiosity’s Director of Technology, and Sérgio Freire, Head of Product Evangelism for Xray, will set out this cutting-edge approach to in-sprint testing. Günther-Matthias Bär, Test Automation Engineer at Sogeti, will then draw on implementation experience to discuss the value of the proposed approach.
Quality in a Square. K8s-native Quality Assurance of Microservices with TestkubeQAware GmbH
Jfokus 2023, Februar 2023, Stockholm, Schweden, Mario-Leander Reimer (@LeanderReimer, CTO @QAware).
== Dokument bitte herunterladen, falls unscharf! Please download slides if blurred! ==
Continuous delivery is everywhere. Really?! Many teams still struggle to deliver well-tested product increments on a regular basis. Usually with the same old excuse: the (non)-functional tests are too complex and too expensive to implement thoroughly. But exactly the opposite is the case! In this talk, we briefly review the importance of early and regular testing of cloud-native applications and explain why monolithic CI pipelines are a dead end. We then show how easy it is to run integration, performance, security and acceptance tests continuously using Testkube directly on your Kubernetes cluster, fully integrated with a GitOps approach.
Delivering Quality Software with Continuous IntegrationAspire Systems
Learn about:
1> Best Practices In Distributed Environment
2> Potential Challenges Of Not Following CI
3> Tools & Frameworks That Help You Implement CI Better
Similar to Software testing: an introduction - 2016 (20)
How Recreation Management Software Can Streamline Your Operations.pptxwottaspaceseo
Recreation management software streamlines operations by automating key tasks such as scheduling, registration, and payment processing, reducing manual workload and errors. It provides centralized management of facilities, classes, and events, ensuring efficient resource allocation and facility usage. The software offers user-friendly online portals for easy access to bookings and program information, enhancing customer experience. Real-time reporting and data analytics deliver insights into attendance and preferences, aiding in strategic decision-making. Additionally, effective communication tools keep participants and staff informed with timely updates. Overall, recreation management software enhances efficiency, improves service delivery, and boosts customer satisfaction.
Large Language Models and the End of ProgrammingMatt Welsh
Talk by Matt Welsh at Craft Conference 2024 on the impact that Large Language Models will have on the future of software development. In this talk, I discuss the ways in which LLMs will impact the software industry, from replacing human software developers with AI, to replacing conventional software with models that perform reasoning, computation, and problem-solving.
Unleash Unlimited Potential with One-Time Purchase
BoxLang is more than just a language; it's a community. By choosing a Visionary License, you're not just investing in your success, you're actively contributing to the ongoing development and support of BoxLang.
How to Position Your Globus Data Portal for Success Ten Good PracticesGlobus
Science gateways allow science and engineering communities to access shared data, software, computing services, and instruments. Science gateways have gained a lot of traction in the last twenty years, as evidenced by projects such as the Science Gateways Community Institute (SGCI) and the Center of Excellence on Science Gateways (SGX3) in the US, The Australian Research Data Commons (ARDC) and its platforms in Australia, and the projects around Virtual Research Environments in Europe. A few mature frameworks have evolved with their different strengths and foci and have been taken up by a larger community such as the Globus Data Portal, Hubzero, Tapis, and Galaxy. However, even when gateways are built on successful frameworks, they continue to face the challenges of ongoing maintenance costs and how to meet the ever-expanding needs of the community they serve with enhanced features. It is not uncommon that gateways with compelling use cases are nonetheless unable to get past the prototype phase and become a full production service, or if they do, they don't survive more than a couple of years. While there is no guaranteed pathway to success, it seems likely that for any gateway there is a need for a strong community and/or solid funding streams to create and sustain its success. With over twenty years of examples to draw from, this presentation goes into detail for ten factors common to successful and enduring gateways that effectively serve as best practices for any new or developing gateway.
Cyaniclab : Software Development Agency Portfolio.pdfCyanic lab
CyanicLab, an offshore custom software development company based in Sweden,India, Finland, is your go-to partner for startup development and innovative web design solutions. Our expert team specializes in crafting cutting-edge software tailored to meet the unique needs of startups and established enterprises alike. From conceptualization to execution, we offer comprehensive services including web and mobile app development, UI/UX design, and ongoing software maintenance. Ready to elevate your business? Contact CyanicLab today and let us propel your vision to success with our top-notch IT solutions.
Software Engineering, Software Consulting, Tech Lead.
Spring Boot, Spring Cloud, Spring Core, Spring JDBC, Spring Security,
Spring Transaction, Spring MVC,
Log4j, REST/SOAP WEB-SERVICES.
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...Juraj Vysvader
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I didn't get rich from it but it did have 63K downloads (powered possible tens of thousands of websites).
Enterprise Resource Planning System includes various modules that reduce any business's workload. Additionally, it organizes the workflows, which drives towards enhancing productivity. Here are a detailed explanation of the ERP modules. Going through the points will help you understand how the software is changing the work dynamics.
To know more details here: https://blogs.nyggs.com/nyggs/enterprise-resource-planning-erp-system-modules/
Navigating the Metaverse: A Journey into Virtual Evolution"Donna Lenk
Join us for an exploration of the Metaverse's evolution, where innovation meets imagination. Discover new dimensions of virtual events, engage with thought-provoking discussions, and witness the transformative power of digital realms."
First Steps with Globus Compute Multi-User EndpointsGlobus
In this presentation we will share our experiences around getting started with the Globus Compute multi-user endpoint. Working with the Pharmacology group at the University of Auckland, we have previously written an application using Globus Compute that can offload computationally expensive steps in the researcher's workflows, which they wish to manage from their familiar Windows environments, onto the NeSI (New Zealand eScience Infrastructure) cluster. Some of the challenges we have encountered were that each researcher had to set up and manage their own single-user globus compute endpoint and that the workloads had varying resource requirements (CPUs, memory and wall time) between different runs. We hope that the multi-user endpoint will help to address these challenges and share an update on our progress here.
May Marketo Masterclass, London MUG May 22 2024.pdfAdele Miller
Can't make Adobe Summit in Vegas? No sweat because the EMEA Marketo Engage Champions are coming to London to share their Summit sessions, insights and more!
This is a MUG with a twist you don't want to miss.
Quarkus Hidden and Forbidden ExtensionsMax Andersen
Quarkus has a vast extension ecosystem and is known for its subsonic and subatomic feature set. Some of these features are not as well known, and some extensions are less talked about, but that does not make them less interesting - quite the opposite.
Come join this talk to see some tips and tricks for using Quarkus and some of the lesser known features, extensions and development techniques.
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Globus
The U.S. Geological Survey (USGS) has made substantial investments in meeting evolving scientific, technical, and policy driven demands on storing, managing, and delivering data. As these demands continue to grow in complexity and scale, the USGS must continue to explore innovative solutions to improve its management, curation, sharing, delivering, and preservation approaches for large-scale research data. Supporting these needs, the USGS has partnered with the University of Chicago-Globus to research and develop advanced repository components and workflows leveraging its current investment in Globus. The primary outcome of this partnership includes the development of a prototype enterprise repository, driven by USGS Data Release requirements, through exploration and implementation of the entire suite of the Globus platform offerings, including Globus Flow, Globus Auth, Globus Transfer, and Globus Search. This presentation will provide insights into this research partnership, introduce the unique requirements and challenges being addressed and provide relevant project progress.
Code reviews are vital for ensuring good code quality. They serve as one of our last lines of defense against bugs and subpar code reaching production.
Yet, they often turn into annoying tasks riddled with frustration, hostility, unclear feedback and lack of standards. How can we improve this crucial process?
In this session we will cover:
- The Art of Effective Code Reviews
- Streamlining the Review Process
- Elevating Reviews with Automated Tools
By the end of this presentation, you'll have the knowledge on how to organize and improve your code review proces
Top 7 Unique WhatsApp API Benefits | Saudi ArabiaYara Milbes
Discover the transformative power of the WhatsApp API in our latest SlideShare presentation, "Top 7 Unique WhatsApp API Benefits." In today's fast-paced digital era, effective communication is crucial for both personal and professional success. Whether you're a small business looking to enhance customer interactions or an individual seeking seamless communication with loved ones, the WhatsApp API offers robust capabilities that can significantly elevate your experience.
In this presentation, we delve into the top 7 distinctive benefits of the WhatsApp API, provided by the leading WhatsApp API service provider in Saudi Arabia. Learn how to streamline customer support, automate notifications, leverage rich media messaging, run scalable marketing campaigns, integrate secure payments, synchronize with CRM systems, and ensure enhanced security and privacy.
1. www.unamur.be
Software Testing: an Introduction
Xavier Devroey <xavier.devroey@unamur.be>
INFO M110 Ingénierie du logiciel
Namur, Belgique
2. Plan
• Introduction
• Software testing typology
– Source of test generation
– Characteristic being tested
– Lifecycle phase
• Agile process implementation: the TSSG case study
• Unit testing using Maven and JUnit
• Code review
• Test-case assessment
21/10/2016 xavier.devroey@unamur.be 2
6. Error, fault, failure, and incident
Error
Fault Exec.
Failure (bug)
Reports
Incident
Bug Tracker
21/10/2016 xavier.devroey@unamur.be 6
Dev.
User
7. Software testing: definition [SWEBOK v3]
“Software testing consists of the dynamic verification
that a program provides expected behaviours
on a finite set of test cases, suitably selected from the
usually infinite execution domain.”
21/10/2016 xavier.devroey@unamur.be 7
12. Finite set of test cases
• Exhaustive testing is not possible in practice
– Infinite number of test cases
– Select a subset of all possible tests
– Trade-off between limited resources, schedules and unlimited
test requirements
• Prioritization based on risk, usage, cost, …
“Program testing can be used to show the presence of bugs,
but never to show their absence” Dijkstra (1970)
21/10/2016 xavier.devroey@unamur.be 12
13. Suitably selected
• How to select test-cases ?
• Selection criteria
– Input/output domains coverage (black box testing)
• Domain partitioning techniques
• Based on specification documents
• No access to the source code
– Code coverage: statement coverage, decision coverage, path
coverage, etc. (white box testing)
• Access to source code
– Test engineer expertise
21/10/2016 xavier.devroey@unamur.be 13
15. Types of testing
• Source of test generation
– Black box testing
• Based on specification documents
• No access to the source code
– White box testing
• Access to the source code
– Model-based testing
• Characteristic being tested
– Functional testing: is the output correct for a given input ?
– Non-functional testing: Performance, robustness, security,
usability, etc.
21/10/2016 xavier.devroey@unamur.be 15
16. Types of testing
• Lifecycle phase
– Coding
• Unit testing
• Component testing
– Integration
• Integration testing
– System integration
• System testing
– Release
• Acceptance/Beta testing
– Maintenance
• Regression testing
21/10/2016 xavier.devroey@unamur.be 16
17. Testing in the waterfall model
21/10/2016 xavier.devroey@unamur.be 17
Requirements
specification
Design
Coding and
unit testing
Integration testing
System testing
Acceptance
testing
Release
Maintenance and
regression testing
18. Testing in the V-model
21/10/2016 xavier.devroey@unamur.be 18
Requirements
specification
Design
Coding and
unit testing
Integration/
System
testing
Acceptance
testing
Release
Integration/
System
test plan
Acceptance
test plan
Maintenance and
regression testing
19. Testing in an Agile process
1. Include testing activities from the beginning
2. Specify requirements in terms of tests
3. Testers and developers are not enemies
4. Test often and in small chunks
21/10/2016 xavier.devroey@unamur.be 19
20. Test Driven Development (TDD)
• Red
– Write automated tests
(examples) from user stories
– Tests fail (as the functionality
is not implemented yet)
• Green
– Developers design and write
code to make the tests pass
– Tests are run frequently
• Refactor
– Refactor code without
changing interfaces or
behaviour (tests must pass)
Red
GreenRefactor
21/10/2016 xavier.devroey@unamur.be 20
22. Agile process implementation: TSSG
• From Dowling, P., & McGrath, K. (2015). Using free and
open source tools to manage software quality.
Communications of the ACM, 58(7), 51–55.
doi:10.1145/2755503
• Open Source tools
• Support team’s activities management
• Language: Java
21/10/2016 xavier.devroey@unamur.be 22
24. 21/10/2016 xavier.devroey@unamur.be 24
Project Management
Requirements Management
Issues Tracking
Development environment
Building
Unit testing
Code
coverage
Cobertura
Continuous Integration
Code
Repository
25. 21/10/2016 xavier.devroey@unamur.be 25
Project Management
Requirements Management
Issues Tracking
Development environment
Building
Unit testing
Code
coverage
Cobertura
Continuous Integration
Code
Repository
Test environment
Functional
Testing
Test Case
Management
Load Testing
Security
Testing
26. Workflow
• Developer forks the code
base
• Implements changes
• Integrates possible
changes from code repo.
• Runs a complete build
– Including Unit tests
• Submits changes to code
repo.
• CI server performs
integration tests
21/10/2016 xavier.devroey@unamur.be 26
Do NOT break the build!
27. 21/10/2016 xavier.devroey@unamur.be 27
Project Management
Requirements Management
Issues Tracking
Development environment
Building
Unit testing
Code
coverage
Cobertura
Continuous Integration
Code
Repository
Test environment
Functional
Testing
Test Case
Management
Load Testing
Security
Testing
28. 21/10/2016 xavier.devroey@unamur.be 28
Project Management
Requirements Management
Issues Tracking
Development environment
Building
Unit testing
Code
coverage
Cobertura
Continuous Integration
Code
Repository
Test environment
Functional
Testing
Test Case
Management
Load Testing
Security
Testing
29. 21/10/2016 xavier.devroey@unamur.be 29
Project Management
Requirements Management
Issues Tracking
Development environment
Building
Unit testing
Code
coverage
Cobertura
Continuous Integration
Code
Repository
Test environment
Functional
Testing
Test Case
Management
Load Testing
Security
Testing
30. 21/10/2016 xavier.devroey@unamur.be 30
Project Management
Requirements Management
Issues Tracking
Development environment
Building
Unit testing
Code
coverage
Cobertura
Continuous Integration
Code
Repository
Test environment
Functional
Testing
Test Case
Management
Load Testing
Security
Testing
36. Maven project structure
• myfirstmavenproject/
– pom.xml
– src/
• main/
– java/
» Here goes your Java source code
– resources/
» Here goes other resources (files, etc.) included in the .jar/.war
• test/
– java/
» Here goes the JUnit tests
– resources/
» Here goes other resources used by the tests
– sub-module-1/
• pom.xml
• src/
– sub-module-2/
• …
21/10/2016 xavier.devroey@unamur.be 36
38. Pom.xml
21/10/2016 xavier.devroey@unamur.be 38
Identifier
• Maven identifiers have to be unique
• Format: groupId:artifactId:version
• GroupId should identify the organisation using Java package naming
convention
• ArtifactId should identify the project
• Version should be encoded on 3 number XX.XX.XX
• “-SNAPSHOT” is used to indicate the currently under
development version
39. Pom.xml
21/10/2016 xavier.devroey@unamur.be 39
Type of the artefact
• Packaging indicates to Maven the type of artifact produced during
build
• “jar” indicates a .jar file (executable or not)
• “pom” indicates a maven project without compiled code (used by a
parent project)
• “war” indicates a .war file that will be deployed on a web server
45. JUnit: introduction
• Collection of classes to perform unit testing
• Uses annotations (e.g., @Test)
21/10/2016 xavier.devroey@unamur.be 45
import static org.junit.Assert.assertEquals;
import org.junit.Test;
public class CalculatorTest {
@Test
public void evaluatesExpression() {
Calculator calculator = new Calculator();
int sum = calculator.evaluate("1+2+3");
assertEquals(6, sum);
}
}
java -cp .;junit-4.12.jar;hamcrest-core-1.3.jar org.junit.runner.JUnitCore CalculatorTest
46. Anatomy of a Junit test class
import …
public class MyClassTest{
private static final Logger logger = LoggerFactory.getLogger(JHConwayLifeCellTest.class);
@Rule
public TestRule watcher = new TestWatcher() {
@Override protected void starting(Description description) {
logger.info(String.format("Starting test: %s()...”, description.getMethodName()));};};
@BeforeClass
public static void setUpClass() {logger.info("Setting up before class");}
@AfterClass
public static void tearDownClass() {logger.info("Tearing down after class");}
@Before
public void setUp() {logger.info("Setting up before test");}
@After
public void tearDown() {logger.info("Tearing down after test");}
@Test
public void testMyMethod() {assertTrue(true);}
}
21/10/2016 xavier.devroey@unamur.be 46
48. Hamcrest common matchers
• Core
– anything - always matches, useful if you don't care what the object under test is
• Logical
– allOf - matches if all matchers match, short circuits (like Java &&)
– anyOf - matches if any matchers match, short circuits (like Java ||)
– not - matches if the wrapped matcher doesn't match and vice versa
• Object
– equalTo - test object equality using Object.equals
– hasToString - test Object.toString
– instanceOf, isCompatibleType - test type
– notNullValue, nullValue - test for null
– sameInstance - test object identity
• Collections
– hasEntry, hasKey, hasValue - test a map contains an entry, key or value
– hasItem, hasItems - test a collection contains elements
– hasItemInArray - test an array contains an element
• Number
– closeTo - test floating point values are close to a given value
– greaterThan, greaterThanOrEqualTo, lessThan, lessThanOrEqualTo - test ordering
• Text
– equalToIgnoringCase - test string equality ignoring case
– equalToIgnoringWhiteSpace - test string equality ignoring differences in runs of whitespace
– containsString, endsWith, startsWith - test string matching
21/10/2016 xavier.devroey@unamur.be 48
49. Hands-on: Maven, JUnit and Hamcrest
• be.unamur:myfirstwebapp
• Class to test: be.unamur.myfirstwebapp.Message
• Test coverage using Cobertura
– mvn cobertura:cobertura
– Report in target/site/cobertura/index.html
21/10/2016 xavier.devroey@unamur.be 49
50. Hands-on: test a data access object
• Using a test database
– Derby (https://db.apache.org/derby/)
– H2 (http://www.h2database.com/)
– DB server test instance (MySQL, Oracle, etc.)
• Code designed to
– Externalize DB access information (e.g., using a property file)
– Manage DB connections (using a DataSource object)
• Connection pooling using commonds-dbcp
(https://commons.apache.org/proper/commons-dbcp/)
• In this case SQL execution using commonds-dbutils
(https://commons.apache.org/proper/commons-dbutils/)
• Exercice: Add test to cover “if” branch in
MessageDAO.update
21/10/2016 xavier.devroey@unamur.be 50
51. Hands-on: test a servlet
• Using mock objects to emulate servlet environment
• Code designed to
– Strictly separate model (Beans + DAOs), view (JSPs), and controller
(Servlets)
• Mockito: tasty mocking framework for unit tests in Java
– http://site.mockito.org
• Create the mock
– HttpServletRequest request = mock(HttpServletRequest.class);
• Stub method calls
– when(request.getParameter("author")).thenReturn("Albert");
• Check methods were called with given arguments
– verify(context).getRequestDispatcher("/WEB-INF/messages.jsp");
21/10/2016 xavier.devroey@unamur.be 51
54. Code review
• Over-the-shoulder reviewing
– sometimes called stepmother reviewing
• Pair programming
• Pull request
21/10/2016 xavier.devroey@unamur.be 54
Dev.
Team
Project
master
Creates the
feature in a
dedicated branch
in local repository
Pushes the
branch to central
rep. and fills a
pull request
Reviews the
code, discusses it,
and alters it
Merges the
feature into the
official rep. and
closes the pull
request
56. Code analysis: FindBugs
• http://findbugs.sourceforge.net
• Called after Maven test phase
– mvn test findbugs:findbugs findbugs:gui
21/10/2016 xavier.devroey@unamur.be 56
60. Selenium Commands
• open
– opens a page using a URL
• click/clickAndWait
– performs a click operation, and optionally waits for a new page to load
• verifyTitle/assertTitle
– verifies an expected page title
• verifyTextPresent
– verifies expected text is somewhere on the page
• verifyElementPresent
– verifies an expected UI element, as defined by its HTML tag, is present on the page
• verifyText
– verifies expected text and its corresponding HTML tag are present on the page
• verifyTable
– verifies a table’s expected contents
• waitForPageToLoad
– pauses execution until an expected new page loads. Called automatically when clickAndWait is used
• waitForElementPresent
– pauses execution until an expected UI element, as defined by its HTML tag, is present on the page
21/10/2016 xavier.devroey@unamur.be 60
61. EVALUATION OF THE TESTS
PERFORMED
Are my test cases suitably selected?
64. Mutation testing
• Mimic typical errors by introducing small modifications in
the program
• Based on 2 hypothesis:
– Competent programmer hypothesis
– Coupling effect
• Mutation operators introduce small syntactic errors
21/10/2016 xavier.devroey@unamur.be 64
Original program:
if (a && x < 5) {
foo();
} else {
fee();
}
Mutant 1:
if (a || x < 5) {
foo();
} else {
fee();
}
Mutant 2:
if (a && x < 5) {
fee();
} else {
fee();
}
69. Hands-on: test cases assessment
• http://pitest.org
• Called after Maven test phase
– mvn org.pitest:pitest-maven:mutationCoverage
21/10/2016 xavier.devroey@unamur.be 69
71. Symbolic execution
• Execute the program with symbolic values
– Constraints on the variables to follow defined path
• http://klee.github.io (C)
• Pex (C#); CodeHunt (C# and Java)
21/10/2016 xavier.devroey@unamur.be 71
int foo(int x){
if(x < 0){
return -1/x;
}
return 1/x;
}
72. Symbolic execution
• Execute the program with symbolic values
– Constraints on the variables to follow defined path
• http://klee.github.io (C)
• Pex (C#); CodeHunt (C# and Java)
21/10/2016 xavier.devroey@unamur.be 72
{x : int}
{x : int | x < 0}
{x : int | x < 0}
int foo(int x){
if(x < 0){
return -1/x;
}
return 1/x;
}
73. Symbolic execution
• Execute the program with symbolic values
– Constraints on the variables to follow defined path
• http://klee.github.io (C)
• Pex (C#); CodeHunt (C# and Java)
21/10/2016 xavier.devroey@unamur.be 73
{x : int}
{x : int | x > 0} v {x : int | x = 0}
int foo(int x){
if(x < 0){
return -1/x;
}
return 1/x;
}
74. Search-based software testing
• Use metaheuristics (e.g., evolutionary algorithms) to
– generate test cases (or test data);
– prioritize test cases;
– minimize test suites; etc.
• For instance, we want to generate input data for a given
function, we need:
– A search algorithm: hill climbing or genetic algorithm
– A representation of the program and input values
– Search operators: find the neighbours of the input values
– A fitness function: decision coverage
• This requires instrumentation of the program (to measure coverage
when executing tests)
21/10/2016 xavier.devroey@unamur.be 74
75. Hands-on: test cases generation
• http://www.evosuite.org/
• Generates tests in .evosuite/ folder
• mvn compile evosuite:generate
• mvn evosuite:export -DtargetFolder=target/generated-
test-sources/evosuite
• mvn test
21/10/2016 xavier.devroey@unamur.be 75
77. • Mathur, A. P. (2008). Foundations of software testing. Pearson Education.
• Utting, M., & Legeard, B. (2007). Practical Model-Based Testing: A Tools Approach.
Morgan Kaufmann.
• Bourque, P., & Fairley, R. E. (2014). Guide to the Software Engineering Body of
Knowledge (SWEBOK(R)): Version 3.0. IEEE Computer Society.
• Dowling, P., & McGrath, K. (2015). Using free and open source tools to manage
software quality. Communications of the ACM, 58(7), 51–55. doi:10.1145/2755503
• Tim O'Brien et al. Maven by Example. Sonatype,
http://www.sonatype.com/books/mvnex-book/reference/public-book.html
• http://junit.org
• http://hamcrest.org
• http://site.mockito.org
• http://www.seleniumhq.org
• http://pitest.org
• http://klee.github.io
• https://www.microsoft.com/en-us/research/project/pex-and-moles-isolation-and-
white-box-unit-testing-for-net/
• http://www.evosuite.org/
• https://openclassrooms.com/courses/creez-votre-application-web-avec-java-ee
21/10/2016 xavier.devroey@unamur.be 77