The selected system is expected to allow in a registered car into the car park if the car charge subscription exists and is sufficient. The system will first check car park space availability before checking on the car eligibility. Then the car owner will be provided with a menu for quick registration and pay subscription fee if the car does not exist in the system.
Once the car is eligible, the gate opens automatically if there exist an empty car parking slot. The car moves the parking and the gate behind it is closed for security measures. The car owner will be allowed to leave out of the parking automatically.
The system should be able to detect the car registration number to check against existing system car registration numbers records.
The system should automatically operate between various processes while moving from one menu to the other and finally skip to the main menu if it is done serving the customer in the line.
Test cases for unit testing
Test case
|
results
|
Does the system show menu
|
Yes the system shows the menu
|
Does the system checks whether there exist car park spaces
|
Yes the car indicates available car spaces
|
The system should check for the existence of the car in the system record. If it does not exist the system should allow for the car registration
|
System shows car exist
System shows car does not exist
|
Does the system provide the subscription fee balances and eligibility
|
The system shows subscription balances and eligibility
|
Does the system redirects to the menu in case one menu option is done
|
The system redirects successfully
|
Does the system allows the car to leave the parking
|
the system allows car parking leaving
|
Does the system exit successfully
|
The system exits successfully
|
Control flow graphs
0: (A) check car availability
1: (B) if car space == 0
2: (B) inform car owner on no car park availability and return to main menu
3: (C) if car space > 1
4: (C) read car registration number and check in the system databases for its eligibility
5: (D) if eligibility == false && subscription ==0
6: (D) inform car owner for re-subscription
7: (E) if eligibility == false && car Registration number != exists
8: (E) provide the user with registration menu
9: (F) if eligibility == true and car reg number == exists
10: (F) welcome the car in and open the gate and print the car park ID number
- (G) if user wants to leave the parking, open the gate for the car and allow it to leave
In the above, we have 5 blocks:
A at 0, B from 1 to 2, C from 3 to 4, D from 5 to 6, E from 7 to 8, F from 9 to 10 and G at 11.
In this case, a is the start or entry block while G is the exit block.
Data flow testing graph
This involves testing all the above nodes and the edges provided in the above control flow graph.
If (carSpace==0){
System.out.println(“No car space available”);
}Else if (carSpace>0){
Scanner s = new Scanner(System.in)
System.out.println(“Display Menu”);
Int option = s.nextInt;
If(option==1){
System.out.println(“Please enter car reg number”);
String regNo = s.next;
If(regNo != exists){
System.out.println(“That regNO does not exists in the database. Please register.”);
}else{
Int subscription = constant;
If(subscription==0){
}else{
System.out.println(“Welcome to the parking.”);
}else{
Sytem.out.println(“Leaving parking …..Thank you and bye…”);
Test cases for data flow testing
TEST CASES
|
Does the system check whether car space is full or has a space
|
If car park is full, does the system inform the car owner
|
If car park has a space, does the system allow car reg number existence in the database
|
If the car reg number does not exist, does the system allow new car registration and allow subscription
|
If the car reg number is found in the database, does the system verify the car eligibility in the subscription fee
|
If car is not eligible due to low charge subscription fee, the system should allow the car owner to resubscribe
|
If the car is eligible and subscription fee is sufficient, the system opens the gate for the car to get into the parking
|
If the car wants to leave the car park, does the system open the gate for the car to leave
|
Domain testing
Test case
|
Test results while using values
|
When menu is displayed, when we enter correct option and wrong option, what happens
|
Correct option value of 1
Wrong option value of 6
|
Does the system checks whether there exist car park spaces
|
Yes the car indicates available car spaces when we chose option 1
|
The system should check for the existence of the car in the system record. If it does not exist the system should allow for the car registration
|
System shows car exist when system checks in verifying car no XAB
System shows car does not exist
|
Does the system provide the subscription fee balances and eligibility
|
The system shows subscription balances and eligibility when you press 1
|
Does the system redirects to the menu in case one menu option is done
|
The system redirects successfully after process completion
|
Does the system allows the car to leave the parking
|
the system allows car parking leaving when we chose option 2
|
Does the system exit successfully
|
The system exits successfully when option 3 is selected
|