software testing tutorial
Software Testing Tutorial
Software testing is an integral part of Software Development Life Cycle. This article highlights the key concepts of software testing and the various steps involved in the same.
- Planning
- Analysis
- Design
- Software Development
- Implementation
- Software Testing
- Deployment
- Maintenance
- Error: Error or mistake is a human action that produces wrong or incorrect result.
- Defect (Bug, Fault): A flaw in the system or a product that can cause the component to fail or malfunction.
- Failure: It is the variance between the actual and expected result.
- Risk: Risk is a factor that could result in negativity or a chance of loss or damage.
- Finding defects
- Gaining confidence and providing information about the level of quality
- Preventing defects
- Defects and Failures: As we discussed earlier, defects are not caused only due to coding errors, but most commonly due to the requirement gaps in the non-functional requirement, such as usability, testability, scalability, maintainability, performance and security. A failure is caused due to the deviation between an actual and an expected result. But not all defects result in failures. A defect can turn into a failure due to a change in the environment or a change in the configuration of the system requirements.
- Input Combination and Preconditions: Testing all combination of inputs and initial state (preconditions), is not feasible. This means finding a large number of infrequent defects is difficult.
- Static and Dynamic Analysis: Static testing does not require execution of the code for finding defects, whereas in dynamic testing, software code is executed to demonstrate the results of the tests.
- Verification and Validation: Software testing is done considering these two factors.
- Verification: This verifies whether the product has been designed according to the specification.
- Validation: This checks whether the product meets the requirements of customers.
- Software Quality Assurance: Software testing is an important part of quality assurance. Quality assurance is an activity, which proves the suitability of the product by taking care of the quality of the product and ensuring that the customer requirements are met.
- Black Box Testing
- White Box Testing
- Gray Box Testing
- Unit Testing
- Integration Testing
- System Testing
- Acceptance Testing (Alpha Testing & Beta Testing)
- Functional Testing
- Performance Testing (Load Testing & Stress Testing)
- Smoke Testing
- Sanity Testing
- Regression Testing
- Recovery Testing
- Usability Testing
- Compatibility Testing
- Configuration Testing
- Exploratory Testing
- Waterfall Model
- V Model
- Spiral Model
- Rational Unified Process (RUP)
- Agile Model
- Rapid Application Development (RAD)
- Test Plan: A test specification is called a test plan. A test plan is documented so that it can be used to verify and ensure that a product or system meets its design specification.
- Traceability matrix: This is a table that correlates or designs documents to test documents. This verifies that the test results are correct and is also used to change tests when the source documents are changed.
- Test Case: Test cases and strategies are used to check the functionality of individual components that are integrated to give the resultant product. These test cases are developed with the objective of judging the application for its capability or feature.
- Test Data: When multiple sets of values or data are used to test the same functionality of a particular feature in the test case, the test values and changeable environmental components are collected in separate files and stored as test data.
- Test Script: The test script is the combination of a test case, test procedure and test data.
- Test Suite: Test suite is a collection of test cases.
- Create Test Plan
- Design Test Case
- Write Test Case
- Review Test Case
- Execute Test Case
- Examine Test Results
- Perform Post-mortem Reviews
- Budget after Experience
- Purpose: The user should be able to go to the Home page.
- Pre-requisite:
- S/w should be compatible with the Operating system.
- Login page should appear.
- User Id and Password text boxes should be available with appropriate labels.
- Submit and Cancel buttons with appropriate captions should be available.
- Test Data: Required list of variables and their values should be available. For example: User Id:{Valid User Id, Invalid User Id, empty}, Password:{Valid, Invalid, empty}.
Sr. No | Test Case Id | Test Case Name | Steps/Action | Expected Results |
1. | TC1. | Checking User Interface requirements. | User views the page to check whether it includes User Id and Password text boxes with appropriate labels. Also, the Submit and Cancel buttons should be available with appropriate captions. | Screen displays user interface requirements according to the user. |
2. | TC2. | Text box for User Id should: i) Allow only alphanumeric characters {a-z, A-Z}, ii) Not allow special characters like {'$','#','!','~','*',...}, iii) Not allow numeric characters like {0-9} | i) User types numbers into the text box. | i) Error message is displayed for numeric data. |
ii) User types alphanumeric data in the text box. | ii) Text is accepted when user enters alphanumeric data into the text box. | |||
3. | TC3. | Checking the functionality of the Password text box: i) Text box for Password should accept six or more characters. ii) Data should be displayed in encrypted format. | i) User enters only two characters in the password text box. | i) Error message is displayed when user enters less than six characters in the password text box. |
ii) User enters more than six characters in the password text box. | System accepts data when user enters more than six characters into the password text box. | |||
ii) User checks whether the data is displayed in the encrypted format. | System accepts data in the encrypted format else displays an error message. | |||
4. | TC4. | Checking the functionality of 'SUBMIT' button. | i) User checks whether 'SUBMIT' button is enabled or disabled. | i) System displays 'SUBMIT' button as enabled |
ii) User clicks on the 'SUBMIT' button and expects to view the 'Home page' of the application. | ii) System is redirected to the 'Home page' of the application as soon as he clicks on the 'SUBMIT' button. | |||
5. | TC5. | Checking the functionality of 'CANCEL' button. | i) User checks whether 'CANCEL' button is enabled or disabled. | i) System displays 'CANCEL' button as enabled. |
ii) User checks whether the text boxes for User Id and Password are reset to blank by clicking on the 'CANCEL' button. | ii) System clears the data available in the User Id and Password text box when user clicks on the 'CANCEL' button. |
- Software metrics help in avoiding pitfalls such as:
- Cost overruns
- In identifying where the problem has raised
- Clarifying goals
- It answers questions such as:
- What is the estimation of each process activity?
- What is the quality of the code that has been developed?
- How can the underdeveloped code be improved?
- It helps in judging the quality of the software, cost and effort estimation, collection of data, productivity and performance evaluation.
- Code Coverage
- Cyclomatic complexity
- Cohesion
- Coupling
- Function Point Analysis
- Execution time
- Source lines of code
- Bug per lines of code
- ISTQB - International Software Testing Qualifications Board
- CSTE - Certified Software Tester
- CSTP - Certified Software Test Professional
- CTM - Certified Test Manager
- CSPM - Certified Software Project Manager
- CSPE - Certified Software Process Engineer
- CAST - Certified Associate in Software Testing
- CSQA - Certified Software Quality Analyst
- Software Quality Assurance Certification
- CSQE - Certified Software Quality Engineer
- CQIA - Certified Quality Improvement Associate