Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Equivalence partition for string #195

Open
andyylam opened this issue Nov 28, 2019 · 3 comments
Open

Equivalence partition for string #195

andyylam opened this issue Nov 28, 2019 · 3 comments

Comments

@andyylam
Copy link

image

I have a question regarding the equivalence partition of text in the above question. Currently, I have the following:

  1. Length longer than n
  2. Length shorter or equal to n
  3. Null
  4. Empty string

Firstly, is an empty string a partition, since it also falls under option 2?
Secondly, are there any other partitions that should be considered?

@damithc
Copy link
Collaborator

damithc commented Nov 28, 2019

The method is not supposed to behave differently based on the string contents. Therefore, it is not necessary to consider empty string as a separate partition. But when choosing values to test, one can include a string with leading/trailing spaces to catch a bug caused by an unwanted trim() method in the code.
The other three partitions seem good enough.

@andyylam
Copy link
Author

Thanks Prof! On a similar note, how much should we use boundary values in testing? For instance, if n (int) has valid values in range [0,10] and we are asked to create test cases in an effective and efficient manner, what values should be considered?

@damithc
Copy link
Collaborator

damithc commented Nov 28, 2019

Depends on how many test cases we can afford. Then, start with the boundaries (e.g., 0, 10), and then add non-boundary values (e.g., 4) if there is room.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants