Monday, 6 February 2012

What is Software Testing...?








Software testing is more than just error detection;



Testing software is operating the software under controlled conditions, to (1) verify that it behaves “as specified”; (2) to detecterrors, and (3) to validate that what has been specified is what the user actually wanted.



1.   Verification is the checking or testing of items, including software, for conformance and consistency by evaluating the results against pre-specified requirements. [Verification: Are we building the system right?]



2.   Error Detection: Testing should intentionally attempt to make things go wrong to determine if things happen when they shouldn’t or things don’t happen when they should.



3.   Validation looks at the system correctness – i.e. is the process of checking that what has been specified is what the user actually wanted. [Validation: Are we building the right system?]



In other words, validation checks to see if we are building what the customer wants/needs, and verification checks to see if we are building that system correctly.Both verification and validation are necessary, but different components of any testing activity.



The definition of testing according to the ANSI/IEEE 1059 standard is that testing is the process of analysing a software item to detect the differences between existing and required conditions (that is defects/errors/bugs) and to evaluate the features of the software item.



Remember: The purpose of testing is verification, validation and error detection in order to find problems – and the purpose of finding those problems is to get them fixed.








Testing in itself cannot ensure the quality of software. All testing can do is give you a certain level of assurance (confidence) in the software. On its own, the only thing that testing proves is that under specific controlled conditions, the software functioned as expected by the test cases executed.






Quality software is reasonably bug-free, delivered on time and within budget, meets requirements and/or expectations, and is maintainable.



However, quality is a subjective term. It will depend on who the ‘customer’ is and their overall influence in the scheme of things. A wide-angle view of the ‘customers’ of a software development project might include end-users, customer acceptance testers, customer contract officers, customer management, the development organisation’s management/accountants/testers/salespeople, future software maintenance engineers, stockholders, magazine reviewers, etc. Each type of ‘customer’ will have their own view on ‘quality’ - the accounting department might define quality in terms of profits while an end-user might define quality as user-friendly and bug-free.










“Quality Assurance” measures the quality of processes used to create a quality product.



Software Quality Assurance (‘SQA’ or ‘QA’) is the process of monitoring and improving all activities associated with software development, from requirements gathering, design and reviews to coding, testing and implementation.



It involves the entire software development process - monitoring and improving the process, making sure that any agreed-upon standards and procedures are followed, and ensuring that problems are found and dealt with, at the earliest possible stage. Unlike testing, which is mainly a ‘detection’ process, QA is ‘preventative’ in that it aims to ensure quality in the methods & processes – and therefore reduce the prevalence of errors in the software.



Organisations vary considerably in how they assign responsibility for QA and testing. Sometimes they’re the combined responsibility of one group or individual. Also common are project teams that include a mix of testers and developers who work closely together, with overall QA processes monitored by project managers or quality managers.








Quality Assurance and development of a product are parallel activities. Complete QA includes reviews of the development methods and standards, reviews of all the documentation (not just for standardisation but for verification and clarity of the contents also). Overall Quality Assurance processes also include code validation.



A note about quality assurance: The role of quality assurance is a superset of testing. Its mission is to help minimise the risk of project failure. QA people aim to understand the causes of project failure (which includes software errors as an aspect) and help the team prevent, detect, and correct the problems. Often test teams are referred to as QA Teams, perhaps acknowledging that testers should consider broader QA issues as well as testing.








Simply put:



§ TESTING means “Quality Control”; and

§ QUALITY CONTROL measures the quality of a product; while

§ QUALITY ASSURANCE measures the quality of processes used to create a quality product.










In well-run projects, the mission of the test team is not merely to perform testing, but to help minimise the risk of product failure. Testers look for manifest problems in the product, potential problems, and the absence of problems. They explore, assess, track, and report product quality, so that others in the project can make informed decisions about product development. It's important to recognise that testers are not out to "break the code." We are not out to embarrass or complain, just to inform. We are human meters of product quality.


ISTQB Sample papers!!

1.Software testing activities should start

a. as soon as the code is written
b. during the design stage
c. when the requirements have been formally documented
d. as soon as possible in the development life cycle

2.Faults found by users are due to:

a. Poor quality software
b. Poor software and poor testing
c. bad luck
d. insufficient time for testing

3.What is the main reason for testing software before releasing it?

