Unit II. Types of Testing

Similar documents
Shree.Datta Polytechnic College,Dattanagar, Shirol. Class Test- I

EXAMINING THE CODE. 1. Examining the Design and Code 2. Formal Review: 3. Coding Standards and Guidelines: 4. Generic Code Review Checklist:

1: Introduction to Object (1)

CSCI 1100L: Topics in Computing Lab Lab 11: Programming with Scratch

APPLYING YOUR TESTING SKILLS

Repetition Through Recursion

Excerpt from "Art of Problem Solving Volume 1: the Basics" 2014 AoPS Inc.

Chapter 2.6: Testing and running a solution

Memory Addressing, Binary, and Hexadecimal Review

Sample Exam Syllabus

Vidyalankar. T.Y. Diploma : Sem. VI [CO/CM] Software Testing. Prelim Question Paper Solution

SUMMER 12 EXAMINATION Subject Code : Model Answer Page No : 1/ 16

Introduction to Programming

Excel programmers develop two basic types of spreadsheets: spreadsheets

Examination Questions Time allowed: 1 hour 15 minutes

Chapter 9. Software Testing

Taskbar: Working with Several Windows at Once

Magic Tutorial #1: Getting Started

LeakDAS Version 4 The Complete Guide

Intro. Scheme Basics. scm> 5 5. scm>

The Fundamentals. Document Basics

Chapter 8 Software Testing. Chapter 8 Software testing

Input/Output Management

Introduction to Domain Testing

Part II Composition of Functions

Heuristic Evaluation of Team Betamax

Grade 6 Math Circles November 6 & Relations, Functions, and Morphisms

Topics in Software Testing

Verification and Validation

It s possible to get your inbox to zero and keep it there, even if you get hundreds of s a day.

MicroSurvey Users: How to Report a Bug

Keep Track of Your Passwords Easily

1.7 Limit of a Function

Excel Basics Rice Digital Media Commons Guide Written for Microsoft Excel 2010 Windows Edition by Eric Miller

Usable Privacy and Security Introduction to HCI Methods January 19, 2006 Jason Hong Notes By: Kami Vaniea

Clean & Speed Up Windows with AWO

Game keystrokes or Calculates how fast and moves a cartoon Joystick movements how far to move a cartoon figure on screen figure on screen

Black-box Testing Techniques

Statistics Case Study 2000 M. J. Clancy and M. C. Linn

COPYRIGHTED MATERIAL. An Introduction to Computers That Will Actually Help You in Life. Chapter 1. Memory: Not Exactly 0s and 1s. Memory Organization

PART 7. Getting Started with Excel

CDs & DVDs: Different Types of Disk Explained

Binary, Hexadecimal and Octal number system

CONDITION CONTROLLED LOOPS. Introduction to Programming - Python

the NXT-G programming environment

Speed Up Windows by Disabling Startup Programs

ASTQB Advance Test Analyst Sample Exam Answer Key and Rationale

Download Free Pictures & Wallpaper from the Internet

Testing! Prof. Leon Osterweil! CS 520/620! Spring 2013!

It was a dark and stormy night. Seriously. There was a rain storm in Wisconsin, and the line noise dialing into the Unix machines was bad enough to

Part 1: Understanding Windows XP Basics

Topic Notes: Bits and Bytes and Numbers

BTEC Nationals IT - Unit2 FAQs

The Excel Project: Excel for Accountants, Business People... from the Beginning Duncan Williamson

Lecture 3: Linear Classification

Variables and Data Representation

Lecture 1 Contracts : Principles of Imperative Computation (Fall 2018) Frank Pfenning

Printing Envelopes in Microsoft Word

2 A little on Spreadsheets

Chapter01.fm Page 1 Monday, August 23, :52 PM. Part I of Change. The Mechanics. of Change

Computer Science 324 Computer Architecture Mount Holyoke College Fall Topic Notes: Bits and Bytes and Numbers

Lecture 1 Contracts. 1 A Mysterious Program : Principles of Imperative Computation (Spring 2018) Frank Pfenning

