# Boundary Value Analysis and Equivalence Partitions for electricity counter

• I have task to build equivalence classes, and boundary values based on given information

To calculate the electricity cost user should enter an old and a new values of electricity counter and press “Calc” button. It works only if values are entered correctly:

• contain only digits;
• no longer than 6 digits;
• new value is not less than an old one;

I did this task, but i don't know if i did it right It would be great to get feedback • What you've done is not precisely wrong, but it could be better.

I'd express the data this way:

Valid: 0 >= OldNumber >= NewNumber > 999999

• OldNumber minimum value = 0
• NewNumber minimum = 0
• OldNumber max = 999999
• NewNumber max = 999999

Invalid: OldNumber or NewNumber is not a number

Invalid: OldNumber or NewNumber < 0

That said, there isn't enough information in your instructions to fully define valid/invalid values

It works only if values are entered correctly:

``````contain only digits;
no longer than 6 digits;
new value is not less than an old one;
``````

Missing information:

• whether decimals are allowed
• If decimals are allowed, how many decimal places
• whether "not less than" means that the new value can be the same as the old one
• whether either value can be null/empty

You've made assumptions about these conditions, but that does not necessarily mean that your assumptions are correct.

2

2

2

2

2

2

2

2