Category Archives: Week-14

More on Static Testing: Bug-Finding Tools

In my previous blog for CS-443, I discussed my experience revisiting the class activity about static testing tools. I focused on figuring out the Checkstyle tool, which makes sure that the code complies with a set of style guidelines specified in an xml file. However, the class activity dealt with more tools than just Checkstyle. Today, I would like to look at the second part of this activity, which deals with tools that detect actual bugs rather than simple style issues.

The bug-finding tools that the activity focuses on are FindBugs, SpotBugs, and PMD. Much like Checkstyle, these three tools are extremely easy to add to a Gradle project by adding a few new lines to the build.gradle file. They each require just a single line to apply them as a plugin for the project. In addition, a small block of text can be used to set different properties for each tool, such as their version number. The activity also recommended adding lines to the options for FindBugs and SpotBugs to report their findings in an html file, since they use an xml file by default. This made the errors much more readable and easier to understand. Finally, a single line must be added to the Dependencies for SpotBugs to function.

Once build.gradle is properly configured, the tools are run simply by building the project (or calling “gradle check,” as I discovered). All three tools will then analyze the code and create reports explaining the types of errors they find. I ran the tools on the code provided for the activity, and I was surprised by how useful their reports were. They point out code that follows bad practice, code that may cause compatibility issues on different platforms, and even code that may negatively impact performance. I find it interesting that these tools are able to detect such errors without running the code, and I definitely see them being extremely useful as I often do not detect such errors myself even after hours of searching for problems manually.

Since these tools are so effective at finding errors, I was curious if there was even any benefit to using manual code review over one of these tools. I did a bit of research into this, and I found a blog post on synopsis.com that I think makes a great point – that these tools are unable to understand the context of potential errors in the same way that a human can. The blog also lists eight major limitations of these tools that should be considered when using them over manual review. Although static testing tools are able to find error in code quickly and easily, it is still necessary for the developers to determine whether the errors detected are valid or useful.

Link to the blog:

https://www.synopsys.com/blogs/software-security/static-analysis-tools-finding-bugs/

From the blog CS@Worcester – Computer Science with Kyle Q by kylequad and used with permission of the author. All other rights reserved by the author.

Regression Testing

Article link: https://dzone.com/articles/what-is-regression-testing-and-why-is-it-important

Today I learned about regression testing from an excellent article on DZone and why it is an essential part of software testing. As the article explains, regression testing involves testing the whole software product to ensure that any changes to the code doesn’t break what was already working in the product or other parts of the software. The article then goes through a great example of how fixing a bug in one part of an example piece of software can unintentionally result in another (previously working) part of the system to stop working properly. The article demonstrates really well that this breakage can occur despite unit tests showing that the bug was fixed properly. This to me is an especially important point as it shows the value in using multiple methods of testing to ensure software is performing correctly. One criticism I do have of this article is that I wish they gave an example of how to implement regression (the article does include a link to a tool that performs regression testing) testing in an actual program (or in context of their previous example).

Although after reading this article, the concept of regression testing seems simple, I find it very important as both a software user and software developer. In my personal experience as a user I have seen everything from operating systems to video games release updates that caused features that worked fine previously to become buggy or stop working entirely. From the user perspective I know how frustrating this can be, so I am glad that I learned how to prevent this problem as a software developer. Regression testing is definitely something I now want to implement into my personal software projects. Now I need to look into the tools that can help do this.

From the blog CS@Worcester – Chris' Computer Science Blog by cradkowski and used with permission of the author. All other rights reserved by the author.

The Last Blog, Ultra Efficient Computers

For what may possibly be my last ever blog post on this blog, I found an article that discusses the possibility of Ultra-efficient computers using Atomic scale manufacturing. That sentence alone is enough to grab anyone’s attention (It certainly got mine.) After reading the introduction, I discovered that this article is about saving the environment rather than just having really fast computers. However, that’s still great because something needs to be done about the environment and this could be it. The article states that today’s computers require enough power to release more than 1 gigatonne of carbon emissions per year. That is actually really bad.  ACS Nano has a solution though. They are making computers that store more data, and use less power. You would think that this wouldn’t be possible without some kind of trade off, but they figured it out.

The attained this by manipulating singular atoms in order to produce “ultra dense memory arrays” which can store way more data in a smaller space. They have ran into an issue where bottleneck is apparent, so they are still trying to find a way to make this process more efficient. In order to conduct this process, scientists must use a technique called hydrogen lithography. This is a process in which they remove certain hydrogen atoms from a silicon surface in order to write more data. They demonstrated this technique on a 24-bit memory array, and the result was a 1000 times faster fabrication of atomic computers. This means that “real world” manufacturing can begin. According to ACS, this method would consume 100 times less power, making it a huge step in the right direction towards a cleaner Earth.

