Author Archives: Michael Mendes

Apprenticeship Patterns: How to Practice

Practicing is yet another aspect of software development that I have had issues with in the past. Personally, I find that whenever I bring myself to start some personal project with the goal being to practice programming I find that I simply have too much to do or what I am practicing feels too tailored to this specific practice program. Now that I am coming to the foreseeable end of my time in school, where these practice opportunities are essentially the focus, this issue has been weighing on my mind more and more. Thus, for this post chose to focus on the practice, practice, practice pattern.


Yet again I found myself really enjoying these patterns, as they felt very relatable. This was another insightful read, as I really did not have a set way to effectively practice in mind. I really enjoy the idea of katas that was brought up, which are simpler, but still somewhat challenging, exercises you repeat to try and hone a certain skill. In the case of programming, this can come in the form of working through some older books, as stated in the pattern. The idea of dodjos for programming also sounded enticing, as one issue I found with practicing on my own is a lack of feedback on what I produce. Solo practice is still effective to some extent, but I often find myself wondering if what I am doing is an effective way of solving the problem, or if anyone has devised a better one. This is the exact problem that a dojo addresses and is something I might have to take advantage of in the future!

This pattern has not really changed the way I view software development, at least in terms of practice. This is because I did not have a clear view of how to practice effectively in the first place. I have now been provided this new way of approaching practice that sounds both more engaging and effective than anything I could devise. I now understand that my practice session must involve short, challenging exercises and I must use others as a resource to compare my results and, ultimately, learn. I don’t really have much to disagree with but I did decide that I probably would not use those extremely old books for practice. As exciting as it would be to understand that older knowledge, I have more immediate things to learn.

Source: https://www.oreilly.com/library/view/apprenticeship-patterns/9780596806842/ch05s02.html

From the blog CS@Worcester – My Bizarre Coding Adventures by Michael Mendes and used with permission of the author. All other rights reserved by the author.

Apprenticeship Patterns: Motivation

For this first blog post I chose a pattern that focuses on something I have struggled with on and off almost every semester, this being motivation. I am usually very gung-ho when beginning any sort of programming class, or personal project, but eventually I find that I just get completely buried. This can be for a variety of reasons, being other schoolwork or simply getting lost trying to solve increasingly more complex issues, but it happens consistently enough to be concerning. After reading this however, I do have some ideas for ways to try and cope with this should, or more accurately when, I get stuck in this rut once again.


Personally, I found this pattern to be very helpful, as it resonated quite well with me. I have been getting frustrated with a lot of my recent work, as it is all in relatively new languages I only have a vague grasp on, but I now realize what these are. As stated in the pattern, you have to set aside what you are comfortable with in order to grow, and these states of remaining in your comfort zone are classified as Golden Locks. I just have to understand that a part of the journey to becoming a master in this craft is resisting the urge to remain where I am, in terms of my knowledge. Beyond this, all of the examples used in the pattern felt very relevant and did a sufficient job at helping me relate to what the author was trying to convey.

I would certainly like to say that this pattern will have some effect on the way I think about software engineering. I have realized and acknowledge my issue with my motivation, being that I am simply on the road to mastery and must keep in mind that everything I am struggling through is just a part of that process. I cannot just retreat back into only really caring about Java, I have to continue working with these new languages as I encounter opportunities to learn them, otherwise my career, and most likely my passion, will stagnate. Maybe this is due to a lack of experience, but I did not find myself disagreeing with anything said in this pattern really, it was a good read!

Source

https://www.oreilly.com/library/view/apprenticeship-patterns/9780596806842/ch03s03.html

From the blog CS@Worcester – My Bizarre Coding Adventures by Michael Mendes and used with permission of the author. All other rights reserved by the author.

Unit Testing: Principles of Good Tests

This week’s post is yet again about unit testing, but this time focuses on a much more broad question. After spending the past two posts trying to determine exactly what unit test and the variety of patterns available it is only natural that this next post focuses on how to write the tests well. As someone who personally has not written many, I can acknowledge that there may be some best practices I am not aware. Thus for this week’s post I am going to discuss another blog post, this one by Sergey Kolodiy, that goes into how to write a good unit test.


