Friday, April 2, 2010

Code Coverage


Coverage is a measure of how completely a test suite exercises the capabilities of a piece of software
  • “Each line of code should be executed at least once”
  • “One test case should be constructed from each specified requirement”
It is necessary to use testing techniques that narrow down the number of test cases allowing the broadest testing coverage with the least effort

Functional testing techniques

Functional testing techniques:

  • Functional analysis
  • Equivalence partitioning
  • Boundary value analysis

Specification Vs. Implementation

The basic approaches to testing software are based on its specification and implementation

  • White box testing – test cases and data are constructed based on the code that implements the software
  • Quality and correctness of computations is validated
  • Will not be further discussed in this tutorial
  • Black box testing – test cases and data are constructed based solely on the software’s specification

Functional System Testing:

  • Testing of a completed application to determine that it provides all of the behaviors required of it.
  • Testing of completed increments that provide some degree of end-user functionality.
  • Search for defects that are variances between the actual operation of the system and the requirements for the system.
  • System is treated as a black box.

Bug, Defect, Issue, Error

Bug: A fault or defect in a system or machine and identified by the tester.

Defect: Whenever the project is received for the analysis phase, may be some requirement miss to get or understand most of the time Defect itself comes with the project (when it comes).

Issue: Client site error most of the time. An issue is a major problem that will impede the progress of the project and cannot be resolved by the project manager and project team without outside help.

Error: When anything is happened wrong in the project from the development side i.e. called as the error. Error is the deviation of a measurement, observation, or calculation from the truth.

Black Box Testing Strategy:

Black Box Testing is not a type of testing; it instead is a testing strategy, which does not need any knowledge of internal design or code etc. As the name "black box" suggests, no knowledge of internal logic or code structure is required. The types of testing under this strategy are totally based/focused on the testing for requirements and functionality of the work product/software application. Black box testing is sometimes also called as "Opaque Testing", "Functional/Behavioral Testing" and "Closed Box Testing".

The base of the Black box testing strategy lies in the selection of appropriate data as per functionality and testing it against the functional specifications in order to check for normal and abnormal behavior of the system. Now a days, it is becoming common to route the Testing work to a third party as the developer of the system knows too much of the internal logic and coding of the system, which makes it unfit to test the application by the developer.

In order to implement Black Box Testing Strategy, the tester is needed to be thorough with the requirement specifications of the system and as a user, should know, how the system should behave in response to the particular action.

Various testing types that fall under the Black Box Testing strategy are: functional testing, stress testing, recovery testing, volume testing, User Acceptance Testing (also known as UAT), system testing, Sanity or Smoke testing, load testing, Usability testing, Exploratory testing, ad-hoc testing, alpha testing, beta testing etc.

These testing types are again divided in two groups: a) Testing in which user plays a role of tester and b) User is not required.

Testing method where user is not required:

Functional Testing:
In this type of testing, the software is tested for the functional requirements. The tests are written in order to check if the application behaves as expected.

Stress Testing:
The application is tested against heavy load such as complex numerical values, large number of inputs, large number of queries etc. which checks for the stress/load the applications can withstand.

Load Testing:
The application is tested against heavy loads or inputs such as testing of web sites in order to find out at what point the web-site/application fails or at what point its performance degrades.

Ad-hoc Testing:
This type of testing is done without any formal Test Plan or Test Case creation. Ad-hoc testing helps in deciding the scope and duration of the various other testing and it also helps testers in learning the application prior starting with any other testing.

Exploratory Testing:
This testing is similar to the ad-hoc testing and is done in order to learn/explore the application.

Usability Testing:
This testing is also called as ‘Testing for User-Friendliness’. This testing is done if User Interface of the application stands an important consideration and needs to be specific for the specific type of user.

Smoke Testing:
This type of testing is also called sanity testing and is done in order to check if the application is ready for further major testing and is working properly without failing up to least expected level.

Recovery Testing:
Recovery testing is basically done in order to check how fast and better the application can recover against any type of crash or hardware failure etc. Type or extent of recovery is specified in the requirement specifications.

Volume Testing:
Volume testing is done against the efficiency of the application. Huge amount of data is processed through the application (which is being tested) in order to check the extreme limitations of the system.

Testing where user plays a role/user is required:

User Acceptance Testing:
In this type of testing, the software is handed over to the user in order to find out if the software meets the user expectations and works as it is expected to.

Alpha Testing:
In this type of testing, the users are invited at the development center where they use the application and the developers note every particular input or action carried out by the user. Any type of abnormal behavior of the system is noted and rectified by the developers.

Beta Testing:
In this type of testing, the software is distributed as a beta version to the users and users test the application at their sites. As the users explore the software, in case if any exception/defect occurs that is reported to the developers.