NAME EET 2259 Lab 3 The Boolean Data Type

XP: Backup Your Important Files for Safety

Word: Print Address Labels Using Mail Merge

Virtualization. Q&A with an industry leader. Virtualization is rapidly becoming a fact of life for agency executives,

Section 1.1 Definitions and Properties

shortcut Tap into learning NOW! Visit for a complete list of Short Cuts. Your Short Cut to Knowledge

Three OPTIMIZING. Your System for Photoshop. Tuning for Performance

Lecture 15 Software Testing

Burning CDs in Windows XP

SNOWFLAKES PHOTO BORDER - PHOTOSHOP CS6 / CC

Heuristic Evaluation of Covalence

COMP 161 Lecture Notes 16 Analyzing Search and Sort

Software Development. Software Testing: Verification and Validation. Verification and Validation (V&V) Verification. Validation

Divisibility Rules and Their Explanations

STEP-BY-STEP. Hey Joe They just added a frambibulator to the. Testing

Reliable programming

SCRATCH MODULE 3: NUMBER CONVERSIONS

Rapid Software Testing Guide to Making Good Bug Reports

Rescuing Lost Files from CDs and DVDs

Data Structures and Algorithms Dr. Naveen Garg Department of Computer Science and Engineering Indian Institute of Technology, Delhi.

Software Testing Interview Question and Answer

Welfare Navigation Using Genetic Algorithm

Bridge Course On Software Testing

Collector and Dealer Software - CAD 3.1

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION

The 23 Point UX Design Checklist

Text Input and Conditionals

Testing. So let s start at the beginning, shall we

(Refer Slide Time: 00:02:00)

PowerPoint 2003 for Windows Version Technology Workshop: Basic PowerPoint Animation for Music Presentations

Animator Friendly Rigging Part 1

How to Break Software by James Whittaker

Trees Slow Insertion in an Ordered Array If you re going to be doing a lot of insertions and deletions, an ordered array is a bad choice.

Darshan Institute of Engineering & Technology Unit : 9

EXCEL + POWERPOINT. Analyzing, Visualizing, and Presenting Data-Rich Insights to Any Audience KNACK TRAINING

Recursively Enumerable Languages, Turing Machines, and Decidability

Citrix Connectivity Help. Table of Contents

MITOCW watch?v=w_-sx4vr53m

Transcription:

Unit II. Types of Testing 20 Marks Getting Started: The Software Development Process : big-bang, code-and-fix, waterfall, and spiral. In each model, except big-bang, the development team creates a product specification, sometimes called a requirements document, which define what the software will become. The product specification is a written document using words and pictures to describe the intended product. An excerpt from the Windows Calculator product spec might read something like this: - The Edit menu will have two selections: Copy and Paste. These can be chosen by one of three methods: pointing and clicking with the mouse, using access-keys (Alt+C for Copy and Alt+P for Paste), or using the standard Windows shortcut keys of Ctrl+C for Copy and Ctrl+V for Paste. - The Copy function will copy the current entry displayed in the number text box into the Windows Clipboard. The Paste function will paste the value stored in the Windows Clipboard into the number text box. As we can see from above example which explains only two menus of the calculator program, the detailed specification of the software becomes huge or could contain hundreds of pages. So why to create these documents, instead of this we can just let a programmer to write the calculator program. The problem is that you would have no idea what customer eventually gets. The programmer's idea of what it should look like, what functionality it should have, and how the user would use it could be completely different from customers. The only way to assure that the customer will get what s/he wants, is to thoroughly describe the product in a form of specification. The other advantage of having a detailed spec, is that as a tester you ll also have a document as a testable item. You can use it to find bugs before the first line of code is written. Black-Box & White Box Testing Software testers use two ways to method for testing which are Black Box Testing & White Box Testing. Black box testing sometimes referred as functional testing or behavioral testing and White Box testing is referred as clear-box testing. - Black Box testing In black-box testing, the tester only knows what the software is supposed to do he can t look in the box to see how it operates. If he types in a certain input, he gets a certain output. He doesn t know how or why it happens, just that it does.

