Comp1752-Oop 3
Comp1752-Oop 3
1
COMP-1752 Object Oriented Programming
TABLE OF CONTENTS
I. Introduction......................................................................................................................... 3
II. Design and Development.................................................................................................. 3
1. create_video_list.py:.......................................................................................................3
2. update_video.py:............................................................................................................ 7
III.TESTING AND FAULTS...................................................................................................... 9
1. Unit test (Library Item):...................................................................................................9
2. create_video_list.py test cases:....................................................................................11
3. update_video.py test cases:.........................................................................................12
IV. INNOVATION, CONCLUSION AND FURTHER DEVELOPMENT...................................12
1. Innovation:....................................................................................................................12
2. Conclusion and Further Development:.........................................................................13
3. Reflection:.................................................................................................................... 13
Appendix A:.......................................................................................................................... 14
Appendix B:.......................................................................................................................... 15
2
COMP-1752 Object Oriented Programming
I. Introduction
The aim of this coursework was to create a simulation of a video player, similar to a
simplified version of Windows Media Player. The project entailed the creation and execution
of graphical user interfaces (GUIs) for interacting with a video collection. These interfaces
allowed users to generate playlists, modify video ratings, and access video information. The
project focused on fundamental principles of object-oriented programming (OOP), the
building of graphical user interfaces (GUI) using Tkinter, and the implementation of testing
procedures.
Source code:
Demo clip:
Visual Design: The interface employs a pink background, establishing a lively and
captivating atmosphere for the user. This design decision improves the aesthetic
appeal while also preserving clarity.
Playlist Management: The design includes a section where users can see the playlist
while adding videos, providing instant feedback and interaction.
3
COMP-1752 Object Oriented Programming
Development stage:(Fig.2)
4
COMP-1752 Object Oriented Programming
5
COMP-1752 Object Oriented Programming
2. update_video.py:
Design stage:(Fig.3)
The GUI of the update_video.py is designed with a primary emphasis on simplicity
and user-friendliness, enabling users to efficiently update video ratings with minimal
exertion. The primary elements of the design comprise:
● User Interface (UI): An uncluttered and uncomplicated design, featuring
input boxes for the video number and the new rating. Labels provide
instructions to the user regarding the specific data to be entered.
● Visual Design: The layout employs a light blue background to establish a
serene and aesthetically pleasing experience, improving usability without
inundating the user.
● Error Handling: Although not explicitly demonstrated in the above code
snippet, the design will have error handling mechanisms to effectively handle
erroneous video numbers or ratings. This will enable the system to deliver
direct feedback to the user within the graphical user interface (GUI).
Development stage:(Fig.4)
● Establishing the Graphical User Interface (GUI) Framework:
The Tkinter library was selected due to its user-friendly nature and seamless
integration with Python, rendering it well-suited for the development of
uncomplicated desktop applications.
The initial configuration involved establishing a window with predetermined
dimensions and assigning it a user-friendly title.
● Generating input fields and labels:
The graphical user interface (GUI) consists of labels and entry widgets that
allow the user to input the video number and the new rating. The positioning
of these elements was achieved using the grid layout manager, which
guarantees a structured and organized interface.
● Implementing Update Logic:
6
COMP-1752 Object Oriented Programming
The central feature focuses on the modification of video data. Upon entering
the video number and new rating, the user can click the "Update" button to
initiate the system's validation of the information.
Subsequently, the system will engage with a video_library module in order to
execute the upgrade. By adopting a modular approach, the graphical user
interface (GUI) and the business logic are separated, resulting in a codebase
that is easier to maintain.
● Error handling: In the event that the user inputs erroneous data, such as a
non-existent video number or an inappropriate rating format, the system will
promptly display an error notice. This guarantees that the user is cognizant of
any problems and can rectify them swiftly.
● Software testing and debugging: The application underwent testing to verify
the proper functioning of all its components. The testing process involved
validating the input, verifying the update capability, and ensuring the GUI
responded accurately to different user inputs.
In order to validate the accuracy of this class, I conducted a set of unit tests via PyTest. The
tests encompassed several circumstances, such as correct initialization, incorrect inputs for
the name, director, rating, and the anticipated functionality of the stars() and play()
functions. Upon doing the tests, I have verified that all of them have been successfully
passed, thus confirming that the LibraryItem class functions as intended in both typical and
exceptional scenarios. By conducting comprehensive testing, I can confirm that the class is
capable of effectively managing different inputs and maintaining consistent functionality.
This establishes a strong basis for future development.
8
COMP-1752 Object Oriented Programming
9
COMP-1752 Object Oriented Programming
1 Type a valid Video "Video 'Video "Video 'Video 1' added Pass
number video Number: 01 1' added to to playlist"
playlist"
10
COMP-1752 Object Oriented Programming
Type Video
Status label: Status label: "Invalid
3 non-numeric Number: 01, Pass
"Invalid rating" rating"
rating Rating: abc
11
COMP-1752 Object Oriented Programming
3. Reflection:
12
COMP-1752 Object Oriented Programming
Appendix A:
Appendix B:
13