Week 3 Flashcards
(62 cards)
What is Software
testing?
Software testing is the process of
evaluating a software solution to
ensure that it behaves as expected
and meets the specified
requirements.
It involves executing the software
under controlled conditions and
assessing its behavior to identify
any defects or bugs
Bugs?
A fault, also called a bug or a defect, is an
erroneous software or hardware element of a
system that can cause the system to fail
Why do we test?
Finding defects or bugs
Ensuring quality
Validating requirements
Improving user experience
Test-Driven Development, what is this
is a software development approach in which tests are written
before the actual implementation code
What are some core principles of TDD
- Every step in the development process must
start with a plan of how to verify that the result
meets a goal - The developer should not create a software
artifact (a system requirement, a UML diagram,
or source code) unless they know how it will be
tested
*the process is iterative too
TDD Steps: “Red-Green-Refactor” cycle Explain it
Write a failing test (Red): In this step, the developer writes a test case that specifies the desired behaviour or functionality of the code to be implemented. Since there is no implementation code yet, the test case will fail initially.
Write the minimal implementation code to pass the test (Green): In this step, the developer writes the minimum amount of code necessary to make the failing test pass. The focus is on writing code that fulfils the requirements of the test case without introducing unnecessary complexity or functionality.
Refactor the code (Refactor): After the test case passes, the developer refactors the code to
improve its design, readability, and maintainability while keeping all tests passing. This step
ensures that the codebase remains clean and well-structured as new functionality is added.
What are some benefits of TDD
Improved code quality
Reduced bugs
Faster feedback loop
Better documentatio
Define a fault
A defect or bug, is an erroneous hardware or software element of a system that can cause the system to fail
Define a test case
is a particular choice of input data to be used in
testing a program and the expected output or behaviour
Define testss
is a finite collection of test cases
Define White-box testing
exploits structure within the program (assumes code available)
The internal workings of the system are transparent to whoever is testing, perspective of an end user
Define Black-box testing
Explores input space of functionality defined by an interface specification
The internal workings of the system
are hidden from the tester
Integration test
Ensures that all components work together
function test
checks functional requirements
quality test
checks nonfunc reqirements
acceptance test
Customer checks ALL requirements
form of black-box testing
installation test
Testing in user environment
unit test
Ensures that each component works as specified
what makes up System Testing
Functional Testing
Quality Testing
Acceptance Testing
Installation Testing
what is coverage
measures the degree to which the specification or code of a
software program has been exercised by tests
Test Coverage AKA (Big picture):
Specification testing focuses on the coverage of the input space, without necessarily testing
each part of the software
ie Acceptance tests
Code Coverage (Implementation details):
Code coverage measures the degree to which the elements of the program
source code have been tested
ie Unit tests
Heuristics for achieving high coverage:
Black Box Testing
*equivalence testing
* boundary testing
White Box Testing
* control-flow testing
* state-based testing
What is Equivalence testing
is a black-box testing method
that divides the space of all possible inputs into
equivalence groups/classes such that the program
is expected to “behave the same” on each input from
the same group
* Assumption: A well-intentioned developer may have made
mistakes that affect a whole class of input values
* Assumption: We do not have any reason to believe that
the developer intentionally programmed special behavior
for any input combinations that belong to a single class of
input values