Category Archives: Week 3

Apprenticeship Patterns – Concrete Skills

A pattern that peaked my interest in Apprenticeship Patterns: Guidance for the Aspiring Software Craftsman[AP] by Dave Hoover and Adewale Oshineye was “Concrete Skills”. In short, it discusses how it is important to have a basic set of “concrete skills” as they will be important when going for jobs and gaining the respect/trust of team members [AP]. It also discusses how to acquire these skills [AP]. The reason I was interested is because this is a book for the apprentice. One might think that an apprentice may not have a whole lot of concrete skills. They may have enthusiasm about the subject matter and are probably more that willing to learn, but they may not have the necessary skills. In my opinion, a person is an apprentice because they have to learn these concrete skills before they can go off on their own. There should be no expectation for a new apprentice to know anything other than a few basics of a language or two. If you already have these concrete skills down pat, then why would you still be considered an apprentice?

While I disagree with the expectation that apprentices should have a bunch of these concrete skills (at least that is how I interpreted it), I don’t disagree that concrete skills are very important when going for jobs and getting a new team to accept you. You have to be able to prove that you can do the very basics of the job at a minimum. In other words, you don’t want to walk into a job and be a burden to the team. I think it is understood that there will be a learning curve and someone from the team is going to have to go out of their way to teach the new person how things work at the company, what the project they are working on is all about, etc., but the team shouldn’t have to babysit and guide the person through every task for the next year. Having some concrete skills along with the ability to learn quickly will prevent the babysitting aspect. It will also give the respect of other more veteran team members. It is important for people with more experience than you to be able trust that you can get the job done and respect your work. I just feel that if you are going for an apprenticeship type positions (a.k.a. internships), that the expectations of what you know are significantly lower than if you were going for a full fledged engineering position.

Link to the pattern in the book:

https://www.safaribooksonline.com/library/view/apprenticeship-patterns/9780596806842/ch02s04.html

 

From the blog CS@Worcester – README by Matthew Foley and used with permission of the author. All other rights reserved by the author.

Toxicity and Community

http://www.codesimplicity.com/post/kindness-and-code/#more-1673

This week, I read this blog post titled “kindness and code” authored by Max Kanat-Alexander on his blog, Code Simplicity. The post is about the toxicity of the software development community and Alexander is trying to help improve it by explaining the importance of kindness and treating fellow developers with respect. I chose this post to write about because I am interested in improving the typical harshness people tend to deliver to each other on the internet. As somebody who plays a lot of remarkably toxic video games such as league of legends or call of duty, its easy to see how that type of bad behavior can also exist in software development. In fact, you can find horrible behavior common in any field regarding random community communication on the internet.

I believe people tend to lash out over the internet more often than in real life. This is because they are mostly anonymous and care less about good manners or reputation when it involves somebody they may not ever meet again. This allows somebody who is given any slight reason to judge you, the justification to barrage you with hate. This type of behavior is pointless as Alexander writes “There is no value to being cruel to other people in the development community” as it seems like an instinctual reaction for some people to point out anothers flaw just to make them feel bad about it. Take an example of any normal person trying to learn something new for the first time, either with a video game or in software development, and they make a mistake. If another person online is able to see their mistake, they might be aggravated by it enough to insult and verbally abuse the poor person who is just trying to learn.

Usually this occurs when somebody more experienced looks down on a newer person however, not necessarily. As the internet matures like an older brother, more and more experienced people are picking up the habit of lending healthy advice down towards the still learning user, and that is what Max’s blog is about. Coming from an experienced point of view, he offers techniques of constructive criticism to the software development community in hopes that they will help each other rather than judge each other. While today it is common sense to simply ignore and accept the inevitability of horrible comments on the internet, it is becoming more of a growing trend that not everybody on the internet has something hurtful to say. That means progress! Even though it is difficult to imagine an internet without any angry anonymous trolls waiting to insult your every move, I believe the internet community is getting better and better every day.

From the blog CS@Worcester – CS Mikes Way by CSmikesway and used with permission of the author. All other rights reserved by the author.

Levels of Testing

Source: https://blog.testlodge.com/levels-of-testing/

