You are on page 1of 11

1. Item name is alphabetic (valid) 2. Item name is not alphabetic (invalid) 3.

Item name is less than 2 characters in length (invalid) 4. Item name is 2 to 15 characters in length (valid) 5. Item name is greater than 15 characters in length (invalid) 6. Size value is less than 1 (invalid) 7. Size value is in the range 1 to 48 (valid) 8. Size value is greater than 48 (invalid) 9. Size value is a whole number (valid) 10. Size value is a decimal (invalid) 11. Size value is numeric (valid) 12. Size value includes nonnumeric characters (invalid) 13. Size values entered in ascending order (valid) 14. Size values entered in nonascending order (invalid) 15. No size values entered (invalid) 16. One to five size values entered (valid) 17. More than five sizes entered (invalid) 18. Item name is first (valid) 19. Item name is not first (invalid) 20. A single comma separates each entry in list (valid) 21. A comma does not separate two or more entries in the list (invalid) 22. The entry contains no blanks (???) 23. The entry contains blanks (????) 24. Black Box Test Cases for the Grocery Item Example based on the Equivalence Classes Above. # 1 2 3 4 5 6 7 8 9 10 11 12 Test Data xy,1 AbcDefghijklmno,1,2,3 ,4,48 a2x,1 A,1 abcdefghijklmnop Xy,0 XY,49 Xy,2.5 xy,2,1,3,4,5 Xy XY,1,2,3,4,5,6 1,Xy,2,3,4,5 Expected Outcome T T F F F F F F F F F F Classes Covered 1,4,7,9,11,13,16,18,20,22 1,4,7,9,11,13,16,18,20,23 2 3 5 6 8 10 14 15 17 19

13 14

XY2,3,4,5,6 AB,2#7

F F

21 12

What is "Equivalence Class Partitioning"?


We define "Equivalence Class Partitioning" as a method that can help you derive test cases. You identify classes of input or output conditions. The rule is that each member in the class causes the same kind of behavior of the system. In other words, the "Equivalence Class Partitioning" method creates sets of inputs or outputs that are handled in the same way by the application. Another definition taken from Wikipedia: "A technique in black box testing. It is designed to minimize the number of test cases by dividing tests in such a way that the system is expected to act the same way for all tests of each equivalence partition. Test inputs are selected from each class. Every possible input belongs to one and only one equivalence partition."

Why learn "Equivalence Class Partitioning"?


This method drastically reduces the number of test cases that are required to be tested because we don't have time, money or manpower to test everything. In addition, it can help you find many errors with the smallest number of test cases.

How to use "Equivalence Class Partitioning"?


There are 2 major steps we need to do in order to use equivalence class partitioning: y Identify the equivalence classes of input or output. Take each input's or output's condition that is described in the specification and derive at least 2 classes for it: o One class that satisfies the condition the valid class. o Second class that doesn't satisfy the condition the invalid class. Design test cases based on the equivalence classes.

Example 1
In a computer store, the computer item can have a quantity between -500 to +500. What are the equivalence classes? Answer: Valid class: -500 <= QTY <= +500 Invalid class: QTY > +500 Invalid class: QTY < -500 Example 2 In a computer store, the computer item type can be P2, P3, P4, and P5 (each type influences the price). What are the equivalence classes? Answer: Valid class: type is P2 Valid class: type is P3 Valid class: type is P4 Valid class: type is P5 Invalid class: type isnt P2, P3, P4 or P5

Practice
Bank account can be 500 to 1000 or 0 to 499 or 2000 (the field type is integer). What are the equivalence classes? Try to solve it before reading the answer.

Practice 1 - answer

y y y y y y

Valid class: 0 <= account <= 499 Valid class: 500 <= account <= 1000 Valid class: 2000 <= account <= 2000 Invalid class: account < 0 Invalid class: 1000 < account < 2000 Invalid class: account > 2000

Equivalence Class Vs Boundary Testing


Let us discuss about the difference between Equivalence class and boundary testing. For the discussion we will use the practice question: Bank account can be integer in the following ranges: 500 to 1000 or 0 to 499 or 2000. What are the equivalence classes? Answer: y y y y y y valid class: 0 <= account <= 499 valid class: 500 <= account <= 1000 valid class: 2000 <= account <= 2000 invalid class: account < 0 invalid class: 1000 < account < 2000 invalid class: account > 2000

