Test-Driven Development (TDD) is a software development approach where tests are written before the actual code. The process follows these steps:
- Write a Test: Create a test for a new function or feature.
- Run the Test: The test will fail initially because the feature isn't implemented yet.
- Write Code: Write the minimal code needed to pass the test.
- Run the Test Again: Ensure the code passes the test.
- Refactor: Clean up the code while ensuring the test still passes.
- Repeat: Continue this cycle for each new feature or function.
- Unit testing
- goal: ensure that each part of the program works correctly on its own.
- Integration testing
- goal: to identify issues that may arise when these components work together.
- End to End testing
- goal: ensures that the complete system operates as expected, including interactions with external interfaces and databases.
- Acceptance testing
- goal: ensures the software does what it is supposed to do based on client requirements.
- Performance testing
- goal: identify performance bottlenecks and ensure the software can handle expected user loads.
- Smoke testing
- goal: ensures that the major functions of the software work correctly before proceeding with more detailed testing.
// vitest
import {describe, it} from "vitest"
// format;
// sucess
// invalid
// empty
// just test the functionality!
describe((), () => {
it("",() => {
expect()
})
})