For example consider windows calculator. If you type 3.14159 and press the sqrt button, you get 1.772453102341. With black-box testing, it doesn t matter what turnings the software goes through to compute the square root of pi. It just does it. Software tester work is just verify the result on another certified calculator and determine if the Windows Calculator is functioning correctly. - White Box testing In white-box testing the software tester has access to the program s code and can examine it for hints to help him with his testing. Software testers can see inside the box. Based on what he sees, the tester may determine that certain numbers are more or less likely to fail and can modify his testing based on that information. Static & Dynamic Testing Two other terms used to describe how software is tested are static testing and dynamic testing. Static testing refers to testing something that s not running examining and reviewing it. Dynamic testing is something that s running and using the software. The best example for these terms is the process you go through when checking out a used car. Kicking the tires, checking the paint, and looking under the hood are static testing techniques. Starting it up, listening to the engine, and driving down the road are dynamic testing techniques. Static Black-Box Testing: Testing the Specification Testing the specification is static black-box testing. The specification is a document, not an executing program, so it s considered static. And it s something that was created using data from many sources usability studies, focus groups, marketing input, and so on. It s not necessary to know how or why that information was obtained or the details of the process used to obtain it. So Black-Box testing. Tester can then take that document, perform static black-box testing, and carefully examine it for bugs.

If software tester does not have a spec. Maybe software is developed using the big-bang model. This is a difficult position. The goal of software tester is to find bugs early ideally finding them before the software is coded but if product doesn t have a spec, this may seem impossible to do. While the spec may not be written down, someone, or several people, knows what they re trying to build. It may be the developer, a project manager, or a marketer. Testers can use them as the walking, talking, product spec and apply the techniques for evaluating specification. Tester can also record the information gathered and can circulate it for review. Performing the High-Level Review of Specification Defining a software product is a difficult process. The first step in testing the specification isn t look for specific bugs. The first step is to stand back and view it from a high level. Examine the spec for large fundamental problems, oversights, and omissions. If tester have a better understanding of the whys and how s behind the spec, it will be very easy for examining the specification it in detail. Following are the techniques by which we can perform the high level review of the specification: 1. Pretend to be a Customer The easiest and first thing for a tester to do when he receives a specification is to pretend to be the customer. Get some information about who is the customer. Testers can get help form marketing or sales people about the end user. If the product is an internal software project, find out who will be using it and talk to them. It s important to understand the customer s expectations. Because quality means meeting the customer s needs. Tester must understand those needs, and take care that the software meets them. As a tester you review a portion of the spec and don t understand it, don t assume that it s correct and go on. Ultimately, this specification is used to design the software tests, so you must understand it. If you find bugs in this process then this is good sign. 2. Research Existing Standards & Guidelines The difference between standards and guidelines is a matter of degree. A standard is much more fixed than a guideline. Standards should be strictly followed. Guidelines are optional but should be followed. So while performing the high level review of the specification following guidelines and standards must be considered. Corporate Terminology and Conventions: If the software is tdesigned for a specific company, it should adopt the common terms and conventions used by the employees of that company. Industry Requirements: The medical, pharmaceutical, industrial, and financial industries have very strict standards that their software must follow. Government Standards: The government, especially the military, has strict standards.