Another week into my blog for CS 443 this week I decided to look up blogs about levels of testing. While I was searching the web, I found a blog testlodge by Jake Bartlett he wrote a blog post titled “Levels of Testing In Software Engineering” here he talks about the levels of testing in software engineering. There are 4 levels of testing he talks about. Unit testing, integration testing, system testing, and acceptance testing. The first testing that most people do is unit testing. It involves testing pieces of code to make sure each one is right. With unit testing it helps verify internal design and internal logic, internal paths, as well as error handling. Unit testing is usually done by the developer who wrote the code. The second level of testing is called integration testing. This level of testing test how well each of the code works together. Each class is usually combined and tested as a group. This way it identifies interface issues between modules. The third test is called system testing with this kind of testing it test the entire application. This is done in a test kind of environment where the program would be sent out to. With this kind of test, the application is tested from beginning to end. This test is usually done by the testing team and includes a combination of automated testing and manual testing. Finally, the last test is called accepting testing. With this level of testing it test if the software is ready to be released. This kind of testing is mostly done by the business user and end user. With these levels of testing it show that testing is not just a onetime thing it is multiple test just like my other blog talks about. You have to make the right kinds of test and test often.

I chose this blog because I wanted to stay on the same topic I did for my last blog and keep with testing. I liked this blog a lot because it makes things easy and clear to understand and breaks each testing in to different levels and gives a clear description of what each of the testing is about. With testing ideas, I learned that you will never have enough tests. So, to make sure you are efficient when testing you have to break down your testing into different levels. I think the blog will help me a lot in the future because I will be testing a lot of code for class, school, work, and personal projects. Know what to these how to test and when to test is the best way to use my time efficiently.

 

From the blog CS@Worcester – The Road of CS by Henry_Tang_blog and used with permission of the author. All other rights reserved by the author.

10/2/17 Coding

 

 

This is another video from Joel Spolsky. I found this video through the last blog entry from last week. In this video he talks about the impact of coding in everyday life. He uses a taxi as an example of how coders deal with coding. he mentions if the person tries to make the taxi turn right, instead of the taxi turning right, it might have the trunk pop open or the taxi turn in the opposite direction. The driver will ask what’s wrong and try to figure out the problem. The driver will go online and find another driver had the same problem asked the question then was given the answer.  The driver could use the answer to solve his problem. Before stack overflow, there was a site online where programmers post questions to a coding issue, then would have to pay the company money to see their own answers that they have written up, Stack overflow was created where programmers can write questions to the program they have a problem on and other programmers can answer. Those answers are rated by other programmers who use the site. Those ratings can help a programmer build their reputation as a programmer. This could possible lead to jobs as a programmer in the future. Programmers need every detail of instruction for the program to run properly. Like mentioned before, algorithms are used in software design to run programs on websites. These algorithms allow a site to post certain pictures, articles and other posts, based on what the user is searching for or their feelings towards a certain topic or event.

The video was interesting. Joel uses everyday trends such as Uber and Facebook to explain how coding works in general and how it is used in everyday life now. I picked this video because I really liked the last video, and video was similar to the last one. The last video talked about programming and coding effecting the future of people. This video talked about coding impacting everyday life of today. This gave me a better  idea of how a website work and how a program runs. Again this shows me what expect in the workforce of a programmer. Joel compared the early days of programmers working similar to working at an assembly line. Programmers were hired to create a program write it and run it, and doing it in small cubicles with computers that did not work properly. Now a days programmers work with he company on the spot to make sure the program runs properly and fix and problem as they arise. This gave me a better understanding on how algorithms work on a site and how to use them for when I create a site and run it.

 

From the blog CS@Worcester – My Blog by rens14 and used with permission of the author. All other rights reserved by the author.

Single Statement Unit Tests: Making tests more object oriented

In a post by Yegor Bugayenko, Single Statement Unit Tests,

“..I believe, can help us make our tests, and our production code, more object-oriented. Here it is: a test method must contain nothing but a single assert.”

He makes use of the assertThat() that is available from Hamcrest. Benefits to using assertThat() are: Reusability. Classes needed to create test assertions are reusable in other test methods and test cases. Brevity. Shorter and readable code that’s easy to understand. Readability. Using a single assert, the intent of the test will always be apparent. Immutability. No need for setters or getters if we limit use of algorithmic code in tests.