a. to show that system will work after release
b. to decide when the software is of sufficient quality to release
c. to find as many bugs as possible before release
d. to give information for a risk based decision about release

4. which of the following statements is not true

a. performance testing can be done during unit testing as well as during the testing of whole system
b. The acceptance test does not necessarily include a regression test
c. Verification activities should not involve testers (reviews, inspections etc)
d. Test environments should be as similar to production environments as possible

5. When reporting faults found to developers, testers should be:

a. as polite, constructive and helpful as possible
b. firm about insisting that a bug is not a “feature” if it should be fixed
c. diplomatic, sensitive to the way they may react to criticism
d. All of the above

6.In which order should tests be run?

a. the most important tests first
b. the most difficult tests first(to allow maximum time for fixing)
c. the easiest tests first(to give initial confidence)
d. the order they are thought of

7. The later in the development life cycle a fault is discovered, the more expensive it is to fix. why?

a. the documentation is poor, so it takes longer to find out what the software is doing.
b. wages are rising
c. the fault has been built into more documentation,code,tests, etc
d. none of the above

8. Which is not true-The black box tester

a. should be able to understand a functional specification or requirements document
b. should be able to understand the source code.
c. is highly motivated to find faults
d. is creative to find the system’s weaknesses

9. A test design technique is

a. a process for selecting test cases
b. a process for determining expected outputs
c. a way to measure the quality of software
d. a way to measure in a test plan what has to be done

10. Testware(test cases, test dataset)

a. needs configuration management just like requirements, design and code
b. should be newly constructed for each new version of the software
c. is needed only until the software is released into production or use
d. does not need to be documented and commented, as it does not form part of the released
software system

11. An incident logging system

a only records defects
b is of limited value
c is a valuable source of project information during testing if it contains all incidents
d. should be used only by the test team.

12. Increasing the quality of the software, by better development methods, will affect the time needed for testing (the test phases) by:

a. reducing test time
b. no change
c. increasing test time
d. can’t say

13. Coverage measurement

a. is nothing to do with testing
b. is a partial measure of test thoroughness
c. branch coverage should be mandatory for all software
d. can only be applied at unit or module testing, not at system testing

14. When should you stop testing?

a. when time for testing has run out.
b. when all planned tests have been run
c. when the test completion criteria have been met
d. when no faults have been found by the tests run


15. Which of the following is true?

a. Component testing should be black box, system testing should be white box.
b. if u find a lot of bugs in testing, you should not be very confident about the quality of software
c. the fewer bugs you find,the better your testing was
d. the more tests you run, the more bugs you will find.

16. What is the important criterion in deciding what testing technique to use?

a. how well you know a particular technique
b. the objective of the test
c. how appropriate the technique is for testing the application
d. whether there is a tool to support the technique

17. If the pseudocode below were a programming language ,how many tests are required to achieve 100% statement coverage?

1. If x=3 then
2. Display_messageX;
3. If y=2 then
4. Display_messageY;
5. Else
6. Display_messageZ;
7. Else
8. Display_messageZ;

a. 1
b. 2
c. 3
d. 4



18. Using the same code example as question 17,how many tests are required to achieve 100% branch/decision coverage?

a. 1
b. 2
c. 3
d. 4

19 Which of the following is NOT a type of non-functional test?

a. State-Transition
b. Usability
c. Performance
d. Security

20. Which of the following tools would you use to detect a memory leak?

a. State analysis
b. Coverage analysis
c. Dynamic analysis
d. Memory analysis

21. Which of the following is NOT a standard related to testing?

a. IEEE829
b. IEEE610
c. BS7925-1
d. BS7925-2




22.which of the following is the component test standard?


a. IEEE 829
b. IEEE 610
c. BS7925-1
d. BS7925-2

23 which of the following statements are true?

a. Faults in program specifications are the most expensive to fix.
b. Faults in code are the most expensive to fix.
c. Faults in requirements are the most expensive to fix
d. Faults in designs are the most expensive to fix.

24. Which of the following is not the integration strategy?

a. Design based
b. Big-bang
c. Bottom-up
d. Top-down

25. Which of the following is a black box design technique?

a. statement testing
b. equivalence partitioning
c. error- guessing
d. usability testing

26. A program with high cyclometic complexity is almost likely to be:

a. Large
b. Small
c. Difficult to write
d. Difficult to test