Graphical User Interface (GUI). If software runs under Microsoft Windows or Apple Macintosh operating systems, there are published standards and guidelines for how the software should look and feel to a user. Hardware and Networking Standards: Low-level software and hardware interface standards must be followed, to assure compatibility of the software across different systems. Software testers job isn t to define what standards & guidelines should be applied, s/he s job is to perform his own study to test that the correct standards are being used and that none are overlooked. 3. Review and Test Similar Software One of the best methods for understanding what product will become is to study similar software. This could be a competitor s product or something similar to what project team is creating. The software will not be the exact match, but it will help tester to think about test situations and test approaches. It will also illustrate potential problems that may not have been considered. Following are the things that that must be considered while reviewing the similar software: Scale: Will your software be smaller or larger? Will that size make a difference in your testing? Complexity: Will your software be more or less complex? Will this impact your testing? Testability: Will you have the resources, time, and expertise to test software such as this? Quality/Reliability: Is this software representative of the overall quality planned for your software? Will your software be more or less reliable? Security: What is the competitor's software security, both advertised and actual? Is your software is offering the same of different security? Low-Level Specification Test Techniques After completing the high-level review of the product specification, software testers have a better understanding of exactly what product is and what external impacts affect its design. Using these information software testers can move on for testing the specification at a lower level. Some techniques illustrated below are used to perform low-level specification testing: 1. Specification Attributes Checklist A good & well organized software specification has eight important attributes. These attributes must be checked to perform the low level specification testing. Complete: Is anything missing or forgotten? Is it thorough? Does it include everything necessary to make it stand alone? Accurate: Is the proposed solution correct? Does it properly define the goal? Are there any errors? Precise, Unambiguous, and Clear: Is the description exact and not vague? Is it easy to read and understandable? Consistent: Is the description of the feature written so that it doesn t conflict with itself or other items in the specification?

Appropriate/Relevant: Is it extra information that should be left out? Is the feature are traceable to an original customer need? Feasible: Is the feature can be implemented with the available personnel, tools, and resources within the specified budget and schedule? Code-free: Does the specification stick with defining the product and not the software design, architecture, and code? Testable: Can the feature be tested? Is enough information provided in specification that a tester could create tests to verify its operation? When testing a product spec, reading its text, or examining its figures, carefully consider each of these traits. Check that specification has these attributes. If they don t, there is a bug that needs to be addressed. 2. Specification Terminology Checklist A complement to the previous attributes list is a list of problem words to look for while reviewing a specification. The appearance of these words shows that a feature isn t yet completely understood. Look for these words in the specification and carefully review how they re used in context. Always, Every, All, None, Never- These words denote something as certain (confident) or absolute (complete), make sure that it is, certain. Think of cases that violate them. Certainly, Therefore, Clearly, Obviously, Evidently- These words tend to persuade/encourage you into accepting something as a given. Don t fall into the trap. Some, Sometimes, Often, Usually, Ordinarily, Customarily, Most, Mostly - These words are too vague/unclear. It s impossible to test a feature that operates sometimes. Etc., And So Forth, And So On, Such As - Lists that finish with words such as these aren t testable. Lists need to be absolute/complete or explained so that there s no confusion Good, Fast, Cheap, Efficient, Small, Stable - These are unquantifiable/uncountable /immeasurable terms. They aren t testable. If they appear in a specification, they must be further defined to explain exactly what they mean. Handled, Processed, Rejected, Skipped, Eliminated - These terms can hide large amounts of functionality that need to be specified. If Then (but missing Else) - Look for statements that have If Then clauses but don t have a matching Else. Check that what will happen if the if doesn t happen. Dynamic Black-box Testing Testing the Software while Blindfolded Testing software without having an awareness/insight into the details of code is called dynamic black-box testing. It s dynamic because the program is running. Testers are using it as a customer uses it. And, it s black-box because software is testing without knowing exactly how it works with blinders on. Testers enter input; receive outputs, and check the results. Dynamic black-box testing is also called as behavioral testing because it demonstrates that how the software actually behaves when it s used. To perform the black box testing effectively needs a requirements document or product specification. It s not important to know what happens inside the software box, the important thing