It was a pleasure reading this article considering it was very short and it had a lot of interesting information on it. I didn’t expect so many chemistry topics to be involved, but I love chemistry so that is okay. This will probably be my last blog post ever, so to my readers, you have been a great audience. Thank you.

https://www.sciencedaily.com/releases/2019/11/191127090225.htm

From the blog CS@Worcester – My Life in Comp Sci by Tyler Rego and used with permission of the author. All other rights reserved by the author.

FPL&S 5: Putting Things Together and Making it Pretty

By now, I’ve become rather accustomed to Typescript, Angular, and even CSS. Once the basic functionality of this project was working, motivation and momentum made it easy to continue adding more features. As evidence 14 out of 21 commits have been made in the past week, and although some are small it shows how easy adding features becomes when you have a good base built.

The database building and making sure it was in sync with file uploads was the most challenging part of this project so far. Two new services were created: one to handle all interactions with the database and another to provide information about the user that is currently logged in. Having Components communicate through a service decouples them from each other and the parent. The Components can simply subscribe to the data they need. This blog post was most helpful in determining the best approach for my needs, but Angular’s documentation filled in the blanks as needed.

An interesting bug I encountered was that uploading a new file overwrote all previous files. This was occurring because I was using the same reference to storage, but a new one is required for each upload. This was a simple solution, but puzzling at first. This was only noticed when I tried deleting a file: other files were still in the database and storage, but the link to all files returned a 404 error.

Then my least favorite part came: improving the UI. I love making things work, but making them flashy and fancy frankly seems like a waste of time, as long as it doesn’t detract from the user experience. Still, I quite enjoyed making it look nicer, despite some frustrations with CSS. The biggest issue I’ve had is CSS styles from outside components affecting the inner ones. I also wish browsers were more standardized. It has been difficult creating a consistent user experience across browsers, save for creating new elements from scratch. In the case of file uploads, for example, it is much simpler to hide the actual element and forward user clicks from a custom text input and browse button.

My last task will be to add some graphs to process information and display it to the user. This is of little use for the project as it stands, but will be incredibly useful for my Independent Study project next semester when I re-brand it. I have to give some credit to the Angular framework for making it easier, but using software engineering principles has allowed for an iterative project. I have a working project at every step with a much bigger end goal in mind.

There is still some polishing I’d like to do, and of course there could always be more features. This project was a great chance to dive into Angular and web development.

From the blog CS@Worcester – Inquiries and Queries by ausausdauer and used with permission of the author. All other rights reserved by the author.

Let’s Learn Some Concrete Skills

Hello, again my fellow readers!

This week we shall continue looking at Apprenticeship Patterns. I decided to skip over the Unleash Your Enthusiasm pattern and instead decided to talk about the Concrete Skills pattern this week instead.

The Concrete Skills pattern seeks to solve the problem of joining a team of craftsmen to further your learning opportunities. This could also be the all-important problem of getting a job. The problem keeps on going as you are too much of a risk as you may not be able to directly contribute anything to the team. You may not be able to even indirectly contribute.

The solution proposed is fairly self-explanatory. It’s right in the name of the pattern! Acquire concrete skills that allow you to demonstrate ability with relevant tools and technology. The pattern does suggest acquiring some skills that are geared more towards getting past HR and managers. I do like the proposed idea of “buzzword bingo” that the pattern mentions briefly. The rest of the concrete skills that you learn should be directed at showing your team that you are actually useful and that someone doesn’t need to look over your shoulder constantly to ensure you don’t mess up or break something. It goes on to make a good point. When faced with a hiring manager, they will ultimately be looking for someone who can actually contribute in some way on the first day. Having concrete skills is, as the pattern puts it, a way to meet them halfway. Then as you progress, you will have to rely on these concrete skills less and less. To learn what concrete skills to build, the pattern suggests looking at resumes of people whose skill you respect in the business. Identify some skills from the resume and work on them and of course, keep reviewing your own resume.

This is what drew me to talk about this pattern. It is directly relatable to me as I am in the job hunt as I am graduating soon. I found this entire pattern to be generally good advice for anyone in the software development field seeking a job. It also corroborates what a lot of people have given me advice for job hunting.