27. Which of the following is a static test?

a. code inspection
b. coverage analysis
c. usability assessment
d. installation test

28. Which of the following is the odd one out?

a. white box
b. glass box
c. structural
d. functional

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


30. Using the same specifications as question 29, 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

1.d
2.b
3.d
4.c
5.d
6.a
7.c
8.b
9.a
10.a
11.c
12.a
13.b
14.c
15.b
16.b
17.c
18.c
19.a
20.c
21.b
22.d
23.c
24.a
25.b
26.d
27.a
28.d
29.c
30.b
 
Today's topic--what is ISTQB???

International Software testing Qualifications Board!!!

Its an Exam taken up by the Software tester to get themselves certified from this Board which is recongonised worldwide.....

http://istqb.org/display/ISTQB/Home

Guys, if you're persuing your career in software testing. It makes sense to get certified in this exam...Trust me u will have lots of benefits..

ISTQB- papers!!!!


ISTQB ‘Foundation level’ sample questions with answers and detailed evaluation of each option:

1. Methodologies adopted while performing Maintenance Testing:-
a) Breadth Test and Depth Test
b) Retesting
c) Confirmation Testing
d) Sanity Testing

Evaluating the options:
a) Option a: Breadth testing is a test suite that exercises the full functionality of a product but does not test features in detail. Depth testing is a test that exercises a feature of a product in full detail.
b) Option b: Retesting is part of regression
c) Option c: Confirmation testing is a synonym for retesting
d) Option d: Sanity testing does not include full functionality
Maintenance testing includes testing some features in detail (for e.g. environment) and for some features detail testing is not required. It’s a mix of both breadth and depth testing.

So, the answer is ‘A’

2. Which of the following is true about Formal Review or Inspection:-
i. Led by Trained Moderator (not the author).
ii. No Pre Meeting Preparations
iii. Formal Follow up process.
iv. Main Objective is to find defects

a) ii is true and i,iii,iv are false
b) i,iii,iv are true and ii is false
c) i,iii,iv are false and ii is true
d) iii is true and i,ii,iv are false

Evaluating the options:
Consider the first point (i). This is true, Inspection is led by trained moderator. Hence we can eliminate options (a) and (d). Now consider second point. In Inspection pre-meeting preparation is required. So this point is false. Look for option where (i) is true and (ii) is false.

The answer is ‘B’

3. The Phases of formal review process is mentioned below arrange them in the correct order.

i. Planning
ii. Review Meeting
iii. Rework
iv. Individual Preparations
v. Kick Off
vi. Follow Up

a) i,ii,iii,iv,v,vi
b) vi,i,ii,iii,iv,v
c) i,v,iv,ii,iii,vi
d) i,ii,iii,v,iv,vi

Evaluating the options:
Formal review process is ’Inspection’. Planning is foremost step. Hence we can eliminate option ’b’. Now we need to kickoff the process, so the second step will be Kick off. That’s it we found the answer. Its ’C’

The answer is ’C’

4. Consider the following state transition diagram of a two-speed hair dryer, which is operated by pressing its one button. The first press of the button turns it on to Speed 1, second press to Speed 2 and the third press turns it off.


Which of the following series of state transitions below will provide 0-switch coverage?
a. A,C,B
b. B,C,A
c. A,B,C
d. C,B,A

Evaluating the options:
In State transition testing a test is defined for each state transition. The coverage that is achieved by this testing is called 0-switch or branch coverage. 0-switch coverage is to execute each loop once (No repetition. We should start with initial state and go till end state. It does not test ‘sequence of two state transitions’). In this case the start state is ‘OFF’, and then press of the button turns it on to Speed 1 (i.e. A). Second press turns it on to Speed 2 (i.e. B) and the third press turns it off (i.e. C). Here we do not test the combinations like what if the start state is ‘Speed 1’ or ‘Speed 2’ etc.

An alternate way of solving this is check for the options where it starts with ‘OFF’ state. So we have options ‘a’ and ‘c’ to select from. As per the state diagram from ‘OFF’ state the dryer goes to ‘Speed 1’ and then to ‘Speed 2’. So our answer should start with ‘A’ and end with ‘C’.

The answer is ’C’

5. White Box Techniques are also called as :-
a) Structural Testing
b) Design Based Testing
c) Error Guessing Technique
d) Experience Based Technique