So how do you write a good unit test? Conveniently enough Sergey has compiled some principles, which are that the tests be easy to write, readable, reliable, fast, and truly unit, not integration. Easy to write and readable are pretty straightforward, and go hand in hand, as both just mean the tests should be easy to implement to cover lots of different cases and the output of the tests should easily identify problems. As for being reliable this means the tests must be giving the correct output, in addition to actually detecting bugs rather than just passing. Sergey also brings up a good reason for keeping the tests fast, being that lazy developers might skip the tests if they take too long. Finally there is the truly unit, not integration principle, which sounds more complex than it is. This simply means that the unit test and system should not access any external data or resources, such as a database or network, which will ensure that the code itself is working. Sergey chooses to focus on another very important part of writing good unit tests after this.

The rest of this blog revolves around discussing writing testable code as a good unit testing principle. He states a plethora of examples to show some bad practices, such as using non-deterministic factors. To clarify, this means some variable in a method that can have different values every time it is run; the example he uses helps  put this into perspective more effectively. The original purpose of this post was simply to discuss writing the tests themselves, so I do not want to stray too much. I just wanted to mention this part, as it is interesting! If you want to learn more check out the link below.

Source:

https://www.toptal.com/qa/how-to-write-testable-code-and-why-it-matters

From the blog CS@Worcester – My Bizarre Coding Adventures by Michael Mendes and used with permission of the author. All other rights reserved by the author.

Unit Testing: What Types to Use

Now that we have a good base understanding of unit tests we can dive a little deeper into the subject. When reading through the previous blog I saw mentions of different types of unit tests and my interest was piqued. From past examples I had seen, I assumed all of these tests followed the same format. Thus for this week’s post I wanted to discuss the different types of unit tests, as I only just learned that there were multiple. To aid in this I found a blog post from a programmer named Jonathan Turner who clarifies what each type is.


This blog post identifies three major types of unit tests, these being arrange-act-assert, one act, many assertions and finally test cases. The arrange-act-assert format is the more traditional method of unit testing and the one that most people are probably familiar with. This format involves setting up the conditions for the test, running the code with the test conditions, and subsequently examining the results of the test. As for the one act, many assertions pattern it uses the same basic setup as the previous pattern, but differs in having multiple assertions about the code at the end of the test. Finally there is the test cases patterns, which takes a different approach than the other two by using a collection of many inputs to check their respective outputs. Now that we understand what each of these patterns are we can discuss their advantages.

Each of these tests have their own use cases where they will be most efficient. The arrange-act-assert pattern is the traditional method and, thus, the most straightforward to implement. This pattern should mostly be used for testing specific conditions or situations of a certain system. The one act, many assertions pattern is best used when you have code that has different sections that each act independent of each other. To clarify, use this if testing a method that has multiple blocks of code that do not affect each other, but must each be validated. Finally, the test cases method is very advantageous if you have a program that has a wide span of input output values. This could be one implementing an algorithm that converts values; the blog post gives a very good example. I hope that this post gave you a glimpse into the variety of unit tests available and would recommend checking out the blog post by Jonathan Turner for further information.

Source:

https://www.pluralsight.com/tech-blog/different-types-of-unit-tests/

From the blog CS@Worcester – My Bizarre Coding Adventures by Michael Mendes and used with permission of the author. All other rights reserved by the author.

Unit Testing: What and Why

For this class I felt the most fitting first post was one that explained what unit testing is, as this will be key for understanding more complicated topics further on in the semester. I have only had brief experiences with unit tests in the past, usually being included in code I had from a professor. Thus this is still a relatively foreign concept to myself, granted the general purpose is pretty self explanatory. To tackle this subject I found a blog post that goes sufficiently in depth about this topic, explaining what it is and why it’s useful.


So first things first, what exactly is unit testing? As it’s defined in the post on the testingxperts.com blog, this is a testing type done in the earlier stages of the software. This is advantageous as it allows testers and developers to isolate specific modules for any necessary fixes, rather than having to deal with the whole system. Unit tests usually consist of three phases which are arrange, act, and assert. The arrange phase involves implementing the part of the program that is to be tested in your testing environment. The act phase is where you define the test’s stimuli, what could or could not break the function. Finally there is the assert phase, where the behavior of the program is observed for any potential abnormalities. So now that we have a common understanding of these tests, we can ask ourselves why we should even bother using them.