He uses and example method RandomStreamTest from OpenJDK 8, created by Brian Goetz:

@Test
public void testIntStream() {
final long seed = System.currentTimeMillis();
final Random r1 = new Random(seed);
final int[] a = new int[SIZE];
for (int i=0; i < SIZE; i++) { a[i] = r1.nextInt(); } final Random r2 = new Random(seed); final int[] b = r2.ints().limit(SIZE).toArray(); assertEquals(a, b); }

In this example there are two parts, the algorithm which creates two arrays of integers and the assertion which compares them using assertEquals(). The author recommends modifying the code to look like this:

@Test
public void testIntStream() {
final long seed = System.currentTimeMillis();
assertEquals(
new ArrayFromRandom(
new Random(seed)
).toArray(SIZE),
new Random(seed).ints().limit(SIZE).toArray()
);
}
private static class ArrayFromRandom {
private final Random random;
ArrayFromRandom(Random r) {
this.random = r;
}
int[] toArray(int s) {
final int[] a = new int[s];
for (int i=0; i < s; i++) { a[i] = this.random.nextInt(); } return a; } }

The change is the test is that there is only one statement in the method now.

Yegor notes

"The biggest benefit we get when this principle is applied to our tests is that they become declarative and object-oriented, instead of being algorithmic, imperative, and procedural."

I chose this resource because it's an interesting way to design tests and the benefits of using assertThat() might be of use to me in the future. I think it is important to keep up on the best unit-testing practices if I want to write good code to match. I'm also interested in looking more into Hamcrest.

Using assertThat() allows you to write relatively short test cases that are clear what is being tested. Sometimes tests can become bogged down with too many assertEquals() and setters and getters. Using assertThat() allows you to simply compare two immutable objects. I plan on using this, or at least trying to implement it whenever writing tests in the future along with whatever makes writing tests more readable, understable and object oriented.

The post Single Statement Unit Tests: Making tests more object oriented appeared first on code friendly.

From the blog CS@Worcester – code friendly by erik and used with permission of the author. All other rights reserved by the author.

Observer

The Observer pattern is very commonly used and is one of the Gang of Four design patterns which are meant to solve design problems and create reusable object-oriented software.

The book chapter from the book Game Programming Patterns by Robert Nystrom on the Observer pattern provides an example of its use in specifically game design (an achievement system), however its implementation remains the same as it would in any other type of software. The pattern essentially allows communication between systems without having to couple them together. It does this by creating observers that receive notifications from the subjects that their observing and sharing that information.

In the example provided by the chapter, it shows how a physics system can communicate to an achievement system to unlock an achievement where the player falls off a bridge:

observer

It does this without having to couple the two systems together and eventually creating a huge mess of code.

The author then goes on to describe some concerns and potential problems of using the patterns, such as speed and memory allocation, as well as their solutions. Although even if you implement this or any design pattern correctly and efficiently, it doesn’t mean that it’ll work well depending on whether or not it’s applied on the right problem.

I chose this chapter in particular because it’s likely that we will be using this pattern in the future. Also I think it’s interesting to see how these design patterns can be used in game development, so it may be useful to others who are interested in developing games. I used this pattern in the past for a system where the physics system would notify the observer when a collision happened and it would tell the sound system to play the sound for that collision. I ended up running into a lot of problems due to my poor implementation of the pattern, getting errors because of improper memory allocation. Referencing the examples from this chapter helped me learn how to fix these issues and optimize my code. However, while using the Observer pattern for my audio system worked properly, I ended up doing it differently afterwards using a service locator to provide a global point of access to the audio system as well as an event queue to prevent multiple instances of the same sound from playing at once and blowing out my ears. Although I wouldn’t use the Observer pattern in this situation again, it’ll probably be useful in the future.

Source: http://gameprogrammingpatterns.com/observer.html

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

Observer

The Observer pattern is very commonly used and is one of the Gang of Four design patterns which are meant to solve design problems and create reusable object-oriented software.

The book chapter from the book Game Programming Patterns by Robert Nystrom on the Observer pattern provides an example of its use in specifically game design (an achievement system), however its implementation remains the same as it would in any other type of software. The pattern essentially allows communication between systems without having to couple them together. It does this by creating observers that receive notifications from the subjects that their observing and sharing that information.