In equivalence class, you need to take one value from each class and test whether the value causes the system to act as the class' definition. It means that in this example, you need to create at least 6 test cases one for each valid class and one for each invalid class. How many test cases will be, if you use boundary testing? The following table shows how much test cases will be using "Boundary Testing" method: Test Case # 1 2 3 4 5 6 7 8 9 10 11 12 13 Value Result -1 Invalid 0 1 498 499 500 501 Valid Valid Valid Valid Valid Valid

999 Valid 1000 Valid 1001 Invalid 1999 Invalid 2000 Valid 2001 Invalid

In boundary testing, you need to test each value in the boundary and you know the value, you don't need to choose it from any set. In this example you have 13 test cases. Now, let us exam how to combine this 2 methods together. The following table shows all the boundary testing values and their equivalence classes:

# 1 2 3 4 5 6 7 8 9 10 11 12 13

Boundary Value -1 0 1 498 499 500 501 999 1000 1001 1999 2000 2001

Equivalence Class account < 0 0 <= account <= 499 0 <= account <= 499 0 <= account <= 499 0 <= account <= 499 500 <= account <= 1000 500 <= account <= 1000 500 <= account <= 1000 500 <= account <= 1000 1000 < account < 2000 1000 < account < 2000 2000 <= account <= 2000 account > 2000

Result Invalid Valid Valid Valid Valid Valid Valid Valid Valid Invalid Invalid Valid Invalid

Now, we can reduce some of the test cases that belong to the same equivalence class. We can delete lines 3 and 4 which belong to equivalence class "0 <= account <= 499". We also can delete lines 7 and 8 hich belong to "500 <= account <= 1000". The new table will be: # 1 2 5 6 9 10 11 12 13 Boundary Value -1 0 499 500 1000 1001 1999 2000 2001 Equivalence Class account < 0 0 <= account <= 499 0 <= account <= 499 500 <= account <= 1000 500 <= account <= 1000 1000 < account < 2000 1000 < account < 2000 2000 <= account <= 2000 account > 2000 Result Invalid Valid Valid Valid Valid Invalid Invalid Valid

Invalid You can even reduce more test cases although in my opinion, it is important to keep this table because it keeps a hard connection to the boundary testing. You can see in the table that I didn't reduce those test cases that are touch in the boundary itself of each range. Let's reduce more test cases (just for the fun and for the practice (test case 5, 9 and 10): # Boundary Value Equivalence Class Result 1 2 6 11 12 -1 0 500 1999 2000 account < 0 0 <= account <= 499 500 <= account <= 1000 1000 < account < 2000 2000 <= account <= 2000 Invalid Valid Valid Invalid Valid

Invalid Now, in this table, for each equivalence class, you choose one value that belongs to boundary testing. A smart man once told me that when I write a test case and I using equivalence class partitioning, not to write specific values. Instead, he told me to write the classes and their expected results. By that, each time a tester will run the test case he will choose new candidates from each class. Using that working method we can promise that each running will contain new values.

13

2001

account > 2000

ts important that all testers should be able to write test cases based on Equivalence partitioning and Boundary value analysis. Taking this into consideration ISTQB is having significant importance for this topic in ISTQB Foundation level Certificate exam. Good practice and logical thinking can make it very easy to solve these questions. What is Equivalence partitioning? Equivalence partitioning is a method for deriving test cases. In this method, equivalence classes (for input values) are identified such that each member of the class causes the same kind of processing and output to occur. The values at the extremes (start/end values or lower/upper end values) of such class are known as Boundary values. Analyzing the behavior of a system using such values is called Boundary value analysis (BVA). Here are few sample questions for practice from ISTQB exam papers on Equivalence partitioning and BVA. (Ordered: Simple to little complex) Question 1 One of the fields on a form contains a text box which accepts numeric values in the range of 18 to 25. Identify the invalid Equivalence class. a) 17 b) 19 c) 24 d) 21 Solution The text box accepts numeric values in the range 18 to 25 (18 and 25 are also part of the class). So this class becomes our valid class. But the question is to identify invalid equivalence class. The classes will be as follows: Class I: values < 18 => invalid class Class II: 18 to 25 => valid class Class III: values > 25 => invalid class 17 fall under invalid class. 19, 24 and 21 fall under valid class. So answer is A Question 2 In an Examination a candidate has to score minimum of 24 marks in order to clear the exam. The maximum that he can score is 40 marks. Identify the Valid Equivalence values if the student clears the exam.