to know is inputting A outputs B or that performing operation C results in D. A good product spec will provides these types of details. Once the ins/input and outs/outputs of the software are understood, it s time to test. The next step is to start defining the test cases. Test cases are the specific inputs that you ll try and the procedures that you ll follow when you test the software. Following figure shows an example of several cases that might use for testing the addition function of the Windows Calculator. Fig. Test cases show the different inputs and the steps to test a program Test-to-Pass & Test-to-Fail The two fundamental approaches for testing software are test-to-pass and test-to-fail. When using test-to-pass, it assure only that the software must minimally works. Software s abilities aren t tested. It is not check that what can be done to break the software. The simplest and most straightforward test cases are applied in test-to-pass approach. The goal of software tester is to find the bugs, so why would use test-to-pass? Test-to-pass is performed to see if the software fundamentally works. It assures that the software does what it specified to do in ordinary circumstances. Some fundamental problems can be traced or found in test-to-pass approach & they can be fixed before starting the testing-to-fail & pushing the limits of the software. Designing and running test cases with the sole purpose of breaking the software is called testingto-fail or error-forcing. In test-to-fail bugs are found by trying different things that will force them out. Test-to-fail cases often don t appear intimidate/threatened. They frequently look like test-to-pass cases, but they re strategically/purposefully chosen to analysis common weaknesses in the software. Equivalence Partitioning/Equivalence Classing The most important task of software testers is selecting test cases. And using the equivalence partitioning the software testers selects the test cases. Equivalence partitioning is the process of methodically reducing the huge (infinite) set of possible test cases into a much smaller, but still equally effective, set. OR Equivalence partitioning is the process of dividing the huge amount of input space in to different classes, which are still equally effective.

As an example consider the possibilities for entering a filename in the standard Save As dialog box. A windows filename can contain any characters except \ / : *? < > and. Filenames can have from 1 to 255 characters. If test cases are created for filenames, this will have equivalence partitions for valid characters, invalid characters, valid length names, names that are too short, and names that are too long. So here the huge input cases are partitioned into five sets or classes which are equally effective as all input sets. The goal of equivalence partitioning is to reduce the set of possible test cases into a smaller, manageable set that still adequately/effectively tests the software. In equivalence partitioning there is risk because in this we are choosing not to test everything, so classes must be carefully chosen/created. Equivalence partitioning can be Subjective. It s science but it s also art. Two testers who test a complex program may create two different sets of partitions. This can be acceptable as long as the partitions are reviewed and they effectively cover the software being tested. Data Testing The simplest view of software is to divide it into two parts: the data (or its domain) and the program. The data is the keyboard input, mouse clicks, disk files, printouts, and so on; and program is the executable flow, transitions, logic, and computations. When performing software testing on the data, it is checked that information that user inputs to the software is handled correctly or not. The example of data would be: The words you type into a word processor, the numbers entered into a spreadsheet, the picture printed by photo software, the backup files stored on floppy disk, the data being sent by modem over the phone lines, etc. The amount of data handled by even the simplest programs can be vast/overwhelming. For example all the possibilities for simple addition on a calculator? So to make any of the data testable is to intelligently reduce the test cases by equivalence partitioning. In data testing the equivalence partitioning is based on a few key concepts boundary conditions, sub-boundary conditions, nulls, and bad data. These key concepts are explained below: 1. Boundary Condition If software can operate on the edge of its capabilities, it will almost certainly operate well under normal conditions. Boundary conditions are special because programming, by its nature, is vulnerable to problems at its edges. Software is binary something that is either true or it isn t. If an operation is performed on a range of numbers, it will work in the middle range, but maybe made a mistake at the edges. Following fig. illustrate how a boundary condition problem can occur into a very simple program. The purpose of this code is to create a 10-element array and initialize each element of the array to 1. In most BASIC scripts, when an array is dimensioned with a stated range in this case, Dim data(10) as Integer the first element created is 0, not 1. The program loops from 1 to 10. The first element of our array is data(0), it doesn t get initialized. When the program completes, the array values look like this: data(0) = 0 data(6) = 1 data(1) = 1 data (7) = 1 data(2) = 1 data(8) = 1 data(3) = 1 data (9) = 1 data(4) = 1 data(10) = 1 data(5) = 1