Evaluating the options:
I guess no evaluation is required here. It’s a straight answer. White box techniques are also called as Structural testing. (as it is done using code)

The answer is ‘A’

6. What is an equivalence partition (also known as an equivalence class)?
a) A set of test cases for testing classes of objects
b) An input or output range of values such that only one value in the range becomes a test case
c) An input or output range of values such that each value in the range becomes a test case
d) An input or output range of values such that every tenth value in the range becomes a test case.

Evaluating the options:
Let’s recall the definition of equivalence partition. It is grouping inputs into valid and invalid classes. Hence any one value from one particular class forms an input. For e.g. input a valid class contains values from 3-5, then any value between 3-5 is considered as an input. All values are supposed to yield same output. Hence one value in this range becomes a test case.

The answer is ‘B’

7. The Test Cases Derived from use cases
a) Are most useful in uncovering defects in the process flows during real world use of the system
b) Are most useful in uncovering defects in the process flows during the testing use of the system
c) Are most useful in covering the defects in the process flows during real world use of the system
d) Are most useful in covering the defects at the Integration Level

Evaluating the options:
Please refer to Use case related topic in the foundation level guide “Use cases describe the “process flows” through a system based on its actual likely use” (actual likely use is nothing but the real world use of the system). Use cases are useful for uncovering defects. Hence we can eliminate options (c ) and (d). Use case uncovers defects in process flow during real world use of the system.

The answer is ‘A’

8. Exhaustive Testing is
a) Is impractical but possible
b) Is practically possible
c) Is impractical and impossible
d) Is always possible

Evaluating the options:
From the definition given in the syllabus, Exhaustive testing is impossible. But it is possible in trivial cases. Exhaustive testing is not always possible. So eliminate option ‘d’. It is not impossible also. So eliminate option ‘c’. But implementing is impractical. Hence we can conclude that exhaustive testing is impractical but possible

The answer is ‘A’

9. Which of the following is not a part of the Test Implementation and Execution Phase
a) Creating test suites from the test cases
b) Executing test cases either manually or by using test execution tools
c) Comparing actual results
d) Designing the Tests

Evaluating the options:
Please take care of the word ‘not’ in the question. Test implementation does include Creating test suites, executing and comparing results. Hence eliminate options a, b and c. The only option left is ‘D’. Designing activities come before implementation.

The answer is ‘D’

10. Which of the following techniques is NOT a White box technique?
a) Statement Testing and coverage
b) Decision Testing and coverage
c) Condition Coverage
d) Boundary value analysis

Evaluating the options:
Please take care of the word ‘not’ in the question. We have to choose the one which is not a part of white box technique. Statement, decision, condition are the terms used in white box. So eliminate options a, b and c. Boundary value is part of black box.

The answer is ‘D’

11. A Project risk includes which of the following
a) Organizational Factors
b) Poor Software characteristics
c) Error Prone software delivered.
d) Software that does not perform its intended functions

Evaluating the options:
a) Option a: Organizational factors can be part of project risk.
b) Option b: Poor software characteristics are part of software. Its not a risk
c) Option c: Error prone software delivered. Again it’s a part of software.
d) Option d: Software that does not perform its intended functions. Again it’s a part of software.

The answer is ‘A’

12. In a risk-based approach the risks identified may be used to :
i. Determine the test technique to be employed
ii. Determine the extent of testing to be carried out
iii. Prioritize testing in an attempt to find critical defects as early as possible.
iv. Determine the cost of the project

a) ii is True; i, iii, iv & v are False
b) i,ii,iii are true and iv is false
c) ii & iii are True; i, iv are False
d) ii, iii & iv are True; i is false

Evaluating the options:
a) Option a: Risks identified can be used to determine the test technique.
b) Option b: Risks can be used to determine the extent of testing required. For e.g. if there are P1 bugs in a software, then it is a risk to release it. Hence we can increase the testing cycle to reduce the risk
c) Option c: If risk areas are identified before hand, then we can prioritize testing to find defects asap.
d) Option d: Risk does not determine the cost of the project. It determines the impact on the project as a whole.
Check for the option where first 3 points are true. Its ‘B’

The answer is ‘B’

