Category Archives: #CS

Git

Version control is a vital component of modern software design and git is the most popular version control system. Git is essential. It allows you to safely experiment, track changes, and it creates an organized workflow for something that can become chaotic fast. In this blog post, I will be going over some Git basics and some practical uses of git.

Git tracks changes in your code. This allows you to be able to go back to any version of your code and restore it if need be. This also allows you to see who’s done what work. this can help keep people accountable. Multiple people are also able to work at the same time without overwriting each other’s work. This makes collaboration much easier. Branching and merging allow anyone to be able to work with anyone whether they are in the same room or across the globe. Git also can allow you to experiment with your code. Branches allow you to manipulate and test code, without touching the source main code.

Basic git commands

Saving in git is called committing. If you commit you save the current state of all your files and folders. you would use git commit -m “message” This message should be a description of the changes made in this commit.

git clone is used to clone your current repository

git add is going to tell git that I would like to add this file as one to track the next time I make a commit.

Using the git add and git commit commands in conjunction allows you to only save/commit specific files.

Git status will tell you what is currently happening in your repository. You use this to help find where you are in git.

Git push sends the changes made up to Git Hub. This compresses all the information and sends it up to Git Hub.

git pull is the opposite of git pull. This allows you to bring the latest version of the project to your workspace.

Forking allows you to create a copy of someone else’s repository onto your own account.

Merge conflicts: this happens when changes coming from different locations conflict.

The Video I used as a source Is an amazing resource. It takes all the basic concepts of git and boils it down in a very simple and effective manner. It also shows examples of everything being used and talked about in a practical setting. I am a visual learner so I found this extremely helpful. The video is 50 minutes long, but if you are able to, you can watch this in 25 minutes at 2x speed with captions. I recommend anyone who is interested in git to watch this video. Even if you are experienced, it is an amazing refresher and I will be using it to study git concepts for this class alongside our material. I watched this video before attempting a git-related homework assignment and it felt like I was using git differently. I felt confident when using the commands. Before there was much more trial and error and I second-guessed myself a lot. Although the resource I chose doesn’t have much new information, I found it extremely helpful and encouraged anyone taking software processes management to check out this video.

Referance: https://www.youtube.com/watch?v=NcoBAfJ6l2Q&t=15s

tags: Week-14 , CS@Worcester, CS-343

From the blog CS@Worcester – SPM blog by Aaron Nano and used with permission of the author. All other rights reserved by the author.

Clean Code: The Foundation to Readable Organized Code

As I look back at my older projects and code, the lack of organization and structure is missing. I’m thankful for my detailed comments, because that code would have taken much longer to read. In our course, we went over the principles and practices associated with writing and abiding by “clean code” strategies. To deeper my knowledge on this matter I ended up finding an article called “How to Write Clean Code – Tips and Best Practices(Full Handbook),” by German Cocca. I trust this resource, it comes from freeCodeCamp. I have used this website in the past and I think it is a very useful source of free information. I also trust the author because he is a full stack developer. This comes from his own blog.

This article states clean code is more than just code that can run and function. Clean code should be very easy to read, understand, maintain overtime, and breakdown. His pilers of clean code are effectiveness, efficiency and simplicity. While the focus of codding should always be the functionality of the code, this should also be done so wile optimizing resource usage and while maintaining clarity.

The most important information I took from learning about clean code in the class room, was the idea that If you have to comment code, you didn’t write it clear or efficient enough. This also goes with functions, functions should be kept as small as possible. This kind of thinking helped me step back and re-evaluate my codding approach. Because of this I feel i write more readable efficient code now.

This article also goes over a very important idea that had a similar effect on my codding as the last. This is the idea of SRP or single respnibility principle. This means every clas or module should onley have one job. If you need to validate orders, calculate a total, save data,these should all be done in their own separate methods classes or functions. This makes the code much more readable and it makes implementing these functions easier.