In the example provided by the chapter, it shows how a physics system can communicate to an achievement system to unlock an achievement where the player falls off a bridge:

observer

It does this without having to couple the two systems together and eventually creating a huge mess of code.

The author then goes on to describe some concerns and potential problems of using the patterns, such as speed and memory allocation, as well as their solutions. Although even if you implement this or any design pattern correctly and efficiently, it doesn’t mean that it’ll work well depending on whether or not it’s applied on the right problem.

I chose this chapter in particular because it’s likely that we will be using this pattern in the future. Also I think it’s interesting to see how these design patterns can be used in game development, so it may be useful to others who are interested in developing games. I used this pattern in the past for a system where the physics system would notify the observer when a collision happened and it would tell the sound system to play the sound for that collision. I ended up running into a lot of problems due to my poor implementation of the pattern, getting errors because of improper memory allocation. Referencing the examples from this chapter helped me learn how to fix these issues and optimize my code. However, while using the Observer pattern for my audio system worked properly, I ended up doing it differently afterwards using a service locator to provide a global point of access to the audio system as well as an event queue to prevent multiple instances of the same sound from playing at once and blowing out my ears. Although I wouldn’t use the Observer pattern in this situation again, it’ll probably be useful in the future.

Source: http://gameprogrammingpatterns.com/observer.html

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

CS@Worcester – Fun in Function 2017-10-02 23:08:58

The podcast episode referenced in this blog post can be found here.

This podcast episode from CodingBlocks.NET discusses the SOLID design principles. I chose this episode because SOLID is a fairly early topic in the syllabus and appears to cover several important principles. The podcasters start by introducing SOLID as guidelines for well-designed code, defining “well-designed” as easy to change, easy to read, and easy to maintain. They suggest that you should usually code first and then refactor according to these design principles as the need arises, since following the principles can take a lot of work. Additionally, you probably can’t adhere to every single principle out there, so practicality comes first. Summarizing every principle discussed got long, so I’ll summarize the ones that affected me the most.

The Single-Responsibility Principle is fairly simple – it holds that a class should do one thing and do it well, i.e. objects should only have one reason to change. With this principle in mind, I will check my classes to see if I can think of two or more reasons I might need to modify them, and if I can, I’ll see if I can divide the responsibilities into multiple classes.

The Liskov Substitution Principle states that objects in a program should be replaceable with instances of their subtype. They talk about how making a square a subtype of a rectangle, while intuitive, would actually violate the Liskov Substitution Principle because of a square’s additional restrictions. You ought to be able to set a rectangle’s length and width to two different values, but this is impossible with a square. They conclude that if your subclass requires something a base class doesn’t, chances are you’ve violated this principle. This makes a lot of sense once spelled out, and in the future, I will make sure instances of my subclasses can be used whenever objects of the parent class are expected.

The Interface Segregation Principle holds that more specific interfaces are usually better than large, general interfaces. For instance, using a brake information interface where brakes are concerned would be more efficient than using an entire car interface. The podcasters say that according to this principle, if your interface requires a lot of methods in order to be implemented that often aren’t needed, your code smells. With this in mind, I will examine my interfaces for methods I’m not using most of the time and see if I can make smaller, more specific interfaces.

Additionally, the podcasters note that following the Single-Responsibility Principle and the Interface Segregation Principle make unit testing easier, so I’ll make sure to keep this in mind if I expect to do unit testing or pass my code on to a unit tester.

From the blog CS@Worcester – Fun in Function by funinfunction and used with permission of the author. All other rights reserved by the author.

TESTING IN THE PUB EPISODE 37- MAKING BETTER TESTERS WITH KEITH KLAIN(week 3 blog)

For this blog i chose the podcast Making a better tester with Keith Klain from the testinginthepub podcast website. This is a website where there discuss various topics in the software testing field. I picked this podcast because it sounded interesting and seemed like a good starting point into the world of software testing. It discusses some of the downfalls in the testing field and areas to improve as well as an overview of the state of the industry today.

The podcasts starts with the guest of the show Keith Klain discussing one issue that seems to come up a lot in the testing field. This was that the testing teams objectives would not align well with the business side. He talks a lot about how often times when he consults for a company he will see that the testing team is effective, but simply that their goals to not match that of their business counterparts. He then goes on to state how important it is for the testing team to have good communication skills with the business team and to have their goals aligned to make testing as effective as possible.