Admittedly, on the few past occasions I had seen these, I thought the unit tests were mostly superfluous and not very useful. In reality however, these tests can be an invaluable asset for larger systems and can save a lot of time and pain from trying to bugfix further into development if used properly. The primary, and pretty major benefit, is that components of a program are tested early on in the process and individually. This is great for the immediately obvious reason, being that you do not have to worry about progress halting further on in the project because you are testing long before then. Besides this, it also helps the development teams understand the code better, as the tests must be tailored to the specific component they are working on. This familiarity can have other benefits as well, allowing certain members knowledge of how code in some components can be changed or reused for further benefits. Then there is also the fact that this debugging process is simpler than a more traditional approach, as it is done before some of the more complex code is written to interconnect components. These are the major reasons listed in the article, and that I could deduce, but there could very well be more! I do not quite have enough space to discuss the rest, but I would recommend reading the rest of the article if you have any interest in unit testing as it goes into further detail.

Thanks for reading!


Source:

From the blog CS@Worcester – My Bizarre Coding Adventures by Michael Mendes and used with permission of the author. All other rights reserved by the author.

Sprint 1: Retrospective

If anything can be said about this sprint, it is that a lot was learned throughout. I was familiar with how the teams would work, but many of the day-to-day specifics and exact deliverables were a bit unclear to me. Before this class I had only really examined this sort of team structure in CS-348, and that more theoretical practice left me in the dark on some of the specific aspects. To specify, the issue board for our team was not utilized to its full potential in a few different ways. However despite these issues we were able to complete all issues on the board. First I will discuss exactly what worked well, and subsequently what did not.


Regardless of what could have been improved, which will be discussed, this was overall a successful sprint. Each team member did, at the minimum, read through the material they were assigned and documented any relevant information in the wiki. So by definition this was a successful sprint, but it’s true value for us was what we learned for the next sprint in my opinion. One part that could have been worked on were the actual issues themselves. These could have been streamlined a bit, as we simply decided to read through all of the documentation because it was the most logical thing to do. However the documentation often contained much superfluous information that may not really end up  being useful. It felt as though this was mostly being done to meet our SCRUM goals. Besides this, it was still difficult to communicate all of this information with each other. Throughout the sprint we also forgot to move issues through the board as we worked on them, and I personally did extraneous work that could have qualified as a new issue but did not think to create one for them. After all of these issues however, there are some changes that can be made for this next sprint.

This first sprint was an extremely valuable learning experience as previously stated. There are a few ways that our community of practice could improve the effectiveness of our teamwork. One idea that was brought up was to simply communicate more often using the community of practice channels. This will allow us to simply have one location containing all information we may need, and allow us to be on a similar page with each other. To further improve this, we also discussed having small work sessions in the community of practice from time to time to ensure none in the group are behind. This would also allow us to have more consistency in the method that we use to connect our respective systems to Keycloak further down the line. As for myself personally, my major flaw was simply getting behind on my work. If I am being honest, I had to do much more reading towards the end of the sprint than should have been necessary. To improve on this, I have set aside specific time frames during the week to work on projects. I will also try to share any more useful information in the project-wide community of practice, as I have a tendency to just share information in my team’s text channel only. I am excited to put all of the changes into play for this next sprint!

From the blog CS@Worcester – My Bizarre Coding Adventures by Michael Mendes and used with permission of the author. All other rights reserved by the author.

An Introduction to Apprenticeship Patterns


For this blog post I will be discussing the entirety of the first chapter, and introductions to all other chapters of, Apprenticeship Patterns: Guidance for the Aspiring Software Craftsman by Dave Hooper and Adewale Oshineye. As someone who is at the cusp of being released into the larger professional world, this book appears to be a useful resource. To clarify, I have been thinking about my future career as of late, and how exactly I can advance my own learning past what I do in class. Personally I have found this to be challenging, often finding myself having grand designs going into a personal project or online training program, but ultimately hitting a wall that abruptly kills progress. Within the first chapter of Apprenticeship Patterns, these troubles are acknowledged and addressed through establishing and discussing methods to approach learning new skills, these being the titular patterns. 

There were a few sections that I found particularly interesting. To specify, this section in the intro that redefines the definitions for apprentice, journeyman, and master was something I did not expect to find. I did not really ever put thought into redefining those terms to fit their more modernized roles. Additionally I enjoyed reading the introductions to chapters two and five. When learning new languages I feel as though I am always trying to program in as though I am using Java, as it is simply what I have always been comfortable with. I feel like this idea of “Emptying Your Cup” is of high importance when learning a new language, as it will most likely work differently than what you are comfortable with. You have to be willing to step out of the comfort zone to have a true grasp on this new language. 