13. Which of the following is the task of a Tester?
i. Interaction with the Test Tool Vendor to identify best ways to leverage test tool on the project.
ii. Prepare and acquire Test Data
iii. Implement Tests on all test levels, execute and log the tests.
iv. Create the Test Specifications

a) i, ii, iii is true and iv is false
b) ii,iii,iv is true and i is false
c) i is true and ii,iii,iv are false
d) iii and iv is correct and i and ii are incorrect

Evaluating the options:
Not much explanation is needed in this case. As a tester, we do all the activities mentioned in options (ii), (iii) and (iv).

The answer is ‘B’

14. The Planning phase of a formal review includes the following :-
a) Explaining the objectives
b) Selecting the personnel, allocating roles.
c) Follow up
d) Individual Meeting preparations

Evaluating the options:
In this case, elimination will work best. Follow-up is not a planning activity. It’s a post task. Hence eliminate option ‘b’. Individual meeting preparation is an activity for individual. It’s not a planning activity. Hence eliminate option ‘d’. Now we are left with 2 options ‘a’ and ‘b’, read those 2-3 times. We can identify that option ‘b’ is most appropriate. Planning phase of formal review does include selecting personnel and allocation of roles. Explaining the objectives is not part of review process. (this is also written in the FL syllabus)

The answer is ‘B’

15. A Person who documents all the issues, problems and open points that were identified during a formal review.
a) Moderator.
b) Scribe
c) Author
d) Manager

Evaluating the options:
I hope there is not confusion here. The answer is scribe.

The answer is ‘B’

16. Who are the persons involved in a Formal Review :-
i. Manager
ii. Moderator
iii. Scribe / Recorder
iv. Assistant Manager

a) i,ii,iii,iv are true
b) i,ii,iii are true and iv is false.
c) ii,iii,iv are true and i is false.
d) i,iv are true and ii, iii are false.

Evaluating the options:
The question is regarding formal review, means Inspection. First we will try to identify the persons that we are familiar w.r.t Inspection. Manager, Moderator and Scribe are involved in Inspection. So now we have only first 2 options to select from. (other 2 options are eliminated). There is no assistant manager in Inspection.

The answer is ‘B’

17. Which of the following is a Key Characteristics of Walk Through
a) Scenario , Dry Run , Peer Group
b) Pre Meeting Preparations
c) Formal Follow Up Process
d) Includes Metrics

Evaluating the options:
Pre meeting preparation is part of Inspection. Also Walk through is not a formal process. Metrics are part of Inspection. Hence eliminating ‘b’, ‘c’ and ‘d’.

The answer is ‘A’

18. What can static analysis NOT find?
a) the use of a variable before it has been defined
b) unreachable (“dead”) code
c) memory leaks
d) array bound violations

Evaluating the options:
Static analysis cover all the above options except ‘Memory leaks’. (Please refer to the FL syllabus. Its written clearly over there)

The answer is ‘C’

19. Incidents would not be raised against:
a) requirements
b) documentation
c) test cases
d) improvements suggested by users

Evaluating the options:
The first three options are obvious options for which incidents are raised. The last option can be thought as an enhancement. It is a suggestion from the users and not an incident.

The answer is ‘D’

20. A Type of functional Testing, which investigates the functions relating to detection of threats, such as virus from malicious outsiders.
a) Security Testing
b) Recovery Testing
c) Performance Testing
d) Functionality Testing

Evaluating the options:
The terms used in the question like detection of threats, virus etc point towards the security issues. Also security testing is a part of Functional testing. In security testing we investigate the threats from malicious outsiders etc.

The answer is ‘A’

21. Which of the following is not a major task of Exit criteria?
a) Checking test logs against the exit criteria specified in test planning.
b) Logging the outcome of test execution.
c) Assessing if more tests are needed.
d) Writing a test summary report for stakeholders.

Evaluating the options:
The question is about ‘not’ a major task. Option ‘a’ is a major task. So eliminate this. Option ‘b’ is not a major task. (But yes, logging of outcome is important). Option ‘c’ and ‘d’ both are major tasks of Exit criteria. So eliminate these two.

The answer is ‘B’

22. Testing where in we subject the target of the test , to varying workloads to measure and evaluate the performance behaviors and ability of the target and of the test to continue to function properly under these different workloads.
a) Load Testing
b) Integration Testing
c) System Testing
d) Usability Testing

