Download as pdf or txt
Download as pdf or txt
You are on page 1of 78

ASSIGNMENT 1 FRONT SHEET

Qualification BTEC Level 5 HND Diploma in Computing

Unit number and title

Submission date 04/05/2022 Date Received 1st submission

Re-submission Date Date Received 2nd submission

Student Name Võ Minh Quốc Student ID GCD201870

Class GCD0904 Assessor name Phạm Thanh Sơn

Student declaration
I certify that the assignment submission is entirely my own work and I fully understand the consequences of plagiarism. I understand that
making a false declaration is a form of malpractice.

Student’s signature Quoc


Grading grid

Grade (0-10)

1
❒Summative Feedback: ❒Resubmission Feedback:

Grade: Assessor Signature: Date:


IV Signature:

2
Table of Contents
I. INTRODUCTION:.................................................................................................................................................................................................................................. 4
II. USER REQUIREMENTS: ...................................................................................................................................................................................................................... 4
III. UI DESIGN ......................................................................................................................................................................................................................................... 5
IV. IMPLEMENTATION......................................................................................................................................................................................................................... 8
1. LINK GITHUB: ................................................................................................................................................................................................................................................................. 8
2. CLASSES: ......................................................................................................................................................................................................................................................................... 9
3. PROGRAM STRUCTURE: ................................................................................................................................................................................................................................................12
4. IMPORTANT ALGORITHMS: ..........................................................................................................................................................................................................................................15
A. Adding student: .................................................................................................................................................................................................................................................................................. 15
B. Delete student: .................................................................................................................................................................................................................................................................................... 17
5. ERRORS HANDLED:.......................................................................................................................................................................................................................................................19
V. TEST .................................................................................................................................................................................................................................................... 23
1. TEST PLAN ....................................................................................................................................................................................................................................................................23
2. TEST LOG ......................................................................................................................................................................................................................................................................27
3. TEST RESULT: ...............................................................................................................................................................................................................................................................34
VI. RESULT........................................................................................................................................................................................................................................... 56
1. ADDING FUNCTION: ......................................................................................................................................................................................................................................................56
2. UPDATING FUNCTION: .................................................................................................................................................................................................................................................62
3. DELETING FUNCTION: ..................................................................................................................................................................................................................................................68
VII. CONCLUSION:................................................................................................................................................................................................................................ 78
1. WHAT I LEANT: ............................................................................................................................................................................................................................................................78
2. WHAT I NEED TO IMPROVE..........................................................................................................................................................................................................................................78

3
I. Introduction:
An IETLS center have many difficulties in managing students, but they are choosing storing information of students in the papers, as a
result, a small amount of student data has been lost because of the papers’ length of life, or when they want to transfer the data to
another storage place, they need to copy it by handwriting, or even when searching the information of student, this make time-wasted.
Therefore, they hired me to design the student management application in order to support them in managing their students’
information. The application must have many important criteria, such as having the graphical user interface, reading, and writing
student data from file, having ability to work with the collection of data (searching for item). In addition, having application tested
before deploying it to ensure the crash must not happen at end user side.

II. User requirements:


After listening their requirements, I noted and analyzed their requirements. I concluded and wrote them down clearly. They want the
software:

- Can manage student:


 ID: this is unique,
 Name
 Gender
 Birthday
 Email
 Phone number
- Have four main functions:
 Create: To save information of student.
 Read: To display all or found students.
 Update: To update information of student.
 Delete: To delete information of student.

4
- And have more sub-functions, such as:
 Sorting ascending, descending information of students by their ID
 Find student by id and/or name

III. UI Design
- Wireframing is a way to design a website service at the structural level. A wireframe is a layout of a web page that
demonstrates what interface elements will exist on key pages. It is a critical part of the interaction design process. Because the
aim of a wireframe is to provide a visual understanding of a page early in a project to get stakeholder and project team
approval before the creative phase gets underway, I decided to place it in this report to support my work become easy, and also
customer can understand my application which I designed for them. This is a wireframe of student management software:

5
- These are the fields for user to type and choose students’ information, including:
 Text fields with rectangle shape which is the place to type student information, such as ID, Name, Birthday, Email,
Phone number.
 Two radio buttons for choosing student gender.

6
- These are the place for user to choose which function they want to implement through 3 radio buttons, ‘Add Function’,
‘Update Function’, and ‘Delete Function’; and corresponding to those three radio buttons if they are turned on, are three
buttons for implementation of saving, updating, delete student information.