The topic for chapter two goes hand in hand with this mindset. This chapter’s focus is on reinforcing a constant cycle of both learning new information or techniques, and subsequently sharing them. One important note is that this process should happen regardless of where you are in your programming career, apprentice or master, but it would be ideal to begin when your an apprentice. By establishing these practices early on you will habituated these processes of learning and sharing so that they will become second nature to you. Even just reading the introductions to this book has made me rethink these to aspects of how I program, which is a good sign for things to come.

This reading has already changed my mind on these two things, and much of what the other chapters discussed also sounded relevant, at the minimum. The only part that stuck out as odd to me were the introductions to chapters two and four. I am sure the content of both chapters differs, but they seem to be covering very similar topics, both stating that you need to let go of previous knowledge when tackling something new. This is not to say that I did not find these topics interesting, as I said above the topic of chapter two is something I am already thinking about doing, but I just found those chapter introductions to be strangely redundant. Overall thought this reading has been highly interesting and I am excited to dive even deeper into it!

From the blog CS@Worcester – My Bizarre Coding Adventures by Michael Mendes and used with permission of the author. All other rights reserved by the author.

A post about Agile Values

I just wanted to make this quick post about the Agile values posted in the LibreFoodPantry about section. This sections focuses on defining the principles that will be used when developing this site. I chose this as these values might not be what people traditionally associate with software development. For example,”Individuals and interactions over processes and tools,” show that, despite this being a lot of programming, there is more to keep in mind than just clean and functional code. To be a successful software development team must be able to collaborate with your client to make working changes when necessary to ensure they receive exactly what they want.

On a bit of a side-note, the new design for the LibreFoodPantry looks great! The user interfaces is very clean and I always love the addition of a built in dark mode function.

From the blog CS@Worcester – My Bizarre Coding Adventures by Michael Mendes and used with permission of the author. All other rights reserved by the author.

CS-448 Introduction

Hello again!

In case you have not seen my previous introductory post, my name is Mike Mendes and I am a, now, senior Computer Science student at Worcester State with a focus on Software Development and Mathematics minor.

This time around I will be writing blog posts both about my work on a portion of the LibreFoodPantry project, in addition to some posts about the book Apprenticeship Patterns. I am not exactly sure what part I will be working on but am excited to begin!

From the blog CS@Worcester – My Bizarre Coding Adventures by Michael Mendes and used with permission of the author. All other rights reserved by the author.

Object Oriented Programming and Parting Thoughts


While this blog will still be open for the foreseeable future, this will most likely be my last post for some time. This made me think on what would be a fitting final post for this class. After spending the last three posts discussing a pretty involved topic, I figured it would be fitting to take a step back and remind myself exactly what I have been working with for this, and many other semesters. Thus, for this final post, I will be examining Object Oriented Programming as a whole, defining exactly what it is and why it has such significance.

So first and foremost, let’s determine exactly what makes a programming language object oriented. For this week I found an extremely extensive blog post discussing all different components of object oriented programming. I mistakenly assumed that only specific languages, such as Java, could be defined as object oriented, but this concept is not so rigid. This is less of an attribute a language can have and more of a method of programming. It revolves around using classes and objects to represent general ideas that can be instantiated as different instances of objects. Think of it as giving yourself a template within your program that can be reused for others. To specify, this semester we had a program storing different types of ducks with different attributes. In this program you could define a general duck class with all relevant methods and a general duck object with attributes shared by all. Now, when calling this class, you can set unique values for each duck created to represent different types rather than specifying each duck as its own object. This is the general idea, but as always I encourage any readers to refer to my source for a more in depth definition.

So why is Object Oriented Programming significant? If you asked me a year ago I would have said, because my professors talk about it so much. But I have since learned that there are a multitude of benefits that come with this method of programming. This can be summarized in by four specific principles, being inheritance, encapsulation, abstraction, and polymorphism. To summarize, these principles focus on making objects to contain information, only showing what your user needs and hiding other information. Additionally these objects, and their methods, will be able to perform similar tasks and should be accessible by any child classes. These allow for an overall more flexible program, resulting in less work for the programmer without compromising on program complexity or functionality. Often this will allow a complex program to be broken down into more sensible components.

This blog has been fun to post on and, more importantly, has forced me to actually sit down and confront the meanings of some of these more complex subjects. As always, please refer to the source if you want a more substantial walkthrough of Object Oriented Programming, but I hope I could give you the jist of its meaning and importance.

Source:

https://www.educative.io/blog/object-oriented-programming

From the blog CS@Worcester – My Bizarre Coding Adventures by Michael Mendes and used with permission of the author. All other rights reserved by the author.