Evaluating the options:
Workloads, performance are terms that come under Load testing. Also as can be seen from the other options, they are not related to load testing. So we can eliminate them.

The answer is ‘A’

23. Testing activity which is performed to expose defects in the interfaces and in the interaction between integrated components is :-
a) System Level Testing
b) Integration Level Testing
c) Unit Level Testing
d) Component Testing

Evaluating the options:
We have to identify the testing activity which finds defects which occur due to interaction or integration. Option ‘a’ is not related to integration. Option ‘c’ is unit testing. Option ‘d’ component is again a synonym for unit testing. Hence eliminating these three options.

The answer is ‘B’

24. Static analysis is best described as:
a) The analysis of batch programs.
b) The reviewing of test plans.
c) The analysis of program code.
d) The use of black box testing.

Evaluating the options:
In this case we have to choose an option, which ‘best’ describes static analysis. Most of the options given here are very close to each other. We have to carefully read them.
a) Option a: Analysis is part of static analysis. But is not the best option which describes static analysis.
b) Option b: Reviews are part of static analysis. But is not the best option which describes static analysis.
c) Option c: Static analysis does analyze program code.
d) Option d: This option ca be ruled out, as black box is a dynamic testing.

The answer is ‘C’

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

Evaluating the options:
As we know, alpha numeric is combination of alphabets and numbers. Hence we have to choose an option which has both of these.
a. Option a: contains only alphabets. (to create confusion they are given in capitals)
b. Option b: contains only alphabets. (the only difference from above option is that all letters are not in capitals)
c. Option c: contains both alphabets and numbers
d. Option d: contains only alphabets but in lower case

The answer is ‘C’

26. Reviewing the test Basis is a part of which phase
a) Test Analysis and Design
b) Test Implementation and execution
c) Test Closure Activities
d) Evaluating exit criteria and reporting

Evaluating the options:
Test basis comprise of requirements, architecture, design, interfaces. By looking at these words, we can straight away eliminate last two options. Now option ‘a’ is about test analysis and design. This comes under test basis. Option ‘b’ is about implementation and execution which come after the design process. So the best option is ‘a’.

The answer is ‘A’

27. Reporting Discrepancies as incidents is a part of which phase :-
a) Test Analysis and Design
b) Test Implementation and execution
c) Test Closure Activities
d) Evaluating exit criteria and reporting

Evaluating the options:
Incident is reporting discrepancies, in other terms its defect/bug. We find defects while execution cycle where we execute the test cases.

The answer is ‘B’

28. Which of the following items would not come under Configuration Management?
a) operating systems
b) test documentation
c) live data
d) user requirement document

Evaluating the options:
We have to choose an option which does ‘not’ come under Configuration Management (CM). CM is about maintaining the integrity of the products like components, data and documentation.
a) Option a: maintaining the Operating system configuration that has been used in the test cycle is part of CM.
b) Option b: Test documentation is part of CM
c) Option c: Data is part of CM. but here the option is ‘live data’ which is not part of CM. The live data keeps on changing (in real scenario).
d) Option d: Requirements and documents are again part of CM
The only option that does not fall under CM is ‘c’

The answer is ‘C’

29. Handover of Test-ware is a part of which Phase
a) Test Analysis and Design
b) Test Planning and control
c) Test Closure Activities
d) Evaluating exit criteria and reporting

Evaluating the options:
Hand over is typically a process which is part of closure activities. It is not part of analysis, design or planning activity. Also it is not part of evaluating exit criteria. After closure of test cycle test-ware is handover to the maintenance organization.

The answer is ‘C’

30. The Switch is switched off once the temperature falls below 18 and then it is turned on 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

Evaluating the options:
Read the question carefully. We have to choose values from same class. So first divide the classes. When temperature falls below 18 switch is turned off. This forms a class (as shown below). When the temperature is more than 21, the switch is turned on. For values between 18 to 21, no action is taken. This also forms a class as shown below.

Class I: less than 18 (switch turned off)
Class II: 18 to 21
Class III: above 21 (switch turned on)

From the given options select the option which has values from only one particular class. Option ‘a’ values are not in one class, so eliminate. Option ‘b’ values are not in one class, so eliminate. Option ‘c’ values are in one class. Option ‘d’ values are not in one class, so eliminate. (please note that the question does not talk about valid or invalid classes. It is only about values in same class)