Testing strategy
Testing is one of the most important cycle on web development. You must properly plan test strategy before developing web applications. Following are the tests that every one should follow on any development method.
- Unit testing
- Integration testing
- Stress testing
- Performance testing
Unit testing
Traditionally developers walked through their code line by line using a debugger prior to releasing their code as alpha or beta release.
Sometimes they create a rough test application(user interface), that could be used to simulate standard user interaction, edge cases and error conditions. There were lots of difficulties with these approaches.
- Relied on developer to re-execute tests after each change.
- Not automated, and repeatable and tedious process.
To overcome these problems more formal process introduced called unit test.
Unit test isolates a portion of your application and tests all conditions of that unit. It can be fully automated or manual.
Manual unit test is typically one that is documented and then executed by a developer.
Automated unit test is a piece of code that developers write to use a portion of the application code for all conditions.
- NUnit is the first testing framework to work with .Net framework.
- Visual studio team suite 2005 has built in testing framework to automate unit testing in .net framework 2.0
Advantages of Unit test
- Can create complete repeatable test for a given unit of the code.
- Create one, run several times so that code continues to operate as expected.
- New conditions can be added easily.
- Create a test once that will be easier for regression testing.
Integration testing
Unit testing only insures that a portion of a code works as expected or not. To ensure if the overall system works or not when all components are combined is called integration testing.
The primary goal of the integration testing is to find and fix issues that are discovered when individual components are combined together to form a single, cohesive application.
Each module is generally developed by one or more developers. They write the codes, unit test it using application design to ensure that they are building the components that will fit with each other while integration. Only integration testing confirms that the components integrated in a single system are working as expected.
Integration testing happens after unit testing is complete. Many development methodologies like Agile and MSF suggest that integration testing should be continuous.
Components should integration as they are developed most often (every hour or at least once a day) which is called continuous integration.