- This is the place for user to find the student information by searching ID and/or Name of them.

7
- This is the two radio buttons to choosing for sorting ascending and descending students’ information by their ID

- This is the table for display the information of students for all or found students.

IV. Implementation

1. Link github:
https://github.com/Sagit612/ProjectJava

8
2. Classes:
There are 4 classes in my program, including:

 ‘StudentController’ class: contains CRUD functions, check information functions, read/write file functions, sorting student information
functions. Those functions have the mission to handle the data and then pass it to the class ‘MainFrame’ which is the view.

9
 ‘Student’ class: contains field (id, name, gender, birthday, email, phone number), contructors, functions getter and setter.

10
 ‘MainFrame’ class: contain button, table,…, return student information, getting from ‘StudentController’ class, to table functions. This
class also handle the button events.

 ‘App’ is the class main which help running the program.

11
3. Program structure:

12
13
This is structure of my program, including 4 class, ‘Student’ class, ‘StudentController’ class, ‘MainFrame’ class. Whenever the program starts, the
view appears and the ‘ReadDataFromFile’ function is called with its function passing the data from file to list and the data will be passed into the
‘ArrayList’, then the data from the ‘Database’ file are passed into the ‘ReadFile’ function. The view contain:

 Text field of id, name , birthday, email, phone number, and search id and name: to get text for handling.
 Radio button of choosing genders, add/delete/update functions, and sorting function.
 Button: Save, Delete, Update, Search
 Table to display the information of students

14
Whenever user add interact with view, the view will receive user actions such as adding, deleting, updating, the view has the mission to receive
data through text field such as id, name text field, the data will be passed into view, followed by controller, and given to a certain function to
handle, then the handled data will be passed into the ‘ArrayList’ and continuedly transferred to ‘WriteToFile’ function in order to write or override
them into the ‘Database’ file. The ‘Database’ file, then, will be read by ‘ReadFile’ function, and after that data corresponding with user need will
be returned to the view.

4. Important algorithms:

A. Adding student:
This is a flowchart of adding new student to ‘database.txt’ file

15
- Explanation:
 ‘studentInformation’ represents for id, name, gender, birthday, email, and phone number of student
 ‘studentInformation.isEmpty()’ is to check if user entered student’s information.
 ‘CheckStudentInformation(studentInformation)’ is a function from ‘StudentController’ class to check if student information is
duplicated.

16
 ‘CheckStudentInformationValid(studentInformation)’ is a function from ‘StudentController’ class to check if student
information is valid or not.
When user want to add new student, they need to enter information of that student, if information is null the program will alert and force
user to enter information. Then the program receives that information to check it first if it is unique (except for name and birthday) or
valid, if not, program will force user to enter again until that information is unique and valid, after everything is correct, the program will
process it by add it to array list and write that array list to file.

B. Delete student:
This is the flowchart of deleting student by id

17
- Explanation:
 ‘id.isEmpty()’ is to check if user entered id.
 ‘_students.size()’ is the size of the array list.
18
 ‘_student.get(i).getId()’ is to get the student ‘i’ with their information
 ‘_student.get(i).getId().equal(id)’ is to compare whether the student id is equal entered id or not.
- When user want to delete student, they need to enter the id of that student, then the program receives that id to check it first if it is null or
not if yes, program will force user to enter, after everything is correct, the program will process it by finding student with that entered id
and delete it from array list, after that the array list will be written into file.

5. Errors handled:
Everything happened normally when I add student into table, it was successful.

When I try to enter the string into the table, it still accepted the data and pass it into the table.
19
20
Then I create the function ‘checkbirthday’ to check the birthday is valid or not, but the when I tried to add birthday with the remaining student
information, it appeared the error.

21
Then I handled that error by catching that DateTimeParseException.
22
And if the birthday format that user enter into table is wrong, the catch will not handle that and the function return false, and then handling it at the
‘if… else’ statement

V. Test

1. Test plan
Test case ID Plan Start date End date Estimate Time
(Hrs/Day)
Button 1 Check ‘Male’ radio 02/05/2022 02/05/2022 2 hours
button is still selected
or not when switching
the selection between
2 buttons, ‘Male’
23
radio button and
‘Female’ radio button

2 Check ‘Female’ radio