That’s all for this week. I wonder what pattern I will get to read about next?

Until next time readers!

 

From the blog CS@Worcester – Computer Science Discovery at WSU by mesitecsblog and used with permission of the author. All other rights reserved by the author.

“Retreat into Competence” Apprenticeship Pattern

I am writing this blog post about the “Retreat into Competence” apprenticeship pattern from the Apprenticeship Patterns book. To summarize the idea of this pattern, it is about handling being overwhelmed by new challenges. This is something I experience frequently, particularly because I actively search for new challenges and often find ones that are beyond my current ability. The recommended response is to go do something else that is more familiar instead. Succeeding at something familiar and reflecting on past success is comforting in the face of overwhelming ignorance. There are two definitions of the word “overwhelming” that I can imagine here, and the one that this chapter seems to be using is in an emotional sense. Recognizing one’s own incompetence is uncomfortable, so taking a moment to go back and successfully complete a familiar task feels better than struggling with an unfamiliar one. The other definition would be being overwhelmed in the sense of lacking the capacity to complete the given challenge. Retreating into competence is done for the sake of regaining confidence, and it is important to be able to handle being emotionally overwhelmed before trying to handle being academically overwhelmed. I have confidence in myself and my abilities, but when I am challenged by something new, I remain confident in what I know and recognize that it is a challenge because of what I do not know. I was doing a problem recently that required a certain background knowledge of combinatorial game theory that I did not have. Despite my aptitude for problem solving, my lack of education on the matter made the problem challenging (or overwhelming) to the extent that talent would not make up for inexperience. I saw it as a learning opportunity and started researching the information that I was not familiar with, and also did some easier problems instead that did not require a level of education I was lacking. Remaining in one’s own comfort zone is a good thing, but only briefly, as the chapter notes. It is taking a step backwards in order to prepare to continue moving forward and learning.

From the blog cs-wsu – klapointe blog by klapointe2 and used with permission of the author. All other rights reserved by the author.

Learn How You Fail

One of the many proverbs which I was raised on that I think about to this day when I am trying (and often struggling) to learn something new and master it, is “practice doesn’t make perfect; perfect practice makes perfect”. And while perfection is an impossible goal to set for oneself, the idea that it is important to analyze how you are practicing is instrumental in developing your skills.

This apprenticeship pattern “Learn How You Fail” speaks volumes to this idea. The main idea the authors are trying to impart is to not only accept that perfection is an impractical goal to strive towards, but to analyze and remember the qualities or areas that make you fail. By applying the practice of becoming aware of what you don’t know that you don’t know, my perspective and ultimate success will be much better for it.

Specifically, the authors make it a point to demonstrate this practice by suggesting to create an implementation of a common problem, in this case binary search, in a simple text editor. Once the problem is implemented we are to design tests and iterate the code until we believe it is perfect and only then can we compile and run the tests. The focus of this exercise is to illustrate that even when we think something is complete or as perfect as possible, there will be gaps in our knowledge that we are not aware of, and applying this practice will make you more familiar with the holes in our understanding, allowing us to get a better view of ourselves and our limitations, with the goal of overcoming them.

This apprenticeship pattern definitely spoke to me, because I am very interested with not only the concrete skills in software development, but also the process of learning and finding new ways to learn more efficiently. One quote from this section of the book which stuck with me because of its blunt honesty was “someone who has never failed at anything has either avoided pushing the boundaries of their abilities or has learned to overlook their own mistakes”. I will definitely be taking this lesson to heart and do my best to get as accurate of a self-assessment as possible, so I can practice honing my skills as perfectly as possible.

From the blog CS@Worcester – Bit by Bit by rdentremont58 and used with permission of the author. All other rights reserved by the author.

Apprenticeship Pattern – Nurture Your Passion

The apprenticeship pattern Nurture Your Passion refers to the problem in which you feel the environment in which you work in is stifling your passion for the craft. Depending on which aspect of work you feel is doing this there may be different solutions for everyone. For example, if you’re in a situation of constant project death marches that are sapping your time and energy, then you need to set clear boundaries and protect your passion. Whether that means to decline working “culturally pressured” overtime to avoid burning out or not would likely depend on how much you feel these death marches are affecting you.

As someone who hasn’t had much if any experience in the industry, this pattern definitely worries me a little. I’ve heard similar horror stories about project death marches from game developers working in the games industry. People who were filled with passion for their craft entering an industry that commonly abuses that passion with forced overtime until they burn out. Then, once you finish the project you’re working on, you’re laid off in an effort to cut costs by reducing headcount because you’re no longer needed, not because you’ve done anything wrong.

