- DevOps
- CI/CD
- Testing
- Example
➡️ Focus on People, Processes and Tools for the benefit of business agility.
- 💡 Idea, Userstories
</>
Code, Programming the Idea- ⚙️ Build, Executables
- 📦 Deploy, Runtime Environment
- 🔍 Manage, Production (and Testing)
- 📈 Learn, Continuous Improvement
➡️ Build. Test. Deploy. Continuous integration, automated testing and deployment.
- Purpose: to avoid “merge hell”.
- Typically done by a CI/CD server/pipeline.
- Benefit: always have a testable and functional build.
➡️ Commit code to a shared repo frequently.
- Commit, push/pull code constantly.
- Each commit triggers automated (unit) tests.
➡️ Deploy code automatically.
- If the CI tests are successful, commits will be deployed automatically.
- unit test
- test individual units of code (e.g. single functions).
- tools: e.g.
JEST
- integration test
- test multiple components & services and how they work together.
- e2e test
- test entire apps, like an end user would do.
- simulate human behavior (e.g. by clicking buttons automatically).
- tools: e.g.
CYPRESS
- performance test
- functional test
- etc.
- Unit Tests (highest priority)
- API Tests (high priority)
- UI Tests (normal priority)
- Exploratory Tests (mimic user behavior to find bugs/errors)
- UX Tests (user experience)
- Beta Test (5% of user base)
➡️ Use sample data. Simulate (data) input.
- sum.js
- sum.test.js
function sum( a, b ) {
return a + b
}
// "test suite" = collection of tests
describe( 'My Feature', () => {
// description of what is being tested
// describing the behavior of the code
it('finds the sum of a and b', () => {
// run/execute code
const result = sum( 2, 2 );
// test some fixed sample data
expext( typeof result ).toBe( 'number' );
expect( result ).toEqual( 4 );
expect( result ).not.toBe( null );
} );
} );