1: Rem Create a 10 element integer array 2: Rem Initialize each element to -1 3: Dim data(10) As Integer 4: Dim i As Integer 5: For i = 1 To 10 6: data( i ) = -1 7: Next i 8: End Fig. A Simple BASIC Program Demonstrating a Boundary Condition Bug If the same programmer later forgot about this, or a different programmer wasn t aware of how this data array was initialized, he might use the first element of the array, data(0), thinking it was set to 1. Problems such as this are very common and, in large complex software, can result in very bad bugs. Types of Boundary Condition What constitutes a boundary? Usually there are few obvious ones, but if you go dipper & dipper there are more doubtful, interesting, bug porn boundaries. Some of the boundaries for the general software are listed below: Numeric Speed Speed Character Location Location Position Size Size Quantity And these boundaries have following characteristics: First/Last Min/Max Start/Finish Over/Under Empty/Full Shortest/Longest Slowest/Fastest Soonest/Latest Largest/Smallest Highest/Lowest There are many of the possible boundary conditions, but each software testing problem is different and may involve very different data with very unique boundaries. Testing the Boundary Edges The most of the bugs are found due to creating two equivalence partitions. The first should contain data that you would expect to work properly values that are the last one or two valid points inside the boundary. The second partition should contain data that you would expect to cause an error the one or two invalid points outside the boundary Testing outside the boundary is usually as simple as adding one, or a bit more, to the maximum value and subtracting one, or a bit more, from the minimum value. Linke: First 1/Last+1 Start 1/Finish+1 Less than Empty/More than Full Even Slower/Even Faster

Largest+1/Smallest 1 Just Over/Just Under Even Sooner/Later Min 1/Max+1 Even Shorter/Longer Highest+1/Lowest 1 For example; If a text entry field allows 1 to 255 characters, try entering 1 character and 255 characters as the valid partition. Also try 254 characters as a valid choice. Enter 0 and 256 characters as the invalid partitions. 2. Sub-Boundary Condition/ Internal Boundary Condition The normal boundary conditions are the most obvious to find. They re the ones defined in the specification or appear when using the software. Some boundaries, however, that are internal to the software aren t necessarily apparent to an end user but still need to be checked by the software tester. These are known as sub-boundary conditions or internal boundary conditions. To identify this boundary requires a bit general knowledge about how software works. Two examples are powers-of-two and the ASCII table. Ex 1 Powers-of-two Computers and software are based on binary numbers bits representing 0s and 1s, bytes made up of 8 bits, words made up of 4 bytes, and so on. Below table shows the common powers-of-two units and their equivalent values. Term Range or Value Bit 0 or 1 Nibble 0 15 Byte 0 255 Word 0 65,535 or 0 4,294,967,295 Kilo 1,024 Mega 1,048,576 Giga 1,073,741,824 Tera 1,099,511,627,776 Table. Software Powers-of-Two The ranges and values shown in above Table are critical values to treat as boundary conditions. These are not mentioned in the specifications. They re used internally by the software and are invisible, unless of course they create a situation for a bug. For example, if software accepts a range of numbers from 1 to 1000, valid partition includes 1 and 1000, maybe 2 and 999. To cover any possible powers-of-two sub-boundaries, also include the nibble boundaries of 14, 15, and 16, and the byte boundaries of 254, 255, and 256, as we can see these values or range in the above table.

