Category Archives: #Post-1

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.

The White Belt

Apprenticeship Patterns: Guidance for the Aspiring Software Craftsman by Dave Hoover and Adewale Oshineye is the book assigned to us in my Computer Science Capstone class, it seems like a rather interesting read from the first look I had at it. The book describes different problems and solutions that a lot of software developers struggle with at different times in their careers. It has a rather easygoing approach to those things and is a good read that should be done by every upcoming and experienced developer, in my opinion. I know I will read it.

I was blown away by the intro of the book, which is chapter 1, and then and chapter 2 made me read it all the way. It was hitting close to home in my professional development. It made me think about all the things I’m going through right now, how my enthusiasm for my job went down and how I do not learn new things as well as I used to. Especially the white belt part makes me read it over and over. I realized that I grew complacent in my current job status and the change that is coming soon does not make me excited about the new possibilities at all, the fact that I’m dreading learning new skills for work is rather laughable since that was the way I got to where I am today.

I can see how this book will be a very useful tool for anybody who works in software development. Just by glancing at the introductions of the other chapters I can see that it will definitely be a very good motivation and inspiration to move things along, either it be my schoolwork or professional work. Simple things like what the book describes, for example chapter 6: Construct Your Curriculum, have been put on hold for me because I thought I didn’t have to do much anymore and I was all set when it comes to my skillset.

I have a very good feeling about this book, and it purpose of inspiring people to grow as developers, it is very thought provoking and makes you think critically about yourself and the problem we all face. I will most likely read this whole book as soon as I can to increase my enthusiasm for the work I do, and knowledge I’m amassing both through school and my profession. It definitely makes me want to be better but at the same time I’m understanding better that I need to learn things slowly, learn to walk before I can run. I have grown lazy when it comes to programming and I want to change that after reading just parts of this book. I will try to read the whole book as soon I can.

From the blog #CS@Worcester – Pawel’s CS Experience by Pawel Stypulkowski and used with permission of the author. All other rights reserved by the author.

Testing, Testing and some more Testing

In my Testing class we are constantly learning some new techniques and ways to test software, although there is some hands on testing on actual code a lot of it is more theoretical or to be more specific it is describing how we can test. It is all useful I know it but as a CS major I do want to write code if possible, less theory please, more practice. End of rant? Maybe for now.

This week was about Define-Use Testing. It is somewhat simple concept and I am glad that I can learn about it. It showed us some of the ways that today’s compilers work and make comparisons to display errors in the code. The whole concept of Define-Use testing is all about visual inspection and checking of the code. This will be some useful information for certain aspects of Computer Science field.

From the blog #CS@Worcester – Pawel’s CS Experience by Pawel Stypulkowski and used with permission of the author. All other rights reserved by the author.