Author Archives: toomeymatt1515

Boundary Value Testing: General Advantages & Disadvantages

Photo by cottonbro on Pexels.com

Boundary value testing is often seen as an ineffective testing methodology in comparison to other techniques. And while other techniques such as equivalence case testing might be better at testing in some situations opposed to boundary value testing, I believe there are some situations where boundary value testing is a better solution.

For instance, in a situation where you want to test that one particular variable (ie: price of a product in a product catalog) which should exist within a certain definable range (suppose price should stay between 49.99 and 28.99 depending on sales or coupons) then you have both a minimum and a maximum value already specified, and a nominal value can be as simple as the value halfway between the minimum and maximum values. In situations similar to this, boundary value testing has the potential to be much easier than some other testing methods, such as creating partitions and going through equivalence case testing.

On the other hand, in a situation where you want to evaluate a boolean value, boundary value testing makes no sense whatsoever. Since the output will on ever be true or false, there is no obvious specified minimum or maximum. And without a minimum or maximum value it would be difficult to find a nominal value which represents typical output for the variable/function being tested.

Additionally, when working with variables, sometimes the output may have an obvious boundary in one direction (ie: maximum age of a bond is 10 years) but no specified boundary in the other direction (no specified minimum age of a bond). In these cases, a limit will often have to be chosen as a minimum or maximum based off of the functionality of the software or what it’s purpose is (ie: bond cannot be less than 0 years old, can say minimum is 0).

This can be confusing at times when the upper limit is not bounded, forcing you to choose an arbitrary upper limit (ie: price is the amount someone pays for a product, specified must be greater than 0, but no specified maximum price) such as 10,000, 50, etc. This can be somewhat subjective and might vary significantly depending on the context of the program being tested, and can often introduce complications.

