A car ordering application allows for the buying and selling of cars with the following options:
- Support trading in Boston and New York.
- Have registration numbers the may be valid or invalid.
- Allow the trade for the brand of cars BMW, Audi, and Mercedes.
- Provide for two types of booking, E-Booking and On In-Store.
- Accept Orders only during trading hours.
Step 1 - Define Variables and States
- Order category
- New York
- Car brand
- Registration numbers
- Order type
- Order time
- Working hours
- Non-working hours
Step 2 - Determine and Define Constraints
Determining what constraints that need to be considered is very important because it is dependent on how the business rules work for the given system. If we leave off the constraints, we would get tests that could not be created due to the post conditions of the listing process (e.g. Buying a Mercedes car with an invalid registration number in Boston online during working hours ). Without defining the constraints, we toss out the whole test. However, there may be options for some of the variables that are not tested in any other test so valid tests get tossed out with the invalid tests. It also shows that when designing tests, knowing the order of processing is necessary to properly design tests.
Consider What Cars Can Be Bought or Sold
A customer must first selects what brand of car they want to buy or sell; and from this Car Order Application, only three brands are allowed:
Considering Valid and Invalid Registration Numbers
Registration numbers should be verified at the time a car is listed on the system; so, the following must be constrained:
Invalid Registration Numbers
- Cars with an invalid registration number are only allowed during the selling process.
- Cars with an invalid registration number are not allowed during the buying process.
Valid Registration Numbers
- Cars with a valid registration number are allowed during selling process.
- Only cars with a valid registration number will be available during buying process.
- If a customer is buying a car, the customer would select a brand and the system would display available cars for that brand, but only cars with valid registration numbers.
- If a customer is selling a car, they would they would then enter in the registration number. At that point the system would check the registration number. Registration numbers are linked to the brand so you would need to know the brand in order to validate it.
- Thus, a Requires (Invalid, Sell) constraint is needed that only allows cars that have Invalid Registration Numbers to be sold and not purchased.
Considering Order Time & Order Type
The constraints for selling or buying a car is dependent on when and where a sell or buy is allowed. The when is defined by order time (Working hours, Non-working hours). The where is defined by order type (E-Booking, In-Store).
- If a customer wants to sell or buy via E-Booking, then the time when the sell or purchase is made is irrelevant because E-Booking is 24 hours.
- If a customer wants to sell or buy via In-Store, then the sell or purchase can only happen during working hours.
- Thus, a Requires (In-Store, Working hours) constraint is needed that only allows In-Store during work hours.
Considering Valid/Invalid Registration, Location & Order Time
If the Registration Number is Invalid then that would MASK the City, Order Type, and Order Time. That’s because if it is invalid, the system would not bother with selecting a city or an order type or order time. One tuning to this might be if they have different procedures for determining if a registration is valid/invalid if it’s an E-Booking versus In-store. In that case Registration Number would only MASK City and Order Time.
- In other words you would want to make sure that both work properly so you would want tests with an Invalid registration number in both of the Order Type situations.
- Thus, a Mask (Invalid, Location, Order Time), is needed.