The next section of the podcast builds where the previous section left off. This section talks about how one of the big things holding the industry back is that a lot of company’s still use very old ways of handling their testing. Most of this includes outsourcing all of their testing to independent firms and testing centers. Keith Klain states that as much as fifty percent of major financial firms and banks still outsource all their testing to large testing centers in other countries. This not only makes it harder to communicate and have everyone on the same page but also since this company’s treat this as an external service and  just get the results back they do not truly understand the data that they get from testing. The podcast also discusses that financial aspect of it ,stating that it is hard to completely phase these practices out because they are so deeply ingrained and these testing centers make a lot of money and employee a large number of people. Keith Klain also states that the reason a lot of these company’s are having a hard time updating their systems to agile or waterfall development is because of how heavily they rely on these large testing centers.

The last section of the podcast talks about the exposure and communication in the testing community. The podcast refers to a recent expo that the hosts had attended which was not testing expo but a more general tech expo. The podcast talks about how a lot of people seem the have misconceptions about what testers are and really do.Keith Klain talks about how the testing community needs to be a little more social in order to draw new people into the community.To finish up the podcast Keith Klain talks about the usefulness of experience reports and documenting some of the experiences you have in your testing job , and how this can be really helpful for figuring out which systems work in different contexts.

In conclusion i found this article to be very interesting and gave a good insight on where the industry is today and where it is going. To me it seemed to be plagued by a lot of the same issues as in other parts of tech, such as technology moving very fast and a lot of non tech companies having trouble keeping up. It also seems like the industry is held up by a lot of old infrastructure that is hard to remove because the amount of money that is tied up, which i would also say is a larger problem in the tech industry. One thing that interests me is seeing how the industry will grow, will the testing teams start working much closer with the development teams and how will this effect performance. If so will we then see a shift into developers writing their own tests and having the whole process be that much more unified, and if so how will this effect performance and the industry.There is a part 2 of the podcast which i am looking forward to listening to.

-Thank you for reading

-Dhimitris

 

 

 

From the blog CS@Worcester – Dhimitris CS Blog by dnatsis and used with permission of the author. All other rights reserved by the author.

Proxy Pattern

Source: http://java-design-patterns.com/blog/controlling-access-with-proxy-pattern/#author-info

Another week into writing my blogs and I found this new blog called java-design-patterns written by Ilkka Seppälä. He wrote a blog post called Controlling Access with Proxy Pattern That talks about proxy concepts. He talks about how proxy concepts work and how useful it is. There are many ways where the proxy pattern is useful. Protection proxy, virtual proxy, caching proxies, remote proxies, and smart proxies. With protection proxy’s they can limit the access to the real subject. He gives an awesome example talking about the protection proxy where he makes a public interface WizardTower. He then writes a class called IvoryTower which implements WizardTower. What the IvoryTower did was that it kept track of who went into the tower and how many Wizards are in the tower. To keep the tower from over filling and to keep the tower nice and organized he then writes a class called WizardTowerProxy that implements WizardTower with this it has the wizards have to go through this proxy before even entering the tower. With this proxy it only allows 3 wizards max to enter the tower and if anymore tries to go in it would say “{} is not allowed to enter!”

I chose this blog because at first when I skimmed though it I saw the words wizards so I was like this is it. I then continued to read the blog even more and I found that that it is a super helpful blog about proxy patterns. I like this blog a lot because I don’t know much about proxy except for the basic stuff so this gave me a wider range of information. I also like that it even has an example with code to follow. So that way I know what I am reading and I know what it looks like in an actual code. I also like how it made the blog more interesting by bringing a little humor into the code and kept me wanting to read it because with code it usually is just boring stuff and most people just skim through it and not think twice about it. However, with this it was entertaining to read and I wanted to continue to read it. I think that this blog would be very helpful in the future because in my CS 343 class we are talking about diagrams and in the beginning it shows a diagram of the code that he was talking about and I thought that was nice since I know more about diagrams now because of that class.

From the blog CS@Worcester – The Road of CS by Henry_Tang_blog and used with permission of the author. All other rights reserved by the author.