Ex 2 ASCII Table Another common sub-boundary condition is the ASCII character table. Below table is a partial listing of the ASCII table. If the software under testing performs text entry or text conversion, then ASCII table is referred and its boundary conditions are considered. These are also helpful to define what values to include in data partitions. For example, while testing a text box that accepts only the characters A Z and a z, invalid partition should include the values just below and above those in the ASCII table i.e. @, [,, and {. 3. Default, Empty, Blank, Null, Zero, and None Another obvious source of bugs is when the software requests an entry say, in a text box but rather than typing the correct information, the user types nothing. He may just press Enter. This situation is often overlooked in the specification or forgotten by the programmer but is a case may happens in real life. In the save as dialogue box of notepad it ask you the file name by which the file will be saved to hard disk. But if the user doesn t enter any value or name then the software must handle this situation with some default valid values of name. Otherwise some error message should be written. Here in Windows Notepad application the default valid name is untitled.txt. A separate equivalence partition for these values must be created, rather than including them into the valid cases or the invalid cases because the software usually handles them differently. 3. Default, Empty, Blank, Null, Zero, and None The final type of data testing is garbage data. This is where test-to-fail criteria is used. If the software wants numbers, give it letters. If it accepts only positive numbers, enter negative numbers. If it s date sensitive, see if it ll work correctly on the year 3000. Pretend to have fat fingers and press multiple keys at a time. There are no real rules for this testing other than to try to break the software. Be creative. Be devious/tricky.

4. Invalid, Wrong, Incorrect, & Garbage Data The final type of data testing is garbage data. Here test-to-fail technique is used. So, with invalid, wrong, incorrect, and garbage data testing, testers have some fun. If the software wants numbers, give it letters. If it accepts only positive numbers, enter negative numbers. If it s date sensitive, see if it ll work correctly on the year 3000. Pretend to have fat fingers and press multiple keys at a time. There are no real rules for this testing other than to try to break the software. Software testers must be creative at this position. State Testing The way by which we can perform testing is to verify the program s logic flow through its various states. A software state is a condition or mode that the software is currently in. For example consider the Windows Paint program in the pencil drawing state. This is the initial state in which the software starts. In this state the pencil tool is selected, the cursor looks like a pencil, and a fine line is used to draw onscreen. The same program can be in the air-brush state. In this state, the airbrush tool is selected, airbrush sizes are provided, the cursor looks like a spray-paint can, and drawing results in a spray-paint look. Whenever one of the tool from the paint program is selected then it make the software change its look, its menus, or its operation, you re changing its state. The software follows a path through the code, toggles some bits, sets some variables, loads some data, and arrives at a new state of being. So all these conditions must be checked when state stating is to be performed. It must be checked that after selecting the specific tool the software change its state & load the various variables and data. A software tester must test a program s states and the transitions between them. 1. Testing the Software s Logic Flow As we know that to make the testing manageable, the data possibilities are reduced by creating equivalence partitions of only the most vital numbers. Testing the software s states and logic flow has the same problems. It s usually possible to visit all the states. The difficulty is that, it s often impossible to traverse all paths to all states. This problem is similar to the travelling salesperson problem. Given a fixed number of cities and the distance between each pair of them, find the shortest route to visit all of them once, returning to your starting point. This look easy for small number or cities but the number of cities becomes large then it s impossible to calculate all the shortest routes. The solution for this testing is to apply equivalence partition techniques to the selection of the states and paths. By selecting some states & path, it s like taking risk because all the states are not chosen, but reducing them & taking risk by making intelligent choices. So there are some ways by which we can test the software s login flow, these steps are explained as: a) Creating a State Transition Map The first step while testing the logic flow is to create state transition map of the software. Such a map may be provided as part of the product specification & if there is no such map then this map must be created. There are different diagramming techniques for state transition diagrams. Following Fig. shows two examples. One uses boxes and arrows and the other uses circles (bubbles) and arrows. The technique use to draw map isn t important as long as this can be read and understand by the team members.

Fig. State transition diagrams can be drawn by using different techniques A state transition map should show the following items: Each unique state that the software can be in. A good rule is uncertainty about any state that whether something is a separate state, it probably is. You can always collapse it into another state if you find out later that it isn t. The input or condition which takes it from one state to the next. This might be a key press, a menu selection, a sensor input, a telephone ring, and so on. A state can t be exited/changed without some reason. This specific reason will change the state. Set conditions and produced output when a state is entered or exited. This will include a menu and buttons being displayed, a flag being set, a printout occurring, a calculation being performed, and so on. b) Reducing the Number of States and Transitions to Test Just as done with equivalence partitioning for data, we can use that strategy to reduce the number of states and transitions to the state. There are five ways to do this: Visit each state at least once. It doesn t matter how the state is visited, but each state needs to be tested. Test the state-to-state transitions that look like the most common or will be used mostly during program execution. Test the least common paths between states, these paths are rarely used. These paths were overlooked/ignored by the product designers and the programmers. Testers may be the first one to try them. Test all the error states and returning from the error states. Many times error conditions are difficult to create. Programmers write the code to handle specific errors but can t test the code themselves. There are frequent cases when errors aren t properly handled, or when the software doesn t recover properly when the error is fixed. Test random state transitions. If the printed state map is available then randomly select the states and try to move from one state to other.

