You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fork or clone this repository into your own github account.
All your work will be done in your repository.
Inspect the code and understand what it's doing.
When going through the steps below,
create git commits, making a history of
changes that can be inspected later on.
At the end of the exercise you will have to push your code.
You can also push regularly before that if you want.
Steps
Both functions in the object_analysis module have a problem.
Write a test for each function that demonstrates the problem.
Fix the function and ensure the test passes.
Both functions' performance can be improved
for performance and readability
Describe how you would go about
increasing the performance.
How to increase the performance
Use Built-In Functions
Use Module Importing
Reduce the computation
What steps would you take?
Steps to increase the performance
Build in function such as max
Importing unittest module for test automation
Reducing calculation and reduce memory usage by using less for loop and logical condition
How do you determine what to improve?
Determine what to improve
Tidy up the code
Save time, labor, cost when doing testing by automation and unittest.
System perform respond faster because it use less memory and less computation needed
Try to increase the performance of both functions.
Use only built-in python modules and types,
don't bother trying to use external packages
or writing code in lower-level languages.
Try to improve the readibility of the functions.
The object_analysis module contains not only functions
but also some little examples/mini-tests.
Can you re-organise this?
The code has no comments nor descriptions. Add as appropriate.
Create a GitHub Action (or any other CI script)
that runs automatic tasks after each commit.
Add the tasks you think are relevant.