In terms of concrete advantages and disadvantages, this article provides a good summary of some of the major upsides and downsides (https://qtp.blogspot.com/2009/07/boundary-value-analysis-bva-problems.html).

Regarding disadvantages, boundary value testing is a poor choice for boolean values as previously discussed, and is also ineffective when working with dependent variables (if you try to use BVT with a dependent variable, you would likely also have to test for the independent variable associated which could be better accomplished through other testing procedures).

Conversely, the advantages of boundary value testing largely involve how simple it is to implement and execute, relative ease of finding lower and upper boundaries (often specified within the program being evaluated), and ability to use more or less test cases as needed (robust boundary value testing could provide a more comprehensive analysis than normal, and worst-case robust BVT could provide even more detailed information).

Because it is often dependent on the inclusion of obvious upper and lower limits, and can’t be used effectively with boolean values, the applications of BVT are not universal, but when it can be applied effectively, boundary value testing is easy to use and can provide representation of the majority of expected inputs.

Article referenced: https://qtp.blogspot.com/2009/07/boundary-value-analysis-bva-problems.html

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

What makes a good test?

Photo by Skylar Kang on Pexels.com

Software testing often involves the process of writing tests in order to ascertain the proper functioning and capabilities of software, within expected operating conditions. When coming up with test cases for a calculator program for instance, you might find it important to test that the addition of two numbers results in a correct sum following the operation.

Testing against the expected value of two arbitrarily chosen numbers (ie: 5 + 4 should equal 9) would be able to provide insight into whether the calculator is functioning as intended, but you could also choose to test for addition of negative numbers, negative and positive numbers, addition resulting in 0 and so on. Because there could be a large number of potential cases to check for, it might seem unclear what exactly would make for an optimal or objectively “good” test in this situation.

When looking into this concept, I found an article produced by Ministry of Testing (https://www.ministryoftesting.com/) a community focused around software testing and related subjects. The article (https://www.ministryoftesting.com/dojo/lessons/designing-tests-what-s-the-difference-between-a-good-test-and-a-bad-test) discusses some attributes to look out for which could be indicative of good or bad tests during the process of creating tests for a piece of software.

The process described in this article follows a series of steps, first identifying and considering risks involved with the program, things which could go wrong and which could affect the program as well as people or entities dependent on the program (users, other programs which access the one being tested).

Following the identification of risks, forming test ideas is described in terms of asking questions. So good tests would need to answer questions about the software and it’s functionality, maybe entering in a negative number, or something which is not a number in terms of the calculator example. This allows for unexpected behaviors to be considered even when they might not seem readily apparent.

Next, the test should be conducted or executed, and depending on whether or not the test reveals any relevant information (do you learn anything from it?) the information gained can be applied to improve the program, or further testing may be required if the test did not reveal anything.

I would say that this process makes sense as a basic framework to follow when writing test cases. In some cases, such as with very simple applications or non-commercial development, the risk can be practically nonexistent; the risk aspect may not always apply to every situation. But in general, this article brings up some good points and provides a helpful sequence of processes which can be followed and repeated as needed.

Article referenced:

https://www.ministryoftesting.com/dojo/lessons/designing-tests-what-s-the-difference-between-a-good-test-and-a-bad-test

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

Concrete Skills: Building a Baseline Skillset

When looking into opportunities for employment, a vast majority of posted openings or advertisements for positions include a list of requirements or preferred traits in prospective applicants. More often than not, this will include a minimum required degree in a related field (ie: BA in Computer Science) and a certain amount of experience in a certain language or languages, ability to work with specific frameworks and tools, and oftentimes a certain level of “work experience” in a related position.

While this often makes it relatively clear the sort of attributes employers are searching for when hiring, there is still the case of needing to stand-out, and prove your potential worth to a company. The pattern discussed in chapter 2 of Apprenticeship Patterns (https://learning.oreilly.com/library/view/Apprenticeship+Patterns/9780596806842/ch02s04.html), “Concrete Skills” discusses the idea of building up a central “concrete” set of skills which can be demonstrated to possible employers or managers as a way to showcase your skills and ability to contribute. This ties into the pattern “breakable toys” which I discussed previously, where the benefits of building practice projects solely for your own benefit and experience is showcased.

So by having a set of core skills, (comprehensive knowledge of a favored programming language, knowledge of common frameworks and adjacent technologies, web development and front-end development skills) you are able to better standout to employers, and can use these skills in making examples or “breakable toys” to showcase the extent of your abilities and what you can bring to a team.

I would say that the “concrete skills” pattern discusses a simple concept, but one which has value especially when looking to start a career or move on to a new position. Being able to visibly demonstrate proficiency to a prospective employer can showcase an ability to learn new things and improve self-sufficiently. As you would need to have somewhere to get practice or experience working with these concrete skills beforehand, using breakable toys in conjunction with the concrete skills pattern can work as a synergy, the breakable toys serving as examples to demonstrate the concrete skills to others.

Text Referenced:

Apprenticeship Patterns: Guidance for the Aspiring Software Craftsman

https://learning.oreilly.com/library/view/Apprenticeship+Patterns/9780596806842/ch02s04.html

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

Thea’s Pantry Sprint #1 Retrospective

Sprint #1

Photo by Pixabay on Pexels.com

For our work on the InventorySystem component of the Thea’s Pantry software project, our team worked throughout sprint #1 to learn about necessary tools, skills and technologies which we will be using throughout our development of the project. This meant that a majority of our focus was on learning, although a small number of useful artifacts were also produced. Much of our communication throughout the sprint was coordinated with the issues board for the project on GitLab (https://gitlab.com/groups/LibreFoodPantry/client-solutions/theas-pantry/inventorysystem/-/boards) which allowed us to keep issues organized based on whether they were actively being worked on, completed, or in need of review.

More specifically, much of my work during the sprint was focused on learning about the Vue.js front-end framework. I organized this process into a number of issue cards, with one central card (https://gitlab.com/LibreFoodPantry/client-solutions/theas-pantry/inventorysystem/community/-/issues/2) which I used to connect three interrelated cards concerning the same topic.

First, I went through introductory content (https://gitlab.com/LibreFoodPantry/client-solutions/theas-pantry/inventorysystem/community/-/issues/3) from sources including the official Vue tutorials on the website for the framework, as well as introductory materials produced externally, such as this intro to Vue 3 series: (https://www.vuemastery.com/courses/intro-to-vue-3/intro-to-vue3/) produced by Vue Mastery.

Furthermore, I went through some of the most important highlights of the Vue documentation to learn the fundamental concepts of the framework (https://gitlab.com/LibreFoodPantry/client-solutions/theas-pantry/inventorysystem/community/-/issues/4), and then practiced using Vue by building a simple Docker container with a Vue Installation (https://gitlab.com/LibreFoodPantry/client-solutions/theas-pantry/inventorysystem/community/-/issues/5).

Combined, I feel that this sequence allowed me to gradually build up a familiarity with Vue and to become fairly confident overall in my ability to work with it. When the group begins working on the actual implementation of the front-end during the next sprint, I will be prepared to make use of Vue for the creation of the three different front-ends necessary for the InventorySystem portion of the Thea’s pantry project.

In regards to how this sprint went overall, I would say that it went relatively well. We managed to complete the majority of the work which had been staged for completion, accumulated a lot of valuable information, and built a wiki for the project (https://gitlab.com/groups/LibreFoodPantry/client-solutions/theas-pantry/inventorysystem/-/wikis/home) which we can now use in the future to store documentation as well as the sort of syntax/procedure which we focused on during the sprint. Everyone on the team was able to find a large number of resources, tutorials, and documentation related to their chosen topic/focus throughout (ie: https://gitlab.com/LibreFoodPantry/client-solutions/theas-pantry/inventorysystem/community/-/issues/6, https://gitlab.com/LibreFoodPantry/client-solutions/theas-pantry/inventorysystem/community/-/issues/10). Additionally, we were able to get the basic structure of the project setup (multiple repositories to hold the corresponding front-ends, the back-end etc) (https://gitlab.com/LibreFoodPantry/client-solutions/theas-pantry/inventorysystem/community/-/issues/14, https://gitlab.com/LibreFoodPantry/client-solutions/theas-pantry/inventorysystem/community/-/issues/13).

One minor issue we did have was in relation to the database/data persistence layer of this project. We didn’t have enough people allocated to the team for someone to focus on learning about MongoDB (the database software being used for this project) specifically. Given that the front-end and back-end were deemed the most important components necessary to get started with actual development & implementation, we decided to focus on MongoDB during the next sprint, after we have some of the front-end and back-end frameworks implemented and in-place for the database system to hook into.

In conclusion, I would say that the sprint was a success, a good majority of the work planned was completed, a great deal of information which will be useful in the future was collected, and then categorized/organized on the project wiki. The example project using Vue and Docker will be an important reference during the next sprint when we will need to begin working on the implementation of the project, and we will be ready to start working on the functionality and layout of the InventorySystem during the next sprint period.

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

Breakable Toys: Improvement Through Experimentation

Photo by Polesie Toys on Pexels.com

In software development/programming related projects, much of the time making a mistake can feel like the end of the world, or at the very least a major inconvenience to everyone else around you. Yet by failing we often tend to learn more than we do by succeeding, since success seems to come most often from familiar and comfortable subjects or ideas which we might already have preexisting experience working with.

This is why I find the Breakable Toys pattern, described in the book Apprenticeship Patterns: Guidance for the Aspiring Software Craftsman as a way to work within a “safe space for failure” to be an interesting and largely relevant idea in the context of software development. The pattern describes the practice of building “breakable toys”, these being smaller, self-contained projects making use of the same toolsets you might use during professional or otherwise high-stakes development.

The pattern suggest building simple games or programs as a way of learning a new programming language. Building simple games such as Tetris or Checkers in order to get to grips with the language seems like it would be a fun experience, I think game development is an extremely interesting field, and focusing on your interests is an effective way to speed up familiarization with a new language by making use of something fun and engaging as a sort of “practice project”.

I have always enjoyed the idea of self-building software; the idea of having a usable program or application which is self-built is appealing. Similar to how a woodworker might feel sitting in a rocking-chair hand built from their own shop, the idea of building something which is demonstrably useful, or even just as an experiment to see what happens is a great opportunity to express creativity and explore a new topic. The added benefit of experience and potential to learn something new makes it a worthwhile experience in my opinion.

In terms of putting this particular pattern into practice, my first course of action would most definitely be to make a few simple games and applications, an image editing program or simple web browser seem like reasonable small-scale projects to work on as a learning experience.

Building something out of personal interest can make learning the required skillset a relatively painless experience, as by the end of it you will likely have something which you can be proud of and enjoy for many years to come.

Text Referenced: https://learning.oreilly.com/library/view/apprenticeship-patterns/9780596806842/ch05s03.html

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

Testing With JUnit 5

Photo by Markus Spiske on Pexels.com

Recently I was introduced to JUnit 5 as a testing framework for Java programs, mainly for the purposes of one of the courses I am taking currently. While I have in the past used methods such as print statements (to test for expected outputs and debug) or using the built-in IDE debugging functions (breakpoints mainly), this was often time-consuming and not easy to scale. When trying to test for a number of different conditions or desired results from a section of the program, I would often end up writing conditional logic just for testing purposes which would end up getting deleted later on in the finished program.

JUnit seems like a relatively logical progression from this process, instead of writing numerous checks and conditional statements into the working code of the program, test classes can be used to rapidly test many different conditions or input/outputs at once. This allows for me to keep the main code of the program neater and to avoid the time consuming process of having to continually write tests or print out values in order to test that everything is functioning properly. JUnit overall is a more efficient way to go about the process.

In the past, I had used an older version of JUnit (JUnit 4) to test an older project from a number of years ago. I found this blog post from Java Magazine (https://blogs.oracle.com/javamagazine/migrating-from-junit-4-to-junit-5-important-differences-and-benefits) was able to highlight many of the major changes and differences between JUnit versions 4 and 5 clearly. Generally, JUnit 5 differs the most in it’s organization into various modules, while older versions of the framework would include all features irregardless of which ones might actually be needed at the time.

Additionally, more recent Java features such as lambda functions (absolutely useful within the context of running tests) make this version of JUnit more powerful than earlier editions.

I would consider JUnit 5 to be one of the better options at present for testing and debugging Java programs and will likely continue to utilize this framework until it inevitably sees a version 6 release.

Article Referenced: https://blogs.oracle.com/javamagazine/migrating-from-junit-4-to-junit-5-important-differences-and-benefits

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

Apprenticeship Patterns: First Impressions (Chapter 1 and Chapters 2-6 Introductions)

Image result for apprenticeship patterns

For this course, we were introduced to the book Apprenticeship Patterns: Guidance for the Aspiring Software Craftsman, by Dave Hoover and Adewale Oshineye as a resource and reference.

Immediately, I found this book to have an interesting approach to the way it presented information. Instead of being organized in a simple front-to-back kind of format, where content would be organized by order of foundational material followed by more advanced topics, this book is organized more similarly to a wiki, with the content presented in a relatively self contained manner for each chapter rather than as a series of introductions or tutorials followed by applications.

More specifically, I think the idea of apprenticeship discussed throughout the opening chapter and throughout this text is a genuinely useful idea relative to any kind of career or interest in software development. Rather than focusing on achievement and career progress for the sake of progression, the definition of apprenticeship is more concerned with learning and the acquisition of the knowledge with the goal of learning more and knowing more each day than the ones preceding it.

The definitions of “apprentice”, “journeyman”, and “master” used in this book are interesting because they discuss them as part of a system. Apprenticeship is presented as a step in a logical progression leading forward to being a Journeyman and eventually a Master with differing priorities and activities being attributed to each one, where the apprenticeship stage is primarily concerned with learning and self-development.

I like the idea of starting out with self development, because if you don’t develop yourself and understand how you want to work and the tools you want to use going forwards, then you proceed on unstable ground which won’t be very conducive to your future development or career.

Chapter 2, “Emptying the Cup” discusses the concept of remaining open to new ideas and knowledge, even after you feel you have learned a lot about a particular topic. It deals with the idea of acknowledging what you don’t know, and confronting those deficiencies while also maintaining a “beginner’s mind” while learning new things. While the chapter goes on to discuss how these ideas can be applied to something like learning a programming language, I think they can be relevant to learning just about anything. Activities such as cooking, painting, or even tying a knot all seem like places where it could be a good idea to approach them with a “beginner’s mindset” and not assume everything through prior knowledge.

Often going through things step-by-step as an absolute beginner might seems to produce some of the most lasting impact, in my experience. I think this chapter and the idea of keeping an open mind is very valuable, especially in a field like software development where you might be exposed to many different frameworks or languages throughout a project/development period, and might be tempted to apply knowledge from one to another (possibly leading to later difficulties).

Book Referenced: “Apprenticeship Patterns by David H. Hoover and Adewale Oshineye. Copyright 2010 David H. Hoover and Adewale Oshineye, 978-0-596-51838-7.”

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

LibreFoodPantry: Free & Open Source Food Pantry Software

As previously mentioned on this blog, I will be working with the LibreFoodPantry project to develop FOSS software for food pantries.

After reading through all the documentation and information available on the website (https://librefoodpantry.org/#/) and taking a look at the redesign of the website (https://librefoodpantry.gitlab.io/website/) for the project, something I found helpful was the linked information regarding FOSSisms (https://opensource.com/education/14/6/16-foss-principles-for-educators). Being new to working in FOSS development, it was beneficial to learn about the various principles associated with FOSS project development.

Specifically, the idea that contributors should “Ask Forgiveness, not Permission” was helpful for me. As someone who can sometimes be a perfectionist, I tend to not want to publish something if I feel it has potential to derail or cause problems with other parts of a project. I will strive to consider this idea as I make contributions.

Sources Referenced:

https://librefoodpantry.org/#/

https://librefoodpantry.gitlab.io/website/

https://opensource.com/education/14/6/16-foss-principles-for-educators

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

CS-448 Introduction

Photo by Taryn Elliott on Pexels.com

This course is the capstone (final) Software Development course I will be taking to complete my Computer Science major at Worcester State University. We will be working with the LibreFoodPantry project (https://librefoodpantry.org/#/) to develop software for use in managing food pantries.

This project is free and open source (FOSS) which seems like a good way to ensure that anyone who is interested could modify and improve aspects of the software without running into legal issues. Developing software as free and open source opens up more possibilities for creativity and improvement over time since there are less barriers to entry for working on the project.

I am excited to begin contributing to the LibreFoodPantry Project over the course of the semester, and look forward to gaining experience working on a larger-scale project with a team, as much of my development experience comes from smaller scale development that I have done largely on my own.

Learning to work as part of a larger group will no doubt prove to be valuable experience in terms of preparation for creating software in a workplace environment, as software development often tends to be a group effort.

LibreFoodPantry’s website: https://librefoodpantry.org/#/

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

REST API Design Practices

What is REST API? - Seobility Wiki

For many assignments in a recent class, I had the opportunity to use and learn about REST (Representational State Transfer) API in relation to simple web applications. In working with REST, I was unsure about some of the syntax and conventions used with the API, namely the difference between different response types (JSON vs String response for instance).

I looked into finding some more information on good practices for REST API projects, and according to a helpful blog post I found on Stack Overflow (https://stackoverflow.blog/2020/03/02/best-practices-for-rest-api-design/), REST APIs should generally both request and send responses with JSON (JavaScript Object Notation). I had a number of issues with sending and receiving data which was not in this format (needed to send/receive strings in POST methods within an endpoint). This was causing problems such as information not being sent and received properly (name field of an item not being sent or received in the right places) as well as issues with the functioning of the web application itself (endpoints belonging to unrelated services would cease to function properly if the requests and responses were not JSON.

Furthermore, according to the author, JavaScript has baked-in methods to handle interacting with JSON entities, which makes it easier to use overall especially if there are other JavaScript based technologies being used within the structure of the project, so it makes sense to use JSON within requests/responses. So in future projects involving REST, I will attempt to primarily use JSON objects for responses and requests to ensure compatibility and easy access through JavaScript.

Another point which was discussed was the importance of using nouns in naming conventions, rather than verbs (specifically nouns which are highly representative of the destination or object being affected) when naming endpoint paths. IE: instead of POST: /orderPizza/, use POST /order/ when trying to create a new order. This makes sense, as the HTTP methods typically describe the action or verb being enacted on an object, so you needn’t describe that within the endpoint path.

Finally, I want to discuss the topic of HTTP status codes; the author of this article describes the meaning of many common error codes and why you might return them as a response. This was especially helpful for me as I had been using these codes within a REST project, but had no idea what the majority of them actually meant. According to the article, a code of 400 indicates a client-side validation error, 401 represents an authorization or permissions error, and 404 represents an inability to find a particular resource. Out of all of these errors, 404 is definitely the most common from my experience. I have frequently seen this while using the internet whenever a page would couldn’t be found on a website/web application, it was pretty neat to learn more about.

What is a 404 Page? - Learn to code in 30 Days
Example of a common 404 not found error page

Overall, after reading this article I feel more informed about the way REST API services work, and will be more prepared for the next project I work which makes use of the framework.

Post Referenced: https://stackoverflow.blog/2020/03/02/best-practices-for-rest-api-design/

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