button is still selected
or not when switching
the selection between
2 buttons, ‘Male’
radio button and
‘Female’ radio button
3 Check ‘Add Function’
radio button is still
selected or not when
switching the
selection between 2
buttons, ‘Add
Function’ radio button
and ‘Delete Function’
radio button and
‘Update Function’
radio button
4 Check ‘Delete
Function’ radio button
is still selected or not
when switching the
selection between 2
buttons, ‘Add
Function’ radio button
and ‘Delete Function’
radio button and
‘Update Function’
radio button
5 Check ‘Update
Function’ radio button
is still selected or not
when switching the
selection between 2
24
buttons, ‘Add
Function’ radio button
and ‘Delete Function’
radio button and
‘Update Function’
radio button
6 Check ‘Sorting Asc’
radio button is still
selected or not when
switching the
selection between 2
buttons, ‘Sorting Asc’
radio button and
‘Sorting Desc’ radio
button
7 Check ‘Sorting Desc’
radio button is still
selected or not when
switching the
selection between 2
buttons, ‘Sorting Asc’
radio button and
‘Sorting Desc’ radio
button
Function 8 Add student with valid
information
9 Add student with
invalid information

10 Delete student
11 Delete none student
12 Update student’s
information by the

25
new valid student
information
Update student’s
information with
information
overlapping with
another information in
the database
Update student with
the new invalid
information
13 Sort student
information ascending
by id
14 Sort student
information
descending by id
15 Search student’s id
which is available in
‘Database’ file
16 Search student’s name
which is available in
‘Database’ file
17 Search student’s id
and name which is
available in
‘Database’ file
18 Search student’s id
which is not available
in ‘Database’ file
19 Search student’s name
which is not available
in ‘Database’ file
20 Search student’s name
and id which is not
available in
‘Database’ file
26
21 Search student’s
information with
invalid information
Table 22 Check program alerts
or not when clicking
any row on table
without turning on
‘Delete Function’ and
‘Update Function’
function

2. Test log
Test case ID Procedure Expected result Result
Button 1 Check Click ‘Male’ radio buton ‘Male’ radio button is PASSED
‘Male’ radio Click ‘Female’ radio still selected
button is still button
selected or Click ‘Male’ radio
not when button
switching the
selection
between 2
buttons,
‘Male’ radio
button and
‘Female’
radio button
2 Check Click ‘Female’ radio ‘Female’ radio button is PASSED
‘Female’ button still selected
radio button Click ‘Male’ radio
is still button
selected or Click ‘Female’ radio
not when button

27
switching the
selection
between 2
buttons,
‘Male’ radio
button and
‘Female’
radio button
3 Check ‘Add Click ‘Add Function’ ‘Add Function’ radio PASSED
Function’ radio button. button is still selected
radio button
is still
selected or
not when
switching the
selection
among 3
buttons,
‘Add
Function’
radio button,
‘Delete
Function’
radio button
and ‘Update
Function’
radio button
4 Check Click ‘Delete Function’ ‘Delete Function’ radio PASSED
‘Delete radio button. button is still selected
Function’ Click ‘Delete’ button
radio button
is still
selected or
not when
switching the
selection
among 3
28
buttons,
‘Add
Function’
radio button,
‘Delete
Function’
radio button
and ‘Update
Function’
radio button
5 Check Click ‘Update Function’ ‘Update Function’ radio PASSED
‘Update radio button. button is still selected
Function’ Click ‘Update’ button
radio button
is still
selected or
not when
switching the
selection
among
buttons,
‘Add
Function’
radio button,
‘Delete
Function’
radio button
and ‘Update
Function’
radio button
6 Check Click ‘Sorting Asc’ ‘Sorting Asc’ radio PASSED
‘Sorting Asc’ radio button button is still selected
radio button Click ‘Sorting Desc’
is still radio button
selected or Click ‘Sorting Asc’
not when radio button
switching the
29
selection
between 2
buttons,
‘Sorting Asc’
radio button
and ‘Sorting
Desc’ radio
button
7 Check Click ‘Sorting Desc’ ‘Sorting Desc’ radio PASSED
‘Sorting radio button button is still selected
Desc’ radio Click ‘Sorting Asc’
button is still radio button
selected or Click ‘Sorting Desc’
not when radio button
switching the
selection
between 2
buttons,
‘Sorting Asc’
radio button
and ‘Sorting
Desc’ radio
button
Function 8 Add student Click ‘Add Function’ Student will be added on PASSED
with valid radio button. ‘Database’ file and table
information Type valid information And the program will
Click ‘Save’ button announce ‘ADD
SUCCESSFULLY’
9 Add student Click ‘Add Function’ The program will give PASSED
with invalid radio button the alert until user
information Type valid information typing the valid
for each text field information