So far these concepts have also ben dissgussed or touched upon in my class, The concept of modularization was not. This involves breaking down complex code into much smaller pieces. This makes the code easier to test and understand. This allows you to test maintain and read the code all more efficiently. Folder structure was also not talked about in my class. Folder structure is crucial for keeping a clean scalable codebase. The structure should keep related files together based on their functionality. For example instead of organising by filetype, you would organise by feature types. If every feature has its own place, it will be easier to go back and modify it.

I enjoyed looking into this site because It layed everything out in a nice organised manor. It explained everything briefly enough to maintain my interest, but was indepth enough where I was getting the information and knowledge I needed. This website also provided nice code  examples for everything it mentions. 

Reference:

https://www.freecodecamp.org/news/how-to-write-clean-code/ – How to Write Clean Code – Tips and Best Practices(Full Handbook) by German Cocca

Tags: CS@Worcester, CS-343, Week-11

From the blog CS@Worcester – SPM blog by Aaron Nano and used with permission of the author. All other rights reserved by the author.

Mastering Automates Testing with Selenium and Java

In the ever evolving world of software development, automated testing has become indispensable. Using tools like Selenium combined with Java, developers can automate their web application testing, improving efficiency and accuracy. This blog post delves into the key takeaways from a helpful Sauce Labs article (https://saucelabs.com/resources/blog/writing-tests-using-selenium-and-java) that outlines how to write testes using Selenium and Java, exploring its relevance to our coursework on software testing methodologies

Summary of the Resource:

The Sauce labs article provides a comprehensive guide on writing automates tests using Selenium, a popular tool for web application testing, and Java, one of the most used programming languages. It covers the basics of setting up Selenium with Java, crafting test scripts, running tests, and interpreting the results. The article emphasizes the importance of Selenium for its ability to simulate user interactions with web elements, which is crucial for verifying the functional integrity and performance of web applications. It also touches on integrating these tests into a CI/CD pipeline, demonstrating how automated testing fits into broader software development practices.

Reason for selection:

I selected this article because it offered a practical introduction to an essential skill in software development. As our course covers various testing frameworks and tools, understanding how to implement and utilize these tools in real-world scenarios is crucial. The articles focus on Selenium with Java is particularly relevant, as many of us are familiar with Java and may soon need to apply these skills in internships or jobs.

Personal Reflection.

The article made me appreciate the power and necessity of automates testing in modern web development. It was enlightening to see how Selenium scripts could mimic actual behavior, such as clicking buttons or entering data, which is critical for testing user interfaces. Reflecting on this, I see the immense value in learning automates testing not only to boost my future job prospects but also to ensure that I can contribute to creating robust, user-friendly software.

Application in future practice:

Armed with the knowledge from this article, I am eager to apply these testing techniques in my upcoming projects. Whether it’s for class assignments or eventually in a professional setting, understanding how to set up, write, and deploy automates tests using Selenium and java will significantly enhance the quality of the software I develop and maintain.

Conclusion:

Automated testing is a key component of software quality assurance. The insights provided by the Sauce Labs article on using Selenium and Java for testing offer both foundational knowledge and practical steps for anyone looking to enhance their testing skills. As software becomes increasingly more complex, the ability to efficiently test and validate software functionality becomes even more critical, making these skills invaluable for any aspiring software developer.

From the blog CS@Worcester – Josies Notes by josielrivas and used with permission of the author. All other rights reserved by the author.

Josie’s Notes Introduction

So I guess I have to start blogging now. I never really thought I would be doing this but here I am. This Blog is starting out because of my class CS-348 Software Management Process but who knows where this will go, Anyways that is all I have today… Ciao Ciao

From the blog CS@Worcester – Josies Notes by josielrivas and used with permission of the author. All other rights reserved by the author.

Sprint Review #3

This sprint was the worst one for me. The team did great job, it’s just I, who did not did much job in this sprint. This sprint/weeks of this semester was a roller roaster for me. So many projects to do, presentations, assignments, essays. Every professor was pushing their assignments. I learned a valuable lesson this past weeks and it was a “stick with one capstone my friend”. I took two capstones as I liked both software developing and data analysis. It is not that, I liked one capstone and dislike another one, it is because of the amount of work. I think it is okay to take two capstones if you are taking only 2-3 classes so that you can only focus on capstone classes but a semester with 5 classes, 4 of them are CS courses and each classes having final projects was a hell for me.

As for the sprint, I did not do much work than just cleaning up some code. You can find the commit here. In the console of the browser, there was an warning saying the request to HTTP request may not success every time. So I simply added a try catch to get rid of that annoying warning. So now if we make a bad request to HTTP then the code will console log an error. Another reason I added try catch is that, suppose we were to use this program in real life or real POS or anywhere where this application will be running and if there is a bad request then the application will crash. And nobody would want to restart the application every time. With try catch, the application will console log the error and keep running. That is all I did for the sprint. I did not put much work to the team and I wanted to do more but with tight schedules, I wasn’t able to do much. There was able another error with my device, the docker image kept failing for my MAC while it worked for the other devices of my team mates who had windows. I had that issue until my scrum master told me to add a timeout in the docker file which did fix the issue but then it was pretty late. It was my fault for not talking about it in meeting or in discord group chat. I was responsible for getting in touch with another group about key-cloak but I never had time to.

Final thoughts: Front-end wouldn’t have been success without Michale Friederich. He did all the integration between back-end and front-end. If I were to do that then it would take me longer. So hats off to him. Everyone in the group did an amazing job throughout the semester. I have read everyone’s sprint review blog and they are putting in the work more than me. If it were to be different team mates then I don’t think we would have finish this much of work at the end of the semester as everything was new to us. Everyone in my group had a great vision of what the project should look like at the end and we delivered it about 95% of finished application. The next group who will take over after us will just have to clean up the code, connect with key-cloak etc but it will not be as messy as it was when we first received the application as we had to reformat everything. Overall, I was paired with talented developers and I am glad I paired with them. Happy Coding!

From the blog cs@worcester – Dream to Reality by tamusandesh99 and used with permission of the author. All other rights reserved by the author.

The Deep End

For this week’s pattern, I decided to go with the deep end. The last pattern I wrote was about rubbing elbows and that pattern was all about how you have reached your plateau of your skills and how to get out of it, while this pattern “the deep end” is the other side of that plateau where you begin to fear that this isn’t a plateau but a rut. On a plateau, you consolidate your skills through diligent practice in order to attain the next level while in a rut, your bland competence eventually decays into mediocrity.

The problem is that you need to grow your skills, your confidence, and the portfolio of successful work. Talking about successful work, when I sent my resume to a mentor/friend to review and ask them for their opinion about how my resume is, he said my resume will not get me anywhere. I had decent projects such as discord bot, android app, website, etc. I thought this much project was enough to set my foot into IT field, but my friend asked me one question which left me speechless, “the projects you built, how has this helped you or anyone else?”. At that moment, I realized that I have just been wasting my time. My projects have done nothing. It was solely built for my own interest, and it had no impact to anyone or not even myself. It didn’t have any positive results where it catches recruiter’s eye. I began to think that I need to challenge myself with bigger things, bigger projects, larger teams, more complex tasks.

The actions are to ask yourself a question such as what is the biggest successful project you have eve worked on in terms of lines of code and number of developers. What is the biggest codebase you have ever built on your own?. The answers to these question will show you other dimensions of project complexity and other ways of measuring your projects. Use this metrics to measure every project you have ever been involved in and draw a chart. After a while, you will be able to use this chart to track down where your career is heading and even start to make choices based on the chart.

From the blog cs@worcester – Dream to Reality by tamusandesh99 and used with permission of the author. All other rights reserved by the author.

Sprint Retrospective 2

By this sprint, everyone had an idea of what they were doing and what needed to be done. So everyone was on track with required workflow. In this sprint, people started to add issues of their own. I should have added issues I found in this project, but I just discussed with the team members, and they added it. Overall, for this sprint, I have a mixed feeling about it. I felt as if I didn’t do much help to the team, but at the same time I felt like I gave my all to the team. I did solve a couple issues during this sprint.

The first issue I solved was simple enough that I forgot to add it to the project issue board. Logically, it made sense to fix this issue so that the form doesn’t become annoying to the user. Imagine clicking on the input field every time the form loaded. So guest 1 comes and swipes, guest 2 comes then you have to click on the input field, guest 3 comes click again. Doing that over and over again would have been exhausting. I didn’t really notice this issue until I tested the code with card reader. At first, I thought I had to write some method so that the text would automatically focus on the input field. I was lost and had no idea about how to make it work. At the end, I felt really stupid because the solution was simple, and I was overthinking it. The solution was in the HTML input attribute type. All I had to add was “autofill” in the input attribute. Refer to this commit. Here

For the second issue I fixed, it really took the best of me and my time. My goal was to on a click of a button which is in one of the child component in Vue, I had to get the data from localhost, store it as an object then pass it to another child component so that those data would automatically fill the form. Sounds simple and easy. But the thing is, you cannot pass data from one child component to another. So the process was to get data from one child component, pass it to parent component using emit and then pass that data to another child component from parent component using props. Michale had already passed the data from component to component and I thought it would be relatively be the same. I couldn’t be any more wrong. I did everything same as Michale and everything worked as we wanted. Since our API was not fully done, I tested my method using Jsonplaceholder and sent the data to another component. I put the Jsonplaceholder’s ID number as a zip code, and it displayed as I wanted it to be. The major problem was that I was using options:Lifecycle that would assign the data before the form loads, which leads to not being able to edit the form data. Removing the lifecycle and just mounting it to v-model worked, but it rendered the first child component twice in the same page. Other than that, everything was working. I was able to get the data, pass to the form and edit then submit the edited data. I am not really sure how this worked, but to fix the issue of rendering the component twice, I hid the first component when the submit button is clicked. After that, everything worked as we wanted. Refer to this commit for code details. here

On to the third issue, when swiping the card, the input field only picked up the correct ID on the first swipe only. This issue was taken by another teammate, but since he wasn’t able to complete it, I took it from there. After a couple of hours of debugging, I was left with nothing. I understood the code the previous developers left, but I wasn’t sure why the issue was as it is. I started to think that if it worked on first swipe, let’s make every swipe as first one. So the solution was simple. Refer to this commit on line 93. here

This Sprint showed who is really dedicated to the project, who is really passionate to the software developing. It seemed as everyone was giving their 100% effort to the project and were all liking the process. I don’t have a single doubt that we won’t be able to finish this by the end.

From the blog cs@worcester – Dream to Reality by tamusandesh99 and used with permission of the author. All other rights reserved by the author.

Rubbing Elbows

The context of this pattern is that although there are many people teaching you about coding, when it comes to actually developing software, it will be all in your hands. However, the problem is that your productivity has reached a plateau. One of the solution for this is to pair up with another software developer and accomplish a hands-on task together, side by side. Of course, it will be much better if the developer is better than you or has more experience. While pair programming can be an excellent technique for learning, it is a complex activity and is not always an inherently positive experience. However, when used effectively, it is one of the most powerful ways to learn, particularly from mentors. But how do we know that we are improving when pair programming? One of the way to know is that you will feel lost or behind with all the work/knowledge. At first, it feels like you are failing, but it isn’t always the case. It simply means you need to either slow thing down by asking questions, or endure the feeling of being lost and try to pick up the bits that you do understand. The action part of this pattern is to find an open source project to work with your pair programmer. Spend some time working on it each week together on the project. If you lose motivation for a long time, then it is time to change your partner.

When it comes to pair programming, I have done nothing but leetcode together with a programmer for like a week or so. Although I have never done pair programming for a long time, I do always surround myself with better developers than me. But that does not mean it breaks my plateau. I do learn new things here and there, but I have not actually done a project with that knowledge. Now comparing to our capstone project, I am learning new things with this group and project. All the programmer in my team seems they are better than me, so while I am doing my part of the issue for the project, I am also learning what the others did and how it connects with my issue. The problem with me is that I lack to have a vision of a finished project, but with this team and this project I can clearly see what our finished project will be at the end.

From the blog cs@worcester – Dream to Reality by tamusandesh99 and used with permission of the author. All other rights reserved by the author.

Learn How You Fail

The context of this pattern is that you cannot avoid failure. If you never failed, then that means you either avoided pushing at the boundaries of your abilities or has learned to overlook your own mistakes. The problem is that even though your learning skills have improved, your failures and weakness still remains the same. The solution is as follows, seek to identify the way in which you tend to fail and try to resolve them. Accept that there will be some things that you are not good at, or that would require a disproportionate investment of time and effort in order to make a small improvement.

Now for the action part, this is what I liked the most about the pattern. In the programming language of your choice, use a simple text editor to write an implementation of binary search in one sitting. Do not compile or run it. Write all the tests that you think are needed to verify your code you just implemented. Now, go back and re-read your code and find all the errors you think you made, keep doing that until you are satisfied with the code. Make sure you give in your 100% knowledge to it. Then, finally, try to compile and run it. Before you fix all the errors, look over them and try to understand how you could have avoided such error in the first place.

For me, this pattern was really helpful. I wish I had known about this pattern when I was taking a data structure and algorithm analysis class because I really had rough in those classes. I should have done this action part for all the topics in those classes. Such as, post order tree or pre-order tree from data structures or Dijkstra’s algorithm and divide and conquer from algorithm analysis class. I have been bad at so many stuffs now that if I do something wrong, it does not even faze me anymore. But one thing I did that I’m proud of is that, whatever I failed at doing, at the end I made sure I know how to do it the correct way. What I need to work on is to practice by implementing code in a simple text editor without any error warnings.

From the blog cs@worcester – Dream to Reality by tamusandesh99 and used with permission of the author. All other rights reserved by the author.

Sweep the Floor

The context of this pattern is that you are a new apprentice on a project. However, the problem is that you don’t know what your role is in this team. You don’t know how to contribute to the team and help them in any way necessary. The solution is to volunteer for simple, unglamorous, yet necessary tasks for the team. This way, you can earn team member’s trust, and you also get to show the team members how quality of work you can do. The tasks may be such as maintaining the build system, production support, responding to maintenance requests, bug fixing code review etc. The tasks can be anything, but it cannot have any high risks. Starting a core tasks and failing puts you into a bad side of a team, so it is better to start off with an easy tasks and actually finish it to have good relationship with everyone on the team. These short takes benefits the team, but it will also benefit your apprentice because such chores are often skipped in academic courses and by doing them you can fill in the gaps in your knowledge. After all, if no one sweeps the floor, then the glamorous work can’t be done because the team is hip-deep in dirt.

This pattern kind of reminded me of our group for the capstone project. When we first formed the group, I was assigned to the frontend part of the project. I was ready to do the first task from the GitLab issue board, but my main question was how can I convince the team that I can do this project together with the team and can actually make some contribution. In this computer science major, I feel as if I am always a step behind from everyone and have to add in extra effort to be on the same level as everyone else. So to show my skill, my first task was to connect two components and load one component only on click, which in my opinion is not an easy task but also not a hard task and I think I managed to do that, and the team seemed to love the way it turned out to be.

From the blog cs@worcester – Dream to Reality by tamusandesh99 and used with permission of the author. All other rights reserved by the author.