General - Coding Bootcamp Flashcards

1
Q

What test cases should you take into account for testing a function?

A
  • The normal case: Does it generate the correct output for typical inputs? Remember to think about potential issues here. For example, because sorting often requires some sort of partitioning, it’s reasonable to think that the algorithm might fail on arrays with an odd number of elements, since they can’t be evenly partitioned. Your test case should list both examples.
  • The extremes: What happens when you pass in an empty array? Or a very small (one element) array? What if you pass in a very large one?
  • Nulls and “illegal” input: It is worthwhile to think about how the code should behave when given illegal input. For example, if you’re testing a function to generate the nth Fibonacci number, your test cases should probably include t�e situation where n is negative.
  • Strange input: A fourth kind of input sometimes comes up: strange input. What happens when you pass in an already sorted array? Or an array that’s sorted in reverse order?
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

For testing a general object or software, what do we need to find out?

A
  1. Who uses it?
  2. Use cases
  3. Bounds of use (in which it’s expected to work well)
  4. What should failure look like
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How many characters in ASCII? How many bits to represent them?

A

ASCII is a 7-bit character set containing 128 characters.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What does load testing involve?

A

Response time: Throughput Resource utilization Maximum load that the system can bear

How well did you know this?
1
Not at all
2
3
4
5
Perfectly