10 Delete Click ‘Delete Function’ Student will be deleted PASSED


student radio button from table and
‘Database’ file
30
Choose student need to And the program will
be deleted by clicking announce ‘ADD
on the row containing it SUCCESSFULLY’
on the table
Click ‘Delete’ button
11 Delete none Click ‘Delete Function’ The program will give PASSED
student radio button the alert until user
Click ‘Delete’ button choose the row
containing student
information on the table
12 Update Click ‘Update Function’ Student will be updated PASSED
student’s radio button their information on
information Choose student needing ‘Database’ file and table
by the new to be updated by And the program will
valid student clicking on the row announce ‘UPDATE
information containing it on the table SUCCESSFULLY’
Their information will
be filled on the text field
automatically
Change that information
by the new valid
information
Click ‘Update Function’
button

13 Update Click ‘Update Function’ The program will give FAILED


student’s radio button the alert until user types
information Choose student needing the valid information
with to be updated by that is not overlapping
information clicking on the row with another id on the
overlapping containing it on the table table and ‘Database’ file
with another Their information will
information be filled on the text field
in the automatically
database Change that information
by the overlapping
information on the table
31
Click ‘Update Function’
button

14 Update Click ‘Update Function’ The program will give PASSED


student with radio button the alert until user type
the new Choose student needing the valid information.
invalid to be updated by
information clicking on the row
containing it on the table
Their information will
be filled on the text field
automatically
Change that information
by the new invalid
information
Click ‘Update Function’
button

15 Sort student Click ‘Sort Asc’ radio Student information on PASSED


information button the table will be sorted
ascending by ascending by id
id
16 Sort student Click ‘Sort Desc’ radio Student information on PASSED
information button the table will be sorted
descending descending by id
by id
17 Search Type student ID which Only student has that ID PASSED
student’s id is available in will be appeared on the
which is ‘Database’ file to search table
available in Click ‘Search’ button
‘Database’
file
18 Search Type student name Student has that string PASSED
student’s which is available in will be appeared on the
name which ‘Database’ file to search table
is available Click ‘Search’ button

32
in ‘Database’
file
19 Search Type student ID with Only student has that ID PASSED
student’s id their name which is and name will be
and name available in ‘Database’ appeared on the table
which is file to search
available in Click ‘Search’ button
‘Database’
file
20 Search Type student Id which is There will be nothing on PASSED
student’s id not available in the table
which is not ‘Database’ file to search
available in Click ‘Search’ button
‘Database’
file
21 Search Type student name There will be nothing on PASSED
student’s which is not available in the table
name which ‘Database’ file to search
is not Click ‘Search’ button
available in
‘Database’
file
22 Search Type student id with There will be nothing on PASSED
student’s their name in both the table
name and id corresponding text fields
which is not which is not available in
available in ‘Database’ file to search
‘Database’ Click ‘Search’ button
file
23 Search Type any invalid There will be nothing on PASSED
student’s information in both text the table
information fields
with invalid Click ‘Search’ button
information
Table 24 Check Click to the table The program will alert PASSED
program without turning on until user choosing the
alerts or not ‘Delete Function’ or function
33
when ‘Update Function’ radio
clicking any button
row on table
without
turning on
‘Delete
Function’
and ‘Update
Function’
function

3. Test result:
Test case 1: Check ‘Male’ radio button is still selected or not when switching the selection between 2 buttons, ‘Male’ radio button and ‘Female’
radio button.

 ‘Male’ radio button is still selected

Test case 2: Check ‘Female’ radio button is still selected or not when switching the selection between 2 buttons, ‘Male’ radio button and ‘Female’
radio button

34
 ‘Female’ radio button is still selected

Test case 3: Check ‘Add Function’ radio button is still selected or not when switching the selection among 3 buttons, ‘Add Function’ radio button,
‘Delete Function’ radio button and ‘Update Function’ radio button

 ‘Add Function’ radio button is still selected

Test case 4: Check ‘Delete Function’ radio button is still selected or not when switching the selection among 3 buttons, ‘Add Function’ radio
button, ‘Delete Function’ radio button and ‘Update Function’ radio button

35
 ‘Delete Function’ radio button is still selected

Test case 5: Check ‘Update Function’ radio button is still selected or not when switching the selection among buttons, ‘Add Function’ radio
button, ‘Delete Function’ radio button and ‘Update Function’ radio button

 ‘Update Function’ radio button is still selected