a) 22, 23, 26 b) 21,39,40 c) 29,30,31 d) 0,15,22 Solution The classes will be as follows: Class I: values < 24 => invalid class Class II: 24 to 40 => valid class Class III: values > 40 => invalid class We have to indentify Valid Equivalence values. Valid Equivalence values will be there in Valid Equivalence class. All the values should be in Class II. So answer is C Question 3 One of the fields on a form contains a text box which accepts alpha numeric values. Identify the Valid Equivalence class a) BOOK b) Book c) Boo01k d) Book Solution Alpha numeric is combination of alphabets and numbers. Hence we have to choose an option which has both of these. A valid equivalence class will consist of both alphabets and numbers. Option c contains both alphabets and numbers. So answer is C Question 4 The Switch is switched off once the temperature falls below 18 and then it is turned on when the temperature is more than 21. When the temperature is more than 21. Identify the Equivalence values which belong to the same class. a) 12, 16, 22 b) 24,27,17 c) 22,23,24 d) 14,15,19 Solution We have to choose values from same class (it can be valid or invalid class). The classes will be as follows: Class I: less than 18 (switch turned off) Class II: 18 to 21 Class III: above 21 (switch turned on)

Only in Option c all values are from one class. Hence the answer is C. (Please note that the question does not talk about valid or invalid classes. It is only about values in same class) Question 5 A program validates a numeric field as follows: values less than 10 are rejected, values between 10 and 21 are accepted, values greater than or equal to 22 are rejected. Which of the following input values cover all of the equivalence partitions? a. 10,11, 21 b. 3, 20, 21 c. 3,10,22 d. 10,21,22 Solution We have to select values which fall in all the equivalence class (valid and invalid both). The classes will be as follows: Class I: values <= 9 => invalid class Class II: 10 to 21 => valid class Class III: values >= 22 => invalid class All the values from option c fall under all different equivalence class. So answer is C. Question 6 A program validates a numeric field as follows: values less than 10 are rejected, values between 10 and 21 are accepted, values greater than or equal to 22 are rejected. Which of the following covers the MOST boundary values? a. 9,10,11,22 b. 9,10,21,22 c. 10,11,21,22 d. 10,11,20,21 Solution We have already come up with the classes as shown in question 5. The boundaries can be identified as 9, 10, 21, and 22. These four values are in option b. So answer is B Question 7 In a system designed to work out the tax to be paid: An employee has 4000 of salary tax free. The next 1500 is taxed at 10%. The next 28000 after that is taxed at 22%. Any further amount is taxed at 40%. To the nearest whole pound, which of these groups of numbers fall into three DIFFERENT equivalence classes?

a) 4000; 5000; 5500 b) 32001; 34000; 36500 c) 28000; 28001; 32001 d) 4000; 4200; 5600 Solution The classes will be as follows: Class I : 0 to 4000 => no tax Class II : 4001 to 5500 => 10 % tax Class III : 5501 to 33500 => 22 % tax Class IV : 33501 and above => 40 % tax Select the values which fall in three different equivalence classes. Option d has values from three different equivalence classes. So answer is D. Question 8 In a system designed to work out the tax to be paid: An employee has 4000 of salary tax free. The next 1500 is taxed at 10%. The next 28000 after that is taxed at 22%. Any further amount is taxed at 40%. To the nearest whole pound, which of these is a valid Boundary Value Analysis test case? a) 28000 b) 33501 c) 32001 d) 1500 Solution The classes are already divided in question # 7. We have to select a value which is a boundary value (start/end value). 33501 is a boundary value. So answer is C. Question 9 Given the following specification, which of the following values for age are in the SAME equivalence partition? If you are less than 18, you are too young to be insured. Between 18 and 30 inclusive, you will receive a 20% discount. Anyone over 30 is not eligible for a discount. a) 17, 18, 19 b) 29, 30, 31 c) 18, 29, 30 d) 17, 29, 31 Solution The classes will be as follows:

