Académique Documents
Professionnel Documents
Culture Documents
Strategy:
Effective testing is important, so is the strategy. By reviewing the Test Specification prior to testing, one can assess the completeness of tests and testing tasks. An effective test plan and procedure will lead to the orderly construction of the software and the discovery of errors at each stage in the construction phase. Points to be considered here are, 1. 2. 3. As a first step, applicability and scope of unit testing has to be defined The objectives of testing like test effectiveness, test coverage, the cost to find and fix defects should be clearly stated within the test plan in measurable terms. Selection of right tool is another important step at this stage. Below parameters can be considered while selecting a tool, a. Project environment and technology b. Amount of code to be written newly c. Amount of code that undergoes frequent changes d. Lifespan of product being developed e. Team size and effort estimated for the project f. Budget
4. 5.
6.
List of tools available at Tools_list can be referred for some of the commonly used unit testing tools. Regression testing definition, frequency, actions to be stated in test plan Test plan should be implemented effectively in the project with the tool selected Formal technical reviews should be conducted periodically to assess the test strategy and test cases
2. 3. 4. 5. 6. 7.
-The scope of testing (what needs to be tested) -Number of assert statements per test -Timeout value for tests -Test runner (testing framework to be used for execution) etc Share the created configuration with the entire team Generate the test cases using defined configuration fie. Review the tests generated and update with application-specific input values Try to pass all feasible boundary values as test input values to uncover more errors. Consider negative input values s too Identify parameterizable fields in a application and generate parameterized tests (Data driven tests) Associate the data source with parameterized tests.
2. 3. 4. 5. 6. 7.
Verify and validate the test execution results reported by tool Isolate the failures reported by tool, prioritize and fix them by editing the offending source-code. As a good practice, fix the problems related to exceptions first, then functionality problem followed by others Re-run the tests to ensure the correctness Baseline these tests for further regression testing Run the base-lined set of tests on regular basis to validate code behavior with changes Track this activity at project level through review meetings
Coverage analysis:
Code coverage analysis measures the degree to which the source code has been tested. It is the way to verify effectiveness of source code as well as test cases. In other words, the coverage of code is the best indication of how well the code has been tested. Coverage analysis results can also be used to identify unexecuted code of program (dead code). Most of the unit testing tools offer both customizable annotated representation of covered/ uncovered code and sharable coverage statistics. Coverage analyzer can be executed post test case execution to get the coverage details in which coverage at different levels including line coverage and decision coverage can be tracked. Recommended actions in case of lesser coverage: 1. Clean up the code by removing/modifying the unexecuted lines of code 2. Review tests and test input values to include missed conditions/scenarios 3. Parameterize the test input by associating with data-sources like excel, databases to pass wide range of input values 4. Use user defined objects, stubs and mock objects to handle units with domain specific objects and dependencies
Reports
Java
x x x
x x x
x x x x x
x x x
C/C++
.Net
* Frameworks
Conclusion:
All of us are interested in improving the quality of the applications we develop. However, formal manual testing methodologies are simply impractical to implement for 100% of code coverage. Tool-assisted process offers both an efficient and effective ways to identify and locate defects without requiring painstaking tasks. Further, the best tools alone arent enough; well-defined processes arent enough. Whats required is, A lifecycle approach to quality, Structured planning and design of the environment, Consistent use of best practices.