Commit 9b0acf55 authored by George Adrian Stoica's avatar George Adrian Stoica
Browse files

docs: add slides for lecture 18

parent 3b8395bb
Pipeline #145383 passed with stages
in 1 minute and 56 seconds
= Integration testing
:customcss: slides.css
:icons: font
:includedir: includes/
:LECTURE_TOPIC: Integration testing
:LECTURE_NO: 18th Lecture
include::{includedir}header.adoc[]
[.smaller-80][.center-paragraph]
IT1901 Fall 2021 - {LECTURE_NO}
[background-color = "#124990"]
[color = "#fff6d5"]
== Testing
- is an important part of software development
- a way to ensure software quality
- automated testing allows to develop new features with a minimal effort to check if the software still works as expected
- testing frameworks
== Testing principles
- testing shows presence of defects (not their absence)
- testing all possibilities is not feasible
- testing should be started as early as possible
- testing depends on the context
== Levels of testing
- Unit testing
- *Integration testing*
- System testing
- Deployment testing
== Unit testing
- units are the smallest testable parts of our system (methods, classes)
- unit tests are concerned with testing the unit in isolation
== Integration testing
- integration testing aims at testing several units / components
- the size and complexity of such a test is on a spectrum and can be from just integrating 2 units to integrating nearly all components in the system
== System testing
- testing the complete system as whole
- it can be considered a fully integrated test as it integrates all the components within the said system
- checks if the system is compliant with the specified requirements
== Deployment testing
- tests the complete system as it would be for actual use
- complete system should comply with the requirements in the clients' environment
== Testing pyramid
image::../images/lecture18/test-pyramid.png[canvas, size=contain]
== Testing pyramid (2)
- as we go from the bottom towards the top the tests get more complex and resource intensive
- the pyramid is a useful reminder that we should have many unit tests, several integration tests and very few system and deployment tests
== System-Tiers-Layers-Modules-Components-Units
image::../images/lecture18/system-units.png[canvas, size=contain]
== Unit tests
image::../images/lecture18/system-units.png[canvas, size=contain]
== Integration tests
image::../images/lecture18/integration-tests.png[canvas, size=contain]
== Types of integration testing
- "Big Bang" - all of units available are combined together and tested if they work together as intended
- "Top-Down" - top-down integration allows the team to test the top level units first (stubs)
- "Bottom-Up" - test the bottom level units first (drivers)
- "Hybrid" - a combination of both top-down and bottom-up integration testing
== Isolating parts of the system
- to be able to reliably and automatically test parts of the system we need to isolate them
- the parts need to have a clear contract (the interface used to interact and communicate)
- when parts of the system that the unit / component we want to test depends upon are not implemented these need to be simulated
- a simulated component is usually referred to as a mock, stub or fake
- when the simulated component is using / calling the tested component it is called a driver
== Simulating parts
image::../images/lecture18/mocked-server.png[canvas, size=contain]
== Simulating parts (2)
image::../images/lecture18/mocked-client.png[canvas, size=contain]
include::{includedir}footer.adoc[]
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment