This week I implemented the part where P3 is responsible for pulling the latest project files from S3. This is suppose to be done when a project has expired in the cache and is about to be flushed to the user’s storage. Therefore, it is a last minute effort to ensure the project has its latest files before being uploaded back to the cloud storage. Fortunately, it wasn’t too difficult to add this simple change to P3’s caching mechanism.
Usually, no matter how small the change is, there is always a tendency for us software developers to unintentionally break some existing functionality in the application without even realizing it. Therefore, it is always important to have tests to back us up! If we did make some breaking changes, then the tests would tell us immediately. There should be no fear in making the changes nor be scared of introducing new bugs, for the tests are here to make software developers lives a little more convenient. The kind of tests I made for P3 at the moment comprises some unit tests, but its mostly the cURL test scripts which I had done earlier on in the project and throughout. I never realize how important testing is until you actually take on a sufficiently huge software project. Assignments in university is nothing compared to this. Its either the scope of the assignment is too small or you’re just too lazy to write any form of automated testing for them. Hence, all you computer science and engineering students should definitely apply for internship at least once in your degree to gain some valuable experience. You would definitely get some here in AESTE. 😁
Alright, so back to the topic at hand, after ensuring that my change didn’t break anything else, I had to test it out whether its actually working. What’s the best way to do this? Well, I decided to just do it out manually! This is best when you want to see the results firsthand, but continuously doing so later on would be very tedious, thus it eventually needs to be automated somehow. So the manual test starts from opening P3’s front end application, create a new project, double click on the project to open S3’s editor and make a simple Hello World program, close the editor once its autosaved, then close the front end application to trigger a manual flushing of the files in P3’s cache. And then, open the front end application again, double click on that same project, editor opens and see if the Hello World program I made earlier is there. Wow that was a mouthful, but yeah that’s how it was done. The Hello World program I made earlier was indeed there, which meant that the project files were successfully pulled from S3 before being flushed from the cache. Phew!
Apparently, Dr Shawn plans to give me another project soon, so I’ll just have to clean up as much as I can before then. The clean up process would definitely involve some refactoring, adding a few more tests if needed and ensure that everything I had done works at this point of time. For the front end interface, there are some things that I left hanging dry for too long. It is also still quite some distance from what it is intended to be, but I want to ensure that it is at least usable until the day I start working on the new potential project. I am actually kinda excited for the new project, as it would be different from what I’ve been doing so far here. The road ahead of me is still full of uncertainties and surprises, but whatever happens, I’ll welcome it with open arms. Come as you are!