Department of computing
Car Pool Reservation
Module Leader: Mr.Guganathan Poravi Student First name : Geerthana Student last name : Bhasgaran Student No
: 2014225
Date of submission :7/17/2015
Content
Introduction …………………………………………………………………… ……………………………………………………………………… …..04
Analysis I. Functional Requirements ……………………………….......................05 ……………………………….......................05 II. Non-functional Non-functional Requirements …………………………………………06 …………………………………………06
Designing I. Use case diagram …………………………………………………………… ……………………………………………………………07 07 II. Activity diagram for functional requirement ……………………08 ……………………08 III. Class diagram …………………………………………………………… ………………………………………………………………… ……14 14
Implementation I. User login ………………………………………………………………… …………………………………………………………………..15 ..15 II. Add member (some as the add employee and vehicle) …16 III. Search member (some as the employee) ……………………..17 ……………………..17 IV. View vehicle ……………………………………………………………… ………………………………………………………………18 18 V. Reservation ……………………………………………………………… ……………………………………………………………….18 .18 Screenshots …………………………………………………………………… ……………………………………………………………………… …. 19
Evaluation I. Black box Testing T esting ………………………………………………………… 26 ………………………………………………………… 26 II. White box Testing ………………………………………………………. ………………………………………………………. 29
2
List of figures 1. Figure 1.1 use case diagram Figure …………………………………………………… 07 2. Figure 2.1 activity diagram for login figure ………………………………………… . 08 3. Figure 2.2 activity diagram for reserve a vehicle figure ……………………… 09 ……………………… 09 4. Figure 2.3 activity diagram for vehicle registration figure …………………….10 …………………… .10 5. Figure 2.4 activity diagram for rent registration figure ………………………..11 ……………………… ..11 6. Figure 2.5 activity diagram for search vehicle figure …………………………… 12 7. Figure 2.6 activity diagram for update vehicle figure …………………………...13 ………………………… ...13 8. Figure 3.1 class diagram diagram figure ………………………………………………………… 14 9. Figure 4.1 Screen shot for Main menu(Login page) …………………………….19 …………………………… .19 10. Figure 4.2 Screen shot for add member Page …………………………………… ..20 11. Figure 4.3 Screen shot for add vehicle ……………………………………………… ..21 12. Figure 4.4 Screen shot for view vehicle page ……………………………………… ………………………………………22 22 13. Figure 4.5 Screen shot for Reservation page …………………………………… ... 23 14. Figure 4.6 Screen shot for view reservation …………………………………… . 24
3
Introduction This system is developed for reserve the vehicle for Car Pool Reservation firm which located in the Colombo. And it covers Western Province of Sri Lanka, works as the meeting point to the people who willing to share their vehicle to work and home. Main features of this system are to reserve the car for the people who need, and view the details of the reservation. Functionality of this system is adding vehicle by the owner, reserve the vehicle, add employee details, add member details, search customer details, view vehicle details, view driver details etc. Purpose of this system is to make automation of the Car Pool Reservation system’ system’s functionality.
4
Analysis Functional Requirements Reservation 1. The System must allow the customer to register for reservation. 2. The system shall allow the customer to view detail description of vehicle, driver, and reservation. 3. The system must view list of available vehicles during reservation 4. The system shall allow the employee and customer to view reservations made by customers. 5. The system must be able to provide a unique reservation conformation number for all successful committed reservations. 6. The system must be able to display reservation summary for successfully committed reservation.
Login 1. The system should allow staff and customers login to the system using their username and password. 2. The system should allow staff to login to the system using their username and password and also already register customers are using their username and password. 3. The system shall allow the members reserve the vehicle and change member details. 4. The system shall allow the change vehicle details and employee details.
Vehicle 1. The system should allow staff and customers(vehicle owner) register new vehicles. 2. The system shall allow staff and customers to select vehicles. 3. Adding details of a vehicles Vehicle no o Vehicle name o Vehicle model o Carrying capacity o Engine capacity o Colour of vehicle o
5
Some as the member member , employee employee and driver. driver. Adding details of member o o o o o o o
Member ID Name Username Password Email Telephone no Address
Adding details of driver o o o o o o o
Employee id Name Username Password Email Telephone Address
Non Functional Requirements 1. 2. 3. 4.
Extensibility Maintainability Efficiency Accessibility
6
Designing User case diagram Car Pool Reservation
Login
Vehicle Registration
Reserve vehicle
Search Vehicle
Update vehicle
View Vehicle Member Admin
Update Rent View Reservation Driver Registration
Update driver View Driver
Employee Registration
Update Employee
Rent Registration
Logout
Figure 1.1 use case diagram Figure
7
Analysis Model
Activity diagram Activity diagram - login
Login
Enters Username & Password
Checks Username, Password
If input is invalid
If input is valid
Logged in to System
Figure 2.1 activity diagram diagram for login figure figure
8
Activity diagram – Reserve a vehicle
RegistrationRese
informationCustomers Enter
StatusName, ID, Phone Number, Vehicle No,
input is Empty
input is not Empty
vehicleCheck
Available
not Available
SuccessReserv ation Success
detailShow confirmation Number
Figure 2.2 activity diagram for reserve a vehicle figure
9
Activity diagram - vehicle registration registration
Vehicle Registration
Customers or Employees Enter vehicle information
Plate No, Model, Type, Engine Capacity, Insurance date, Insur Insuran ance ce Ex -dat -date e
If input is Empty
If input is not Empty
Check Plate No
If Available
If not Available
Vehicle Registered Success
Figure 2.3 activity diagram for vehicle registration registration figure
10
Activity diagram – Rent registration
Rent
Customers Enter
Customer Information, Vehicle, Payment,
If input is EmptyIf
If input is not EmptyIf
Check
If AvailableIf
If not AvailableIf
Rent
Show rent
Figure 2.4 activity diagram for rent rent registration figure figure
11
Activity diagram – Search vehicle
Vehicle Registration
Customers or Employees selects
Select Plate No
If Not Selected or Invalid Plate No
If Selected or Valid Plate No
Searches from Database
Displays Vehicle
Figure 2.5 activity diagram for search vehicle figure figure
12
Activity diagram – update vehicle
Enter Plate No
Customers or Employees Enter vehicle information
If Valid
If Invalid
Enter Update information
Check Validation
If Valid
If Invalid
Update Vehicle
Figure 2.6 activity activity diagram for update vehicle figure
13
Class Diagram 1..*
Person
Vehicle
ID: String Name: String Username: String Password: String E-mail: String Address: String Phone Phone Number Number:: Inte Inte er
Plate Number : String Vehicle Model : String Vehicle Type : String Engine Capacity : String Insurance Date : DateTime Insurance expDate : DateTime
getName() : void getUsername () : void getPassword() : void getE-mail() : void getAddress() : void getPhoneNo(): void setName() : void setUsername () : void setPassword() : void setE-mail() : void setAddress() : void setPhoneNo(): void
1..*
RegisterVehicle() UpDateVehicle()
1
1..*
1
Member
Em lo ee
1
Member ID: String
Employee ID: String
setMemberID () : Void registeredMember() viewVehicle() viewDriverDetail() rentVehicle () reserverVehicle()
setEmployeeID () : Void viewVehicle() viewReserverVehicleDetail() viewDriverDetail() rentVehicle () reserverVehicle() UpdateVehicle() ViewEmployeeDetail() UpdateEmployeeDetail()
Reservation
1
Plate Number : String To: String From: String reserveVehicle() viewreserve()
1..*
VehicleOwner
RegisteredVehicle()
Driver Licence No :String Age : Date 1
1
14
Implementation User Login public void showData(){
String str1 = usernametxt.getText(); char[] p = passwordtxt.getpassword(); String str2 = new String (p); try{ Class. forName("com.mysql.jdbc.Driver" "com.mysql.jdbc.Driver"); ); Connection con; con = (Connection)DriverManager. getConnection("jdbc:mysql://localhost/car" "jdbc:mysql://localhost/car", ,"root" "root" , , "root"); "root" ); PreparedStatement ps = con.prepareStatement( con.prepareStatement( "select name from employee where UserName =? and Password =?" ); ps.setString(1, str1); ps.setString(2, str2); ResultSet rs = ps.executeQuery(); ps.executeQuery(); if(rs.next()){ JOptionPane. showMessageDialog(null,"Login successfully ! ..."); ..." ); }else{ JOptionPane. showMessageDialog(null, "Incorrect username or password .. Try Again with correct detail" ); } } catch (Exception ex){ System. out.println(ex); } } showDatamember(){ public void showDatamember(){ String str1 = usernametxt.getText(); char[] p = passwordtxt.getpassword(); String str2 = new String (p); try{ Class. forName("com.mysql.jdbc.Driver" "com.mysql.jdbc.Driver"); ); Connection con; con = (Connection)DriverManager. getConnection("jdbc:mysql://localhost/car" "jdbc:mysql://localhost/car", ,"root" "root" , , "root"); "root" ); PreparedStatement ps = con.prepareStatement( con.prepareStatement( "select name from member where UserName =? and Password =?" ); ps.setString(1, str1); ps.setString(2, str2); ResultSet rs = ps.executeQuery(); ps.executeQuery(); if(rs.next()){ JOptionPane. showMessageDialog(null,"Login successfully ! ..."); ..." ); }else{ JOptionPane. showMessageDialog(null, "Incorrect username or password .. Try Again with correct detail" ); } } catch (Exception ex){
15
System. out.println(ex); } }
Add Member ClassNotFountException, SQlException{ public static int addMember(Members m) throws ClassNotFountException, Connection con = ConnectionDB(); String quary = "INSERT INTO member values('" + m.getMemberId() + "','" + "','" + m.getMemberName() + "','" "','" + + m.getUsername() + "','" "','" + + m.Password() + "','" + m.getEmail() + "','" "','" + + Integer. parseInt(m.getPhoneNo())+ "')" "')" ; ; int res = DBHandler.setData(con, quary); return res; } addBtnActionPerformer(java.awt.event.Action wt.event.ActionEvent Event evt){ private void addBtnActionPerformer(java.a if(!memberIdTxt.getText().isEmpty() (!memberIdTxt.getText().isEmpty() &&!mbnametxt.getText( &&!mbnametxt.getText().isEmpty() ).isEmpty() &&!mbusernametxt.getText().isEmpty() &&!mbpasswordtxt.getText().isEmpty() &&!mbMobileNoTxt.getText().isEmpt &&!mbMobileNoTxt.ge tText().isEmpty() y() &&!mbEmailtxt.getText &&!mbEmailtxt.getText().isEmpty() ().isEmpty() && !addressTxtArea.getText().isEmpty()){ String memberId = memberIdTxt.getText(); String memberName = mbnametxt.getText(); mbnametxt.getText(); String memberUserName = mbusernametxt.getText(); mbusernametxt.getText(); String memberPassword = mbpasswordtxt.getText(); mbpasswordtxt.getText(); String teleNo = mbMobileNoTxt.getText(); String email = mbEmailtxt.getText(); mbEmailtxt.getText(); String address = addressTxtArea.getText(); Members m = new Members(memberId, Members(memberId, memberName, memberUserName, memberPassword, teleNo , email, address); try{ int i = memberController.addMember(m); memberController.addMember(m); if(i == 1){ memberIdTxt.setText("" memberIdTxt.setText( ""); ); mbnametxt.setText("" mbnametxt.setText( ""); ); mbusernametxt.setText("" mbusernametxt.setText( ""); ); mbpasswordtxt.setText("" mbpasswordtxt.setText( ""); ); mbMobileNoTxt.setText("" mbMobileNoTxt.setText( ""); ); mbEmailtxt.setText("" mbEmailtxt.setText( ""); ); addressTxtArea.setText("" addressTxtArea.setText( ""); ); JOptionPane. showMessageDialog(rootPane, "Added Successfully :)!" ); } } (ClassNotFoundException | SQLException ex ){ catch(ClassNotFoundException Logger. getLogger(Memberview. class.getName()).log(Level. SEVERE,null, ex); } nextIDgenForMember(); }else{ JOptionPane. showMessageDialog(rootPane, "Please fill all fields !"); !" ); } }
16
Search Member actionPerformed(ActionEvent e){ public void actionPerformed(ActionEvent try{ String str = tf5.getText(); Class.forName("com.mysql.jdbc.Driver" Class.forName( "com.mysql.jdbc.Driver"); ); Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/CW3" DriverManager.getConnection( "jdbc:mysql://localhost:3306/CW3", ,"root" "root" , , "root" "root"); ); PerpareStatement st = con.prepareStatement( con.prepareStatement( "Select* from member where MemberId = ? " ); st.setString (1, str); ResultSet rs = st.executeQuery(); st.executeQuery(); if(rs.next()){ String String String String
s = rs.getNString(1); s1 = rs.getNString(2); s2 = rs.getNString(3); s3 = rs.getNString(4);
tf1.setText(s); tf2.setText(s1); tf3.setText(s2); tf4.setText(s3); } else{
JOptionPane.showMessageDialog( null, "Membeer ID is not found "); " ); } catch(Exception ex){
System.out.println(ex); } }
17
View vehicle public void getToDetailsTable(){ getToDetailsTable(){
newOrderDetailsTable.setRowCount(0); try{ ArrayList al = new ArrayList(); al = vehicleController.viewAllvehicle vehicleController.viewAllvehicle(); (); for(int i = 0 ; i
Reservation reserveCar(CarPoolReservationRequirement nRequirement cpr) throws public static int reserveCar(CarPoolReservatio ClassNotFoundException , SQLException{ ClassNotFoundException Connection con = ConnectorDB.getDBConnection ConnectorDB.getDBConnectiontoDB(); toDB(); String quary = "INSERT INTO reservationCar values ('" + cpr.getBookingID() + "','" "','" + + cpr.getVehicleID() cpr.getVehicleID() + "','" "','"+ + cpr.getMemberId()+ cpr.getMemberId()+ "','" + "','" + cpr.getPaymentId() + "','" "','"+ + cpr.getDiscountPercent() cpr.getDiscountPerc ent() + "','" + cpr.getFinalReservationCharge() cpr.getFinalReservationCharge() + "','"+cpr.getPaymen "','" +cpr.getPaymentId() tId() + "','" "','"+ + cpr.getTo() + "','" "','"+ + cpr.getFrom() +"','" "','"+cpr.getNumberRequired()+ +cpr.getNumberRequired()+"')" "')"; ; int res = DBHandler.setData(con, quary); return res; }
18
Screen shot Login Page (Main menu)
Figure 4.1 Screen shot for Main menu(Login menu(Login page)
19
Add Member
Figure 4.2 Screen shot for add member member Page
20
Add Vehicle
Figure 4.3 Screen shot for add vehicle
21
View Vehicle
Figure 4.4 Screen shot for view vehicle page
22
Payment
23
Figure 4.5 Screen shot for Reservation page page
24
View Reservation
Figure 4.6 Screen shot for view reservation
25
Evaluation Black-Box Testing
Add a new Members
No
Input
Expect Output
Actual Output
Bug?
1
Member Name : John Member Name : 1234 Username : John
Stores the member name Invalid
No
8
Stores the member password Password : 1234 Stores the member password Email : Stores the [email protected] member email Email : 1434234 Invalid
9
Email : jijdjfgfh
Invalid
10
Phone No : 0777234645
11
Phone No : gjskjeod Address : Colombo
Stores the member phone no Invalid
Stores the member name Stores the member name Stores the member username Stores the member username Stores the member password Stores the member password Stores the member email Stores the member email Stores the member email Stores the member phone no Invalid
Stores the member address Stores the member address
Stores the member address Stores the member address
2 3
4
Username : 1234
5
Password: john
6
7
12
13
Address : 2453435
Stores the member username Invalid
Yes No
yes
No
No
No yes yes No
No No
No
26
Add a new employee
No
Input
Expect Output
Actual Output
Bug?
1
Employee Name : John Employee Name : 1234 Username : John
Stores the employee name Invalid
No
8
Stores the employee password Password : 1234 Stores the employee password Email : Stores the [email protected] employee email Email : 1434234 Invalid
9
Email : jijdjfgfh
Invalid
10
Phone No : 0777234645
11
Phone No : gjskjeod Address : Colombo
Stores the employee phone no Invalid
Stores the employee name Stores the employee name Stores the employee username Stores the employee username Stores the employee password Stores the employee password Stores the employee email Stores the employee email Stores the employee email Stores the employee phone no Invalid
Stores the employee address Stores the employee address
Stores the employee address Stores the employee address
2 3
4
Username : 1234
5
Password: john
6
7
12
13
Address : 2453435
Stores the employee username Invalid
Yes No
yes
No
No
No yes yes No
No No
No
27
Add a new vehicle
No
Input
Expect Output
Actual Output
Bug?
1
Vehicle no : 01234 Vehicle No : sdk2334 Vehicle name : Jamaha Vehicle name : 1234 Carrying capacity : 7409
Stores the vehicle no Stores the vehicle no Stores the vehicle name Invalid
Stores the vehicle no Stores the vehicle no Stores the vehicle name Stores the vehicle name Stores the carrying capacity Stores the carrying capacity Stores the engine capacity Stores the engine capacity Stores the colour Stores the colour
No
2 3 4 5
6
Carrying capacity : jasdja
7
9
Engine capacity : 8402 Engine capacity : hjlkdjkjj Colour : red
10
Colour : 990-39
8
Stores the carrying capacity Invalid
Stores the engine capacity Invalid Stores the colour Invalid
No No yes No
yes
No yes No yes
Reservation
No
Input
Expect Output
Actual Output
Bug?
1
From : Colombo From : 344545 To : Colombo To : 398940 Distance: 3454 Distance: fdjkljfk Per (Km): 3454 Per (Km): sdoe
Stores the from
Stores the from
No
Invalid Stores the to Invalid valid Invalid
Stores the from Stores the to Stores the to valid Invalid
yes No yes No No
valid Invalid
valid Invalid
No No
2 3 4 5 6 7 8
28
White-Box Testing
No
Condition
1
Add more customer
2
Edit customer
3
Search customer
4
Add more vehicle
5
Edit vehicle
6
View vehicle
7
Add driver
8
View driver
Path Yes – calls the register customer page No – return back to the main menu Yes – calls the register customer page No – return back to the main menu Yes – calls the register customer page No – return back to the main menu. Yes – Calls the register vehicle page No – return back to the main menu Yes – call the register vehicle page No – return back to the main menu Yes – call view vehicle page No – return back to the main menu Yes – call register to the vehicle page No – return back to the main menu. Yes – call view driver page No – return back to the main menu
Conclusion
This system is developed in Java base to automate the functionality of the Car Pool reservation. Reservation, adding details, update are special features developed here to fulfil the need of the firm. This system provide more easier, reduce the wastage of time of the firm’ firm’s work, maintain standard database and change manual system in to automatic.
29
30