90 likes | 199 Views
Testing. Testing Problems. Not Just for Testers ! Although testers are obviously asked more testing problems, developers will often be asked testing problems as well . Why ? Because a good developer knows how to test their code!. Types of Testing Problems.
E N D
Testing Problems • Not Just for Testers! • Although testers are obviously asked more testing problems, developers will often be asked testing problems as well. • Why? • Because a good developer knows how to test their code!
Types of Testing Problems • Explain how you would test this real world object (pen, paperclip, etc). • Explain how you would test this computer software (e.g., a web browser). • Write test cases / test code to test this specific method. • We’ll discuss type #1, since it’s usually the most daunting.
How to Test A Real World Object • Let’s imagine that you were asked to test a paperclip. • The first thing to understand is: what is it expected to be used for and who are the expected users. • Ask your interviewer—the answer may not be what you think! • The answer could be “by teachers, to hold papers together” or it could be “by artists, to bend into new shapes.” • These two use-cases will have very different answers.
How to Test A Real World Object • Once you understand the intended use, think about: • What are the specific use cases for the intended purpose? • holding 2 sheets of paper together, and up to 30 sheets. • If it fails, does it fail gracefully? • What does it mean for it to fail? • Answer: “Failing gracefully“ means for the paperclip to not hold paper together. • If it snaps easily, that’s (probably) not failing gracefully. • What are the expectations of it being used outside of the intended use case? • Should we ensure that it has a minimum of usefulness for the other cases? • What “stress” conditions might your paperclip be used in? • Answer: hot weather, cold weather, frequent re-use, etc.
How would you test a pen? • This problem is largely about understand the constraints: what exactly is the pen? You should ask a lot of questions to understand what exactly you are trying to test. • To illustrate the technique in this problem, let us guide you through a mock-conversation.
Solution • Interviewer: How would you test a pen? • Candidate: Let me find out a bit about the pen. Who is going to use the pen? • Interviewer: Probably children. • Candidate: Ok, that’s interesting. What will they be doing with it? Will they be writing, drawing, or doing something else with it? • Interviewer: Drawing. • Candidate: Ok, great. On what? Paper? Clothing? Walls? • Interviewer: On clothing. • Candidate: Great. What kind of tip does the pen have? Felt? Ball point? Is it intended to wash off, or is it intended to be permanent? • Interviewer: It’s intended to wash off. • ….many questions later ... • Candidate: Ok, so as I understand it, we have a pen that is being targeted at 5—10 year olds. The pen has a felt tip and comes in red, green, blue and black. It’s intended to wash off clothing.I s that correct?
solution • The candidate now has a problem that is significantly different from what it initially seemed to be.Thus, the candidate might now want to test: • Does the pen wash off with warm water, cold water, and luke warm water? • Does the pen wash off after staying on the clothing for several weeks? What happens if you wash the clothing while the pen is still wet? • Is the pen safe (e.g.—non-toxic) for children? • and so on...
Problem • How would you test an ATM in a distributed banking system?