Class I: age < 18 => not insured Class II: age 18 to 30 => 20 % discount Class III: age > 30 => no discount Here we cannot determine if the above classes are valid or invalid, as nothing is mentioned in the question. (But according to our guess we can say I and II are valid and III is invalid. But this is not required here.) We have to select values which are in SAME equivalence partition. Values from option c fall in same partition. So answer is C.

The basic difference between a web server and an application server is Webserver can execute only web applications i,e servlets and JSPs and has only a single container known as Web container which is used to interpret/execute web applications Application server can execute Enterprise application, i,e (servlets, jsps, and EJBs) it is having two containers 1. Web Container (for interpreting/executing servlets and jsps) 2. EJB container (for executing EJBs). it can perform operations like load balancing , transaction demarcation etc etc

Application Server Functionality: Adds functionality Application server is used to serve web based applications and enterprise based applications (i.e. sevlets, jsps and ejbs...). Because application server contains web server internally. Sun Java Application server, web logic server, Apache Geronimo GUIs, Web Servers

Web Server Does not add any

Hide All hide

Job:

web server is used to serve web based applications.(i.e. servlets and hide jsps)

Examples of popular server products: Clients can include-: What is it?:

Apache, Microsoft IIS HTTP, HTML

hide hide

Functions:

A server that exposes business A server that handles HTTP hide logic to client applications through protocol. various protocols including HTTP. Keeping HTML, PHP, ASP etc To deliver various applications to files available for the web browsers another device, it allows everyone to view when a user accesses the hide in the network to run software off site on the web, handles HTTP of the same machine. requests from clients.

A Web server can be either a computer program or a computer running a program that is responsible for accepting HTTP requests from clients, serving back HTTP responses along with optional data contents, which usually are web pages such as HTML documents and linked objects on it. An application server is the kind of software engine that will deliver various applications to another device. It is the kind of computer found in an office or university network that allows everyone in the network to run software off of the same machine. A web server and an application server may differ on the following points:

Contents
[hide]
y y y y y y

1 Function 2 Multi Threading 3 Load Limit 4 Model 5 History 6 References

[edit] Function
The main function of a web server is keeping files active for web site browsing, twenty-four hours a day, seven days a week. Any time lost is known as down time which means that at that point, the website and its pages will not be viewable. Any good web hosting company tries to keep their downtime to less than a fraction of a second to be successful. An Application server facilitates this process and tries to make for easy data access of an application.

[edit] Multi Threading


The Web Server does not support the concept of multi-threading. In Application Server we have features like connection pulling, isolation pulling, multi-threading, and majorly the Transaction feature which is not there in Web Server. Web servers (programs) are supposed to serve requests quickly from more than one TCP/IP connection at a time.Consider that Internet Explorer or Firefox Web Browser is a local program on the user's hard drive, whereas the web pages themselves are not. The web pages are actually stored on the hard drives of other computers, and these are known as web servers. Application server products typically bundle middleware to enable applications to intercommunicate with dependent applications, like Web servers, database management systems, and chart programs.

[edit] Load Limit

A web server (program) has defined load limits, because it can handle only a limited number of concurrent client connections (usually between 2 and 60,000, by default between 500 and 1,000) per IP address (and IP port) and it can serve only a certain maximum number of requests per second. On the other hand, an application server has a much higher capacity.

[edit] Model
Webserver delegation model is fairly simple, when the request comes into the web server; it simply passes the request to the program best able to handle it (Server side program). It may not support transactions and database connection pooling. Web servers support to deploy .war files only while Application servers support to deploy .war and .ear files. Application server is more capable of dynamic behavior than web server. An application server can be configured to work as a web server.

[edit] History
The first web server owes its origin to Tim Berners-Lee when as part of a new project to his employer CERN (European Organization for Nuclear Research). In 1989 he wrote two programs which led to the implementation of the first web server. The Application server first came up in the 1990's. It can be said that a Web server is a subset of an application server. Application servers and web servers are beginning to blur into each other with the expansion of the Internet and Web 2.0 technologies. In most instances currently, software is hosted on web servers, and then downloaded to the local hard drive, where it is installed on the local computer. In the new model that fuses the web server and application server, the software would be hosted online and the user could access it and use it as needed, generally, at a lower rate than if he or she were to purchase the software new.

Read more: Application Server vs Web Server - Difference and Comparison | Diffen http://www.diffen.com/difference/Application_Server_vs_Web_Server#ixzz1cBRS3nOS

You might also like