with Jest
Cem Kaner J.D., Ph.D., is a Professor of Software Engineering at Florida Institute of Technology
Cem Kaner J.D., Ph.D., is a Professor of Software Engineering at Florida Institute of Technology
A stakeholder is any individual, group or organization that can affect, be affected by, or perceive itself to be affected [by a programme]
An important question in the testing process is "when should we stop?".
To answer either of these concerns we need a measurement of the quality of the system.
Bugs/LoC
Risk Driven Testing
Bugs fixed / found
Code Smells
Vulnerabilites
Regression errors
UX detriment
Deprecated dependencies
Acceptance incompleteness
(ANSI/IEEE Standard 729, 1983).
Isolation: pure (no side effects) and controlled context
Confidence:
Our test suite must enable confidence.
Our architecture must be testable.
Our logic models might be rethinked (private class fields)
Eric Elliot. Book and libraries author
(while testing front end or backend applications)
(just one opinion)
⚡️⚡️ Waterfall ⛈ ⛈
❓
Unit
Integration
E2E
Static analysis: Eslint or static
type checking
Functional
Integration
E2E
Static analysis: Eslint or static
type checking
Unit
Usability
CB Compatibility
Regression
Security
Acceptance
Network
Visual
Soak
Smoke
Load
≠
Unit
Integration
E2E
Static analysis: Eslint or static
type checking
Jest
Hamill, Paul (2004). Unit Test Frameworks: Tools for High-Quality Software Development.
Unit tests should focus on behaviors that are mostly pure:
Given the same inputs, always return the same output
Have no side-effects
All tests must be isolated from other tests. Tests should have no shared mutable state.
Delightful JavaScript Testing Framework with a focus on simplicity.
// import...
// import mocks or setup factory functions
describe('Title of test suite', () => {
it('Title of test', () => {
// ...
// unit test content
// ...
})
})
// import...
// import mocks or setup factory functions
describe('Title of test suite', () => {
beforeAll(() => {
console.log('starts this test suite')
})
it('Title of test', () => {
// ...
// unit test content
// ...
})
})
// import...
// import mocks or setup factory functions
describe('Title of test suite', () => {
beforeAll(() => {
console.log('starts this test suite')
})
it('Title of test', () => {
// ...
// unit test content
// ...
})
afterAll(() => {
console.log('starts this test suite')
})
})
// import...
describe('Title of test suite', () => {
it('Title of test', () => {
// (optional) test phases
// setup
// act
// assert
})
})
😮