Obviously this isn’t the case with every company and the software development industry likely has many differences when compared to the games industry, but they do bear many similarities as well. This problem can be avoided by finding the right company that offers what you’re looking for, whether that be working overtime on something you believe in and enjoy, or somewhere that offers you good work-life balance. I’m always a little bit worried getting stuck in a situation with poor work-life balance because I’m not sure I would be confident enough to put my foot down, so I’ll have to remember in the future that I should focus on what’s best for me because I’m sure most companies wouldn’t think twice to cut costs whenever they can.

Overall, I agree with what the pattern’s saying and hopefully I’ll remember to nurture my passion even if it means getting passed over for promotions or having to find somewhere else to work.

From the blog CS@Worcester – Andy Pham by apham1 and used with permission of the author. All other rights reserved by the author.

Needing a reading list

So for this week, I have decided to read “Reading List”  pattern from the Apprentice Patterns by Adevele Oshineye and Dave Hoover. I chose this one because I believe there is something that should be done on a daily basis. Since that reading is exactly that, it should be wise to read this pattern at least once.

This pattern starts off with the context of having so much information that is needed to learn after developing the language. The problem is that the number of books to read is increasing than that of actual reading them ourselves. There is also the issue of figuring out where to start from the number of books. To solve this issue, one must maintain a reading list that not only helps in remembering the books read but also track the books that are planned to be read. Creating a text file is an option to write the list down as it is under source control and simplest implication of the pattern. For what it is worth, there is a need for a clear understanding of which books to prioritize in reading and in order by the subject.

From this pattern, what I found useful is identifying the books that would be worth reading based on a list given by any book. This will help in finding hidden connections related to the topic or language to an extent.  Mentors may recommend must-read books that even peers can discuss with one other and advise with the aspects. With data gathering over the years, patterns, gaps, and trends is starting to be seen. This pattern has changed my mind in giving suggestions to other people in what to read. I don’t disagree with anything since it does give clarification in what to do with the knowledge gained thus far and all the books needed to be read in due time.

Based on the content of this pattern, I would say this is a great and simple read as a way in reflecting on a reading habit. This pattern has helped me understand in which to read first for what topic I could have next. For future practice, I will try to write a reading list in different ways beside a text file in case anything happens to that specific device.

Link to the blog: https://www.oreilly.com/library/view/apprenticeship-patterns/9780596806842/ch06.html#reading_list

From the blog CS@Worcester – Onwards to becoming an expert developer by dtran365 and used with permission of the author. All other rights reserved by the author.

Apprenticeship Patterns: Use the Source

This week, I’m reflecting on the Use the Source pattern from Chapter 5: Perpetual Learning. We all know the best way to gain expertise in programming is to actually program. However, it’s tough to know what tools are the best ones to learn from. This pattern suggests learning concepts by viewing the works of others — you’ll pick up on tips and tricks and can directly understand how to solve difficult problems if you learn from material from those who are great at solving problems. Even if the work you read isn’t from master software craftsman — just reading code vastly improves your ability to utilize code in your future.

I like this pattern a lot for a few reasons. I have always been timid about contributing to open source projects due to a lack of feeling comfort with handling others’ code. However, recently I started looking at a few open source projects and felt as though I could really contribute to the projects if I wanted to. I get the sense that this comfort has come from me handling and reading code more regularly on a daily basis. Another reason I enjoyed this pattern was reassurance. I’m starting in a Software Engineering position at Stratus Technologies in a month and a half’s time. I’m feeling extremely fortunate that I got hired, and I also know that I have a tremendous amount to learn — both when start the job (about the code they have in place) and beforehand. Their codebase is vast and complex, and in order to be an effective team member, I’m going to need to get used to dealing with large, multilayered, and complex systems.

In the arts, there’s a learning concept where the artist does “Master Studies”. Essentially, the idea is to choose a piece of art from a great artist and try to recreate it from scratch, by using the work as reference. This puts the artist’s skills to the test, but it gives them a framework to work within. I see this pattern and the concept of “Master Studies” as related, in a way. By examining the work of those who have made a name for themselves in the field, we get insight into how their mind works. There are many brilliant “Master” engineers out there, and they’ve written a tremendous amount of code that I can conduct my own “master studies” of. It’s like reading great literature — it will impact your work for the rest of your career.

From the blog CS@Worcester – James Blash by jwblash and used with permission of the author. All other rights reserved by the author.