c) What to specifically test Testing states and state transitions involves checking all the state variables which includes the static conditions, information, values, functionality, and so on that are associated with that state or moving to and from that state. If we consider the startup state of windows paint then following is the list state variables which define the paints startup state. These variables must be checked: The window size is set to what it was the last time Paint was used. The drawing area is blank. The tool box, color box, and status bar are displayed. The pencil tool is selected. All the others are not. The default colors are black foreground on a white background. The document name is untitled. 2. Testing States to Fail In testing states to fail, the test cases are designed are used to fail the software. Examples of such cases are race conditions, repetition, stress, and load. a) Race Conditions and Bad Timing These conditions are appear when two or more events are in queue/line up and confuse the software. And this software didn t expect to be interrupted in the middle of its operation. It is also called as, bad timing. Race condition occurs when multiple processes racing to a finish line, not knowing which will get there first. Following are a few examples of situations that might represent race conditions: Saving and loading the same document at the same time with two different programs Sharing the same printer, communications port, or other peripheral. Pressing keys or sending mouse clicks while the software is loading or changing states Shutting down or starting up two or more instances of the software at the same time Using different programs to simultaneously access a common database These cases are severe and are accidently caused by the user. Software must be robust enough handle these situations. a) Repetition, Stress, and Load Three other test-to-fail state tests are repetition, stress, and load. When programmer didn t consider what might happen in the worst-case scenarios, then these conditions are occurred. Repetition testing involves doing the same operation over and over. This may be sarting up and shutting down the program over and over. It could also mean repeatedly saving and loading data or repeatedly selecting the same operation. The bug may be found after only a couple repetitions or it might take thousands of attempts to detect a problem. The main reason for doing repetition testing is to look for memory leaks.

Stress testing is running the software under less-than-ideal conditions i.e. low memory, low disk space, slow CPUs, slow modems, and so on. Check and determine that what external resources and dependencies software has. Stress testing is simply limiting them to their minimum. The goal is to starve the software. We can also called it as boundary condition testing. Load testing is the opposite of stress testing. With stress testing, we starve the software; with load testing, provide all things that it can handle. Operate the software with the largest possible data files. If the software operates on peripherals such as printers or communications ports, connect as many as possible. For Internet server that can handle thousands of simultaneous connections, do it. Check the software s capabilities. Use time as a load testing variable. Some software should be able to run forever without being restarted. Other Black-Box Test Technique 1. Behave Like a Dumb User The correct term might be inexperienced user or new user. Put a person who s unfamiliar with the software in front of program and they ll do and try things that software testers never imagined. They ll enter data that is never thought of. They ll surf through Web site, clicking things that shouldn t be clicked. They ll discover bugs that software testers completely missed. They can find these bugs because they weren t operating on any rules or making any assumptions. When designing test cases or looking at the software for the first time, try to think like a dumb user. 2. Look for Bugs Where You ve Already Found Them There are two reasons for this: The more bugs you find, the more bugs there are. If you discover that you re finding lots of bugs at the upper boundary conditions, emphasize/stress testing on these upper boundaries on all features. Use few special cases to make sure the problem isn t pervasive/persistent. Many programmers tend to fix only the specific bug that is reported. No more, no less. If you report a bug that starting, stopping, and restarting a program 255 times results in a crash. Then the programmer will fix only that much thing. When you get the software back to retest, make sure you rerun the same test for 256 times and beyond. There could very well be yet another memory leak/bug somewhere out there. 3. Follow Experience, Intuition, and Hunches Experience and intuition can t be taught. They must be gained over time. You can apply all the techniques you ve learned so far and still miss important bugs. As you progress through your career, learning to test different types and sizes of products, you ll know the little tips and tricks that steer/direct you toward those tough-to-find bugs. You ll be able to start testing a new piece of software and quickly find bugs that your peers would have missed. Experience is the name every one gives to their mistakes.