Test case 6: Check ‘Sorting Asc’ radio button is still selected or not when switching the selection between 2 buttons, ‘Sorting Asc’ radio button
and ‘Sorting Desc’ radio button

36
 ‘Sorting Asc’ radio button is still selected

Test case 7: Check ‘Sorting Desc’ radio button is still selected or not when switching the selection between 2 buttons, ‘Sorting Asc’ radio button
and ‘Sorting Desc’ radio button

 ‘Sorting Desc’ radio button is still selected

Test case 8: Add student with valid information

37
 Added successfully

Test case 9: Add student with invalid information

38
39
 The alert appeared until the valid information are typed.

Test case 10: Delete student

40
 Deleted successfully

Test case 11: Delete none student

41
 The alert appeared to remind user of choosing student from table

Test case 12: Update student’s information by the new valid student information

42
 Updated successfully

43
Test case 13: Update student’s information with information overlapping with another information in the database

44
 Failed, because the updating still implemented successfully without checking information overlapping or not.

Test case 14: Update student with the new invalid information

 The alert appeared until the valid information are typed.

45
Test case 15: Sort student information ascending by id.

 Student information were sorted by id

46
Test case 16: Sort student information descending by id

 Student information were sorted by id

Test case 17: Search student’s id which is available in ‘Database’ file

47
 Information of student with corresponding id appeared

Test case 18: Search student’s name which is available in ‘Database’ file

48
 Information of student containing corresponding name string appeared

Test case 19: Search student’s id and name which is available in ‘Database’ file

49
 Information of student with corresponding id and name appeared

Test case 20: Search student’s id which is not available in ‘Database’ file

50
 Because there is no student with ID = 15 in database, so the program returned the empty table.

Test case 21: Search student’s name which is not available in ‘Database’ file

51
 Because there is no student with Name = Khang in database, so the program returned the empty table.

Test case 22: Search student’s name and id which is not available in ‘Database’ file

52
 Because there is no student with ID = 15 and Name = Khang in database, so the program returned the empty table.

Test case 23: Search student’s information with invalid information

53
 The program returned the empty table.

Test case 24: Check program alerts or not when clicking any row on table without turning on ‘Delete Function’ and ‘Update Function’ function

54
55
 The alert appears until user choosing function.

VI. Result

1. Adding function:
- When running application:

56
- Turning on the ‘Add Function”:
 Id text field will be opened.
 Name text field will be opened
 Gender radio buttons will be opened:
 Birthday text field will be opened.

57
 Email text field will be opened.
 Phone number text field will be opened.

58
- Then I typed student information into those text field and chose their gender

59
- After that, I clicked save and the panel would appear and announce that I added student information successfully

60
- And this is a result of adding function

61
2. Updating function:
- I used the result of adding function to continue the updating function.

- When turning on the updating function:

62
 Name text field will be opened
 Gender radio buttons will be opened:
 Birthday text field will be opened.
 Email text field will be opened.
 Phone number text field will be opened.

63
- Then I chose which information would be updated by clicking on it, the student information appeared on the text field, except for Id would
not be updated.

64
- After that I changed the student information, clicked update button, and the panel would appear and announce that I updated student
information successfully

65
66
- This is the result of updating student information:

67
3. Deleting function:
- I used the result of updating function information continue the deleting function.

68
- Then I chose which information would be deleted by clicking on it, the student information appeared on the text field without changing it.

69
- After that, I clicked delete button, and the panel would appear and announce that I deleted student information successfully

70
71
72
73
74
75
76
77
VII. Conclusion:

1. What I leant:
After implementing this project, I

- Learnt how to apply the MVC model into this project to keep the program maintained and scaled easily.
- Learnt how to handle the event happening through clicking buttons and make it more logical in order to avoid many errors.
- Acknowledged that using test plan, test case, test log is indispensable, it helps me find the errors and handle it to avoid the crashing
happening when running the program.
- Learnt how to read/write data from file in order to save the data, and load data whenever user runs the program.
- Learn how to validate input to avoid user enter the wrong information by mistakes.

2. What I need to improve


- In terms of the GUI which is interface of program, I found that my application was not well-designed, user-friendly, and it also has some
illogical flow of actions.
- In terms of the program, I found that my program has some errors that I cannot handle, although they do not make my program crashed
when running, they are validated, and my test covered them as many as possible.

So, in the future, I will learn and invest myself more into it for improve my future program.

78

You might also like