software testing tutorial_new

Upload: john-son

Post on 03-Apr-2018

214 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/28/2019 Software Testing Tutorial_new

    1/11

    Software Testing

    Software testing is an integral part of Software Development Life Cycle. Testing software or any product in day-to-day

    business applications or in our daily routine work becomes necessary as going around with these, will mess upthings.

    Software Development Life Cycle (SDLC) is a procedural process, in the development of a software product. The

    process is carried in a set of steps, which explains the whole idea about how to go through each product.

    The classification ofSoftware Development Life Cycle process is as follows

    1. Planning

    2. Analysis

    3. Design

    4. Software Development

    5. Implementation

    6. Software Testing

    7. Deployment

    8. Maintenance

    Software Testing is an important factor in a product's life cycle, as the product will have greater life, only when it

    works correctly and efficiently according to the customer's requirements.

    Introduction to Software Testing

    Before moving further towards introduction to software testing, we need to know a few concepts that will simplify the

    definition of software testing.

    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 misfunction.

    http://www.buzzle.com/articles/software-development-life-cycle.htmlhttp://www.buzzle.com/articles/software-development-life-cycle.htmlhttp://www.buzzle.com/articles/software-development/http://www.buzzle.com/articles/software-development/http://www.buzzle.com/articles/software-testing/http://www.buzzle.com/editorials/2-28-2005-66372.asphttp://www.buzzle.com/articles/software-development/http://www.buzzle.com/articles/software-testing/http://www.buzzle.com/editorials/2-28-2005-66372.asphttp://www.buzzle.com/articles/software-development-life-cycle.html
  • 7/28/2019 Software Testing Tutorial_new

    2/11

    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.

    Thus Software testing is the process of finding defects/bugs in the system, which occurs due to an error in the

    application, which could lead to failure of the resultant product and increase in probability of high risk. In short,

    software testing has different goals and objectives, which often include:

    1. finding defects;

    2. gaining confidence in and providing information about the level of quality;

    3. Preventing defects.

    If you are new to the field of software testing, then the article software testing for beginnerswill be of great help.

    Scope of Software Testing

    The primary function of software testing is to detect bugs in order to correct and uncover it. The scope of softwaretesting includes execution of that code in various environment and also to examine the aspects of code - does the

    software do what it is supposed to do and function according to the specifications? As we move further we come

    across some questions such as "When to start testing?" and "When to stop testing?" It is recommended to start

    testing from the initial stages of the software development. This not only helps in rectifying tremendous errors before

    the last stage, but also reduces the rework of finding the bugs in the initial stages every now and then. It also saves

    the cost of the defect required to find it. Software testing is an ongoing process, which is potentially endless but has

    to be stopped somewhere, due to the lack of time and budget. It is required to achieve maximum profit with good

    quality product, within the limitations of time and money. The tester has to follow some procedural way through which

    he can judge if he covered all the points required for testing or missed out any. To help testers to carry out these day-

    to-day activities, a baseline has to be set, which is done in the form of checklists. Read more on checklists for

    software tester.

    Software Testing Key Concepts

    Defects and Failures: As we discussed earlier, defects are not caused only due to the 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 to failures. A defect can turn into a failure due to the change in

    the environment and or the 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 large number of infrequent defects is difficult.

    Static and Dynamic Analysis: Static testing does not require execution of the code for finding defects, whereasin dynamic testing, software code is executed to demonstrate the results of running tests.

    Verification and Validation: Software testing is done considering these two factors.

    1. Verification: This verifies whether the product is done according to the specification?

    2. Validation: This checks whether the product meets the customer requirement?

    http://www.buzzle.com/articles/software-testing-how-to-about-beginners.htmlhttp://www.buzzle.com/articles/software-testing-how-to-about-beginners.htmlhttp://www.buzzle.com/articles/software-testing-checklists-tester.htmlhttp://www.buzzle.com/articles/software-testing-checklists-tester.htmlhttp://www.buzzle.com/articles/software-testing-how-to-about-beginners.htmlhttp://www.buzzle.com/articles/software-testing-checklists-tester.htmlhttp://www.buzzle.com/articles/software-testing-checklists-tester.html
  • 7/28/2019 Software Testing Tutorial_new

    3/11

    Software Quality Assurance: Software testing is an important part of the software quality assurance. Quality

    assurance is an activity, which proves the suitability of the product by taking care of the quality of a product and

    ensuring that the customer requirements are met.

    Software Testing Types:

    Software test type is a group of test activities that are aimed at testing a component or system focused on a specific

    test objective; a non-functional requirement such as usability, testability or reliability. Various types of software testing

    are used with the common objective of finding defects in that particular component.

    Software testing is classified according to two basic types of software testing: Manual Scripted Testing and

    Automated Testing.

    Manual Scripted Testing:

    Black Box Testing

    What is a 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, itis 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

    White Box Testing

    What is a White Box Testing Strategy?

    White box testing strategy deals with the internal logic and structure of the code. White box testing is also called as

    http://www.buzzle.com/articles/quality-control-and-quality-assurance.htmlhttp://www.buzzle.com/editorials/4-10-2005-68349.asphttp://www.buzzle.com/editorials/4-10-2005-68350.asphttp://www.buzzle.com/articles/quality-control-and-quality-assurance.htmlhttp://www.buzzle.com/editorials/4-10-2005-68349.asphttp://www.buzzle.com/editorials/4-10-2005-68350.asp
  • 7/28/2019 Software Testing Tutorial_new

    4/11

    glass, structural, open box or clear box testing. The tests written based on the white box testing strategy incorporate

    coverage of the code written, branches, paths, statements and internal logic of the code etc.

    In order to implement white box testing, the tester has to deal with the code and hence is needed to possess

    knowledge of coding and logic i.e. internal working of the code. White box test also needs the tester to look into the

    code and find out which unit/statement/chunk of the code is malfunctioning.

    Advantages of White box testing are:

    1. As the knowledge of internal coding structure is prerequisite, it becomes very easy to find out which type of

    Input/data can help in testing the application effectively.

    2. The other advantage of white box testing is that it helps in optimizing the code

    3. It helps in removing the extra lines of code, which can bring in hidden defects.

    Disadvantages of white box testing are:

    1. As knowledge of code and internal structure is a prerequisite, a skilled tester is needed to carry out this type

    of testing, which increases the cost.

    2. And it is nearly impossible to look into every bit of code to find out hidden errors, which may create

    problems, resulting in failure of the application.

    Gray Box Testing

    Grey box testing involves having access to internal data structures and algorithms for purposes of designing the test

    cases, but testing at the user, or black-box level. Manipulating input data and formatting output do not qualify as grey

    box, because the input and output are clearly outside of the "black-box" that we are calling the system under test.

    This distinction is particularly important when conductingintegration testingbetween two modules of code written by

    two different developers, where only the interfaces are exposed for test. However, modifying a data repository does

    qualify as grey box, as the user would not normally be able to change the data outside of the system under test. Grey

    box testing may also includereverse engineeringto determine, for instance, boundary values or error messages.

    The levels of software testing life cycle includes:

    Unit Testing

    Integration Testing

    System Testing

    Acceptance Testing

    1. Alpha Testing

    2. Beta Testing

    Other types of software testing are:

    http://en.wikipedia.org/wiki/Integration_testinghttp://en.wikipedia.org/wiki/Integration_testinghttp://en.wikipedia.org/wiki/Integration_testinghttp://en.wikipedia.org/wiki/Reverse_engineering#Reverse_engineering_of_softwarehttp://en.wikipedia.org/wiki/Reverse_engineering#Reverse_engineering_of_softwarehttp://en.wikipedia.org/wiki/Reverse_engineering#Reverse_engineering_of_softwarehttp://www.buzzle.com/articles/software-testing-acceptance-testing.htmlhttp://en.wikipedia.org/wiki/Integration_testinghttp://en.wikipedia.org/wiki/Reverse_engineering#Reverse_engineering_of_softwarehttp://www.buzzle.com/articles/software-testing-acceptance-testing.html
  • 7/28/2019 Software Testing Tutorial_new

    5/11

    Functional Testing

    Performance Testing

    1. Load Testing

    2. Stress Testing

    Smoke Testing

    Sanity Testing

    Regression Testing

    Recovery Testing

    Usability Testing

    Compatibility Testing

    Configuration Testing

    Exploratory Testing

    For further explanation of these concepts, read more on types of software testing.

    Automated Testing: Manual testing is a time consuming process. Automation testing involves automating a manual

    process. Test automation is a process of writing a computer program in the form of scripts to do a testing which would

    otherwise need to be done manually. Some of the popular automation tools are Winrunner, Quick Test Professional

    (QTP), LoadRunner, SilkTest, Rational Robot, etc. Automation tools category also includes maintenance tool such as

    TestDirector and many other.

    Software Testing Methodologies

    The software testing methodologies or process includes various models that built the process of working for a

    particular product. These models are as follows:

    Waterfall Model

    V Model

    Spiral Model

    Rational Unified Process(RUP)

    Agile Model

    Rapid Application Development(RAD)

    These models are elaborated briefly in software testing methodologies.

    Software Testing Artifacts

    Software testing process can produce various artifacts such as:

    http://www.buzzle.com/articles/software-testing-stress-testing.htmlhttp://www.buzzle.com/articles/software-testing-introduction-usability-testing.htmlhttp://www.buzzle.com/articles/software-testing-compatibility-testing.htmlhttp://www.buzzle.com/editorials/7-15-2006-102441.asphttp://www.buzzle.com/articles/types-of-software-testing.htmlhttp://www.buzzle.com/articles/waterfall-model/http://www.buzzle.com/articles/waterfall-model/http://www.buzzle.com/editorials/4-5-2005-68117.asphttp://www.buzzle.com/editorials/4-5-2005-68117.asphttp://www.buzzle.com/editorials/1-13-2005-64082.asphttp://www.buzzle.com/editorials/1-13-2005-64082.asphttp://www.buzzle.com/articles/rational-unified-process-rup-methodology.htmlhttp://www.buzzle.com/articles/software-testing-methodologies.htmlhttp://www.buzzle.com/articles/software-testing-stress-testing.htmlhttp://www.buzzle.com/articles/software-testing-introduction-usability-testing.htmlhttp://www.buzzle.com/articles/software-testing-compatibility-testing.htmlhttp://www.buzzle.com/editorials/7-15-2006-102441.asphttp://www.buzzle.com/articles/types-of-software-testing.htmlhttp://www.buzzle.com/articles/waterfall-model/http://www.buzzle.com/editorials/4-5-2005-68117.asphttp://www.buzzle.com/editorials/1-13-2005-64082.asphttp://www.buzzle.com/articles/rational-unified-process-rup-methodology.htmlhttp://www.buzzle.com/articles/software-testing-methodologies.html
  • 7/28/2019 Software Testing Tutorial_new

    6/11

    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 design 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 software testing strategies are used to check the functionality of individualcomponent that is integrated to give the resultant product. These test cases are developed with the objective

    of judging the application for its capabilities or features.

    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 Scripts: 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.

    Software Testing Process

    Software testing process is carried out in the following sequence, in order to find faults in the software system:

    1. Create Test Plan

    2. Design Test Case

    3. Write Test Case

    4. Review Test Case

    5. Execute Test Case

    6. Examine Test Results

    7. Perform Post-mortem Reviews

    8. Budget after Experience

    Here is a sample Test Case for you:

    # Software Test Case for Login Page:

    Purpose: The user should be able to go to the Home page.

    Pre-requisite:

    1. S/w should be compatible with the Operating system.

    2. Login page should appear.

    3. User Id and Password textboxes should be available with appropriate labels.

    http://www.buzzle.com/articles/software-testing-test-cases.htmlhttp://www.buzzle.com/articles/software-testing-test-cases.htmlhttp://www.buzzle.com/articles/software-testing-test-cases.html
  • 7/28/2019 Software Testing Tutorial_new

    7/11

    4. Submit and Cancel buttons with appropriate captions should be available.

    Test Data: Required list of variables and their values should be available.eg: User Id:{Valid

    UserId, Invalid UserId, empty}, Password:{Valid, Invalid, empty}.

    Software Testing - Test CasesWhat are test cases in software testing, how they are designed and why they are so important to the entire testing

    scenario, read through to know more..

    What is a Test Case?

    A test case is a set of conditions or variables and inputs that are developed for a particular goal or objective to be

    achieved on a certain application to judge its capabilities or features.

    It might take more than one test case to determine the true functionality of the application being tested. Every

    requirement or objective to be achieved needs at least one test case. Some software development methodologies

    like Rational Unified Process (RUP) recommend creating at least two test cases for each requirement or objective;

    one for performing testing through positive perspective and the other through negative perspective.

    Test Case Structure

    A formal written test case comprises of several parts -

    1. InformationInformation consists of general information about the test case. Information incorporates Identifier, test casecreator, test case version, name of the test case, purpose or brief description and test case dependencies.

    2. Activity

    Activity consists of the actual test case activities. Activity contains information about the test case

    environment, activities to be done at test case initialization, activities to be done after test case is performed,

    step by step actions to be done while testing and the input data that is to be supplied for testing.

    3. ResultsResults are outcomes of a performed test case. Results data consist of information about expected resultsand the actual results.

    Designing Test Cases

    Test cases should be designed and written by someone who understands the function or technology being tested. A

    test case should include the following information -

    Purpose of the test

    Software requirements and Hardware requirements (if any)

  • 7/28/2019 Software Testing Tutorial_new

    8/11

    Specific setup or configuration requirements

    Description on how to perform the test(s)

    Expected results or success criteria for the test

    Designing test cases can be time consuming in a testing schedule, but they are

    worth giving time because they can really avoid unnecessary retesting or

    debugging or at least lower it. Organizations can take the test cases approach in

    their own context and according to their own perspectives. Some follow a general

    step way approach while others may opt for a more detailed and complex approach.

    It is very important for you to decide between the two extremes and judge on what

    would work the best for you. Designing proper test cases is very vital for your

    software testing plans as a lot of bugs, ambiguities, inconsistencies and slip ups can

    be recovered in time as also it helps in saving your time on continuous debugging

    and re-testing test cases.

    Note:Refer to the bellow sample test case.

    Test Case 01Test Objectives To test whether the name field accepts numbersTest Data A100

    Expected ResultsAn Error message should appear stating that the data entry isunsuccessful

    Actual Results An error message appearedConclusion Actual results matched expected results.

    Test Plan

    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 includesUserId and Password textboxes with appropriate

    labels. Also expects that Submit and Cancel buttons

    are available with appropriate captions

    Screen displays user interfacrequirements according to th

    user.

    2. TC2. Textbox for UserId

    should:

    i) User types numbers into the textbox. i) Error message is displayed

    for numeric data.

  • 7/28/2019 Software Testing Tutorial_new

    9/11

    i)allow only alpha-

    numeric

    characters{a-z, A-

    Z}

    ii)not allow special

    characters

    like{'$','#','!','~','*',...}

    iii)not allow numeric

    characters like{0-9}

    ii) User types alphanumeric data in the textbox. ii) Text is accepted when use

    enters alpha-numeric data in

    the textbox.

    3. TC3. Checking

    functionality of the

    Password textbox:

    i)Textbox for

    Password should

    accept more than

    six characters.

    ii)Data should be

    displayed in

    encrypted format.

    i) User enters only two characters in the password

    textbox.

    i) Error message is displayed

    when user enters less than s

    characters in the password

    textbox.

    ii) User enters more than six characters in the

    password textbox.

    System accepts data when

    user enters more than six

    characters into the passwordtextbox.

    ii) User checks whether his data is displayed in the

    encrypted format.

    System accepts data in the

    encrypted format else displa

    an error message.

    4. TC4. Checking

    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 applicatio

    as soon as he clicks on the

    'SUBMIT' button.

    5. TC5. Checking

    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 textboxes for UserId

    and Password are reset to blank by clicking on the

    'CANCEL' button.

    ii) System clears the data

    available in the UserId and

    Password textbox when user

    clicks on the 'CANCEL' butto

    Fault Finding Techniques in Software Testing

    Finding of a defect or fault in the earlier parts of the software not only saves time and money, but is also efficient in

    terms of security and profitability. As we move forward towards the different levels of the software, it becomes difficult

    and tedious to go back for finding the problems in the initial conditions of the components. The cost of finding the

    defect also increases. Thus it is recommended to start testing from the initial stages of the life cycle.

    There are various techniques involved along with the types of software testing. There is a procedure that is to be

  • 7/28/2019 Software Testing Tutorial_new

    10/11

    followed for finding a bug in the application. This procedure is combined into the life cycle of the bug in the form of

    contents of a bug, depending upon the severity and priority of that bug. This life cycle is named as the bug life cycles,

    which helps the tester in answering the question - how to log a bug?

    Measuring Software Testing

    There arises a need of measuring the software, both, when the software is under development and after the system

    is ready for use. Though it is difficult to measure such an abstract constraint, it is essential to do so. The elements

    that are not able to be measured, needs to be controlled. There are some important uses of measuring the software:

    Software metrics helps in avoiding pitfalls such as

    1. cost overruns,

    2. in identifying where the problem has raised,

    3. Clarifying goals.

    It answers questions such as:

    1. What is the estimation of each process activity?

    2. How is the quality of the code that has been developed?

    3. How can the under developed code be improved? etc .

    It helps in judging the quality of the software, cost and effort estimation, collection of data,

    productivity and performance evaluation.

    Some of the common software metrics are:

    Code Coverage

    Cyclomatic complexity

    Cohesion

    Coupling

    Function Point Analysis

    Execution time

    Source lines of code

    Bug per lines of code

    http://www.buzzle.com/editorials/4-11-2005-68386.asphttp://www.buzzle.com/editorials/4-6-2005-68177.asphttp://www.buzzle.com/editorials/4-6-2005-68177.asphttp://www.buzzle.com/editorials/4-11-2005-68387.asphttp://www.buzzle.com/editorials/4-11-2005-68386.asphttp://www.buzzle.com/editorials/4-6-2005-68177.asphttp://www.buzzle.com/editorials/4-11-2005-68387.asp
  • 7/28/2019 Software Testing Tutorial_new

    11/11

    In short, measurement of software is for understanding, controlling and improvement of the software system.

    Software is subject to changes, with respect to, changing environmental conditions, varying user requirements, as

    well as configuration and compatibility issues. This gives rise to the development of newer and updated versions of

    software. But, there should be some source of getting back to the older versions easily and working on them

    efficiently. Testers play a vital role in this. Here is where change management comes into picture.

    Software Testing Certifications

    Software testing certifications will not only boost up ones knowledge, but also prove to be beneficial for his academic

    performance. There are some software testing certification programs that can support the professional aspirations of

    software testers and quality assurance specialists.

    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

    Quality Assurance Certifications:

    CSQA- Certified Software Quality Analyst

    Software Quality Assurance Certification

    CSQE- Certified Software Quality Engineer

    CQIA- Certified Quality Improvement Associate

    Software testing is indeed a vast field and accurate knowledge is crucial to ensure the quality of the software

    developed. I consider that this article on software testing tutorial must have given you a clearer idea on various

    software testing types, methodologies and different software testing strategies.

    http://www.buzzle.com/articles/change-management/http://www.buzzle.com/articles/quality-assurance-certification.htmlhttp://www.buzzle.com/articles/change-management/http://www.buzzle.com/articles/quality-assurance-certification.html