Unit Testing (UT)
Tests that verify the functionality of individual/specific units of code, usually written by devs as they work on code, to ensure that specific functions are working as expected.
[UT] Benefits
[UT] Case Structure (and the acronym!)
S.E.V.C
[UT] Characteristics
F.R.O.M SLC. FC. C.A.M
[UT] Outcomes
- Verify that no/a particular exception was (not) thrown
[UT] Substitutes
Unit Test substitutes are used to assist in testing a module in isolation.
Integration Testing (IT)
any type of software testing that seeks to verify the interfaces between units or components against a software design.
works to expose defects in the interfaces and interaction between integrated components (aka modules)
IT vs UT
Integration:
Unit:
Test Driven Development (TDD)
Software development process that relies in the repetition of a very short dev cycle
[TDD] Cycle
1) Dev writes an initially failing automated test case, defining a desired improvement or new functionality
2) Dev produces minimum amount of code to pass that test
3) Def refactors the new code to acceptable standards
[TDD] Benefits
Code/Test Coverage (C/T C)
A measure that describes the degree to which source code of a program is tested by a particular test suite. High code coverage means it’s been thoroughly tested and a lower chance of software bugs.
Tests include: U.A.I.R (unit, automated, integrated, regression)
[C/T C] Types
[C/T C] Functional Coverage
has each function (subroutine) in the program been called?
[C/T C] Statement Coverage
Minimum number of paths in which all nodes are covered
[C/T C] Branch Coverage
Minimum number of paths in which all edges are covered
[C/T C] Path Coverage
Number of all paths, from start to end
Cyclomatic Complexity (CC)
Software measurement that indicates program complexity. The number of linearly independent paths through a program’s source code.
[CC] Formula
CC = E-N + 2