Lambda expression in java

A Lambda Expression is a representation of an anonymous function which can be passed around as a parameter thus achieving behavior parameterization. A lambda consists of a list of parameters, a body, a return type and a list of exceptions which can be thrown. I.e. it is very much a function, just anonymous.

An instance of a lambda can be assigned to any functional interface 
 whose single abstract method’s definition matches the definition of the lambda. In fact, a lambda is a less verbose way of defining an instance of an interface provided the interface is functional. Since, the definition of a lambda can match the definition of multiple functional interfaces, hence, a lambda instance can be assigned to any of these matching interfaces.

The reason i picked this topic was because it was something new i have seen in the java language. Also wanted to know more about it and see if i can utilized it on some of my java programming language.

Examples of lambda expression.

First of all. Comparing java 7 to java 8.

public interface StateChangeListener {

public void onStateChange(State oldState, State newState);

}

In java 7 we implement this interface in order to listen for state changes. You do this

public class StateOwner {

public void addStateListener(StateChangeListener listener) { … }

}

But in java 8 you can add an event listener using a java lambda expression. like this.

StateOwner stateOwner = new StateOwner();

stateOwner.addStateListener(

(oldState, newState) -> System.out.println(“State changed”)

);

 

From this topic ( lambda expressions), i learned that previous java or java 7, if i wanted a block of code to be executed, we need to create an object and pass the object around. From Java 8, lambda expressions enable us to treat functionality as method argument and pass a block of code around. Lambda expressions in Java 8 are very powerful and therefore very compelling. For me, lambda expressions is way much better, convenient and very easy.

link to the resource : http://tutorials.jenkov.com/java/lambda-expressions.html


 

From the blog CS@worcester – Site Title by Derek Odame and used with permission of the author. All other rights reserved by the author.

Post 2: The use of Strike Teams

I read a blog post by the people at Chaotic Good Programming and they talked about how they began to use Strike Teams at their work place. I’ve never heard of strike teams besides some fake ones in video games or something like that. The blog talks about the problems that bringing in Strike teams caused at first since bringing in new systems will always have some kinks in the beginning. The post says a strike team is “an idea that for projects that require expertise not found on any individual team, you pull in a person or two from multiple different teams to get all of the correct skills on a single team”. The idea is pretty interesting, lets say you’re working on a project and you need to put in physics into it and no one in your group is an expert on physics, you can grab someone from another group and put them on your team so you have a team with all the aspects to make your work the best it can be. There is problems though, they initially talk about cohesion when you pull someone which is true since if you’re not familiar with a person, then you might not be on the same page most of the time. Another problem was finding out who was gonna be involved on certain topic and when the end date was gonna be. Another problem was when was the start date gonna be, there are so many different teams that finding a start date to work with everyone was pretty difficult so they ended up doing a rolling start. Finally, the last problem they said was not to the strike team concept but to particular organization. They needed to construct meetings with people from across the country which was hard with the time constraints, so they left it to the IT of the place to re-arrange things to make it work. They finished by saying they are excited to see how this works out.

The reason I picked this blog post was because I found it as an interesting new concept that could be implemented at a future workplace that I’m at. The idea to me seems smart, get everyone on a team that can work on a task very well so they can get it done quick and the best it can be. It was also nice to see that this group was able to find solutions to each of the problems of the new system pretty quickly it seemed so they could get their projected off to a good start. I hope they post in the future on how this “Strike Team” system goes for them and their project and if they will continue to do this. I also wonder how it efficient it will be compared to their old system of doing things. I was able to learn what a strike team was by this post and how it works and some of the complications that come with it, I hope if I ever run into “Strike Teams” at future employers that they have been a thing for a while and are the best system it can be. Thank you for reading my blog post reflection on Chaotic Good Programming’s blog post on “Strike Teams”

Source: https://chaoticgoodprogramming.wordpress.com/2017/09/16/strike-teams/

From the blog CS@Worcester – Benderson's Blog by bendersonsblog and used with permission of the author. All other rights reserved by the author.

The Programming Language to End the Divide?

This article discusses how a startup company out the U.S. has created a programming language that solves the divide between the fast language of C++ and the functionality of Python. The company is called “Julia Computing”, which is the same name as the language they have created. The language is open source, meaning other startups and large organizations can feel safe to pick Julia as an option without having to worry about financial difficulties. In the wake of Julia, it has been picked up for testing and research by many large groups such as NASA and the Berkeley National Laboratory. It is also being used for aviation safety practices by using collision avoidance systems in aircraft.

I have selected this article because I am interested in the collaboration of new open source projects. It is interesting how computer scientists are striving to create multi-purpose language and return them as open source.  This project started in 2009 with a two people from MIT wanted to “simplify” the coding process. One of the developers of the language, Shah,  states, “The open source project was started to democratize programming, but to meet market demand for commercial products, we founded Julia Computing,”.

The first public version of the Julia language was actually released in 2012 and had over 100 open-source contributors to help move it along. I thought this was very interesting because it shows the motivation and effort that went into making a language that attempts to combine the strong suit of two of the most popular languages, C++ and Java. This idea of team collaboration resonated with me because many ideas can solutions can be brought to the table by multiple people, which can propel a project forward. I also learned that the Julia was used in the Celeste project in which it classified 188 million stars and galaxies in about 14 minutes and was run off of one of the 10 most powerful supercomputers in the world. I also learned that the process of creating product features for an open source language such as Julia is not as easy as it seems. “Keeping up with demand for new product features and packages is the biggest challenge, says Shah. “It takes anywhere from a few months to a year to create a product, and each product is continually improved to leverage the newest developments and improvements in the Julia open source language and to provide additional features requested by our customers and users.” This comment affected me in that although something may seem like an easy task, there are bound to be other issues that arise that can severely delay the development process. This is important to recognize because expecting the worst can sometimes help you see things that may have otherwise been overlooked.

Julia is consistently being optimized and could soon be efficient enough to challenge the industry giants that are Java and C++. Although Java and C++ are extremely dominant in the current era of computing,  with more testing, collaboration, and applications, Julia could find its way to become a programming titan.

Source: (https://www.forbes.com/sites/suparnadutt/2017/09/20/this-startup-created-a-new-programming-language-now-used-by-the-worlds-biggest-companies/#17581d2a7de2)

 

From the blog CS@Worcester – Amir Adelinia's Computer Science Blog by aadelinia1 and used with permission of the author. All other rights reserved by the author.

Could Robotics Process Automation (RPA) Be the Future of Testing?

According to blogger, Swapnil Bhukan, robotics process automation is indeed the future of software testing. In his blog post, Robotic Process Automation(RPA) evolution and it’s impact on Testing, he predicts that RPA will perform about “50 to 60% of testing tasks” by the year 2025. If you are not familiar with what RPA is, Bhukan also made a blog post describing what it is, how it works, and some of its benefits. Essentially RPA is a way to automate any repetitive task using bots that are taught how to do said tasks. Currently, according to Bhukan, RPA is only used to perform only about 4% of software testing tasks but that is sure to change as RPA technology advances. Today, the main use case for RPA has to deal with pretty basic data entry tasks.

The reason I chose to write about Bhakan’s blog post is because I found it quite interesting; especially since I was able to relate to the growth of RPA through past experience. Over the summer I had the opportunity to work an internship at an insurance company and all the IT interns had the pleasure of getting to sit down and talk with the EVP/Chief Innovation Technology Officer and ask him some questions. I asked him what kinds of new technologies the company was looking to invest in as well as what new technologies he was most excited about. His answer to both of these questions, requiring little time to think, was, hands down, RPA. Companies today are striving harder and harder to automate as many tasks as possible in order to save money.

One of the downsides to RPA, as Bhukan points out, is that it could potentially put many software testers out of a job. Some of the things keeping RPA form taking over the field of software testing at the moment are budgetary issues (RPA software is pretty expensive), companies being reluctant to adopt such new technology, and apprehension due to the possibility of losing customers if the tests aren’t done correctly. However, I believe that software testers may just have to realign their expertise as RPA technology evolves. By this I mean that the software testing professionals/developers should begin to learn how to teach these bots and leverage the bots’ usefulness in completing repetitive tasks; after all, the bots can only be as smart as those that teach them. I think Bhukan shares this view when he says at the end of his blog post, “sooner or later we (Software testing professionals) need to upgrade our skill set to train the Robots.”

 

September 24, 2017

-Caleb Pruitt

 

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

WSU Blog #2 for CS-443

The Philosophy of Testing

This dense blog delves deeply into different types of testing and their uses. It outlines the philosophy behind software testing and explains the need for it. 

I chose this post mainly due to its sheer scope. This article covers a huge amount of content and I am confident that I will return to it often during our course. It first outlines a very different approach to the scientific method when applied to software development. The biggest understanding is that software testing is a two-way scientific method in that we design our test to verify the our code. When we discover problems, we will often adjust our code to satisfy the tests. This seems to contradict what we 

It provides a five point 

URL: http://www.codesimplicity.com/post/the-philosophy-of-testing/

 

From the blog Rick W Phillips - CS@Worcester by rickwphillips and used with permission of the author. All other rights reserved by the author.

When Object Oriented Programming (OOP) becomes POO

Something that has certainly been engrained in my programming brain is that code should be as easy to reuse as possible, and this is done through the use of objects in what is known as object oriented programming. In my very first programming class I used Java and most of the academic programming that I have done since that point has also been in Java. Java is a self-described “general-purpose, concurrent, strongly typed, class-based object-oriented language.” As a result of its object-oriented nature, one cannot learn to program effectively in Java without learning how to program in an object-oriented manner. While object-oriented programming can often allow for the efficient reuse and maintenance of code, it may also overcomplicate things in certain instances. Knowing when and where to step away from an object-oriented approach to programming can be important to creating something that is easy for others to understand and build from.

In a Coding Horror post titled “Your Code: OOP or POO?” from March 2007, Jeff Atwood explains why programming in a way that considers fellow programmers who may work with your code after you is more important than mindlessly creating objects for the sake of creating them. Atwood goes on to explain why it is the principles of object-oriented design that are truly important. These are things like encapsulation, simplicity, and the reusability of your code. Atwood stresses that if you attempt to “object-ify” every concept in your code, you will often be introducing unnecessary complexity. He uses an interesting metaphor that compares adding objects to adding salt to a dish – “a little goes a long way.”

It must be made clear that Jeff Atwood and all of the other programmers that he mentions in his post are not against OOP. Rather, they are against the abuse and misuse of OOP by those who do not understand where and when creating objects is beneficial and where it is simply cumbersome or clumsy. Object-oriented programming is an extensively powerful tool for creating projects that are reusable and easily maintained or changed. What is important to take away from Atwood’s post is that it is the way that new programmers are being brainwashed into thinking that every piece of code that they write must somehow become an object lest it be poor programming is what actually causes problems. Although never directly stated, I took Atwood’s post as a call to educate new programmers about the potential pitfalls of writing overly complex object-oriented code in place of a simpler alternative that does not involve objects.

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

Importance of Security

Source: https://blog.codinghorror.com/hacker-hack-thyself/

Recently, I read up on the blog Hacker, Hack Thyself by Jeff Atwood on Coding Horror. This blog puts an emphasis on database security and the efforts it takes to have a secure platform that can handle large threats such as a breach in the database. The point being made is that as time passes, the older generation of security must be improved to handle newer technology available to them and to the threats as well. He provides an example of the time it takes to crack passwords under the assumption that hackers will somehow get a copy of the database. This means that hackers can use various methods to crack the passwords hashes that are considered a secure way of storing passwords. One of these methods include brute force which is gated by time, that is gated by hardware. Algorithms designed for the hardware back then must be improved to meet newer security standards. The hardware in question are GPUs, if you pit the newest generation of GPUs like the GTX 10 series, or specifically the GTX 1080 Ti against older algorithms. You can see how much it blows the older gen. GPUs out of the waters. However, there are other ways to crack the hashes, which means that brute force is not necessarily the best option. The driving message behind the blog post and the title is, to secure your platform, you must first try to break into your own safeguards to patch holes in the system that you created before it’s too late.

The reason I decided to read up on this blog post regarding security would be the latest breach of the company Equifax which affected hundreds of millions of people who used their service. This subject is not entirely new to myself because of a previous CS Course that dealt with Computer Networking, Security, & Databases. Which means this blog does reinforce the idea that no security network is entirely fixed of holes and they must be improved to counteract newer technology that could pose as a threat.

One thing, that stood out to me from the blog post would be the statement that many users do not treat their email address as an important asset. I wholeheartedly agree that many users do not entirely understand the risks of having an unknown individual gain access to their email account. It is not entirely wrong to say that many users only use a single email, which means that every account on many websites that are connected to that account is susceptible to being accessed. Thinking ahead, this is a serious problem which could be prevented if they use a stronger password and newer security measures such as two-factor authentication. For myself, I use all the security measures available in each service, as well as my own. For example, every account has a different randomly generated password using as many characters allowed, with all assortments of randomization while tending to the restrictions that might apply upon creation. Which begs the question of why some services restrict certain characters from being used in a password?

From the blog CS@Worcester – Progression through Computer Science and Beyond… by Johnny To and used with permission of the author. All other rights reserved by the author.

Importance of Security

Source: https://blog.codinghorror.com/hacker-hack-thyself/

Recently, I read up on the blog Hacker, Hack Thyself by Jeff Atwood on Coding Horror. This blog puts an emphasis on database security and the efforts it takes to have a secure platform that can handle large threats such as a breach in the database. The point being made is that as time passes, the older generation of security must be improved to handle newer technology available to them and to the threats as well. He provides an example of the time it takes to crack passwords under the assumption that hackers will somehow get a copy of the database. This means that hackers can use various methods to crack the passwords hashes that are considered a secure way of storing passwords. One of these methods include brute force which is gated by time, that is gated by hardware. Algorithms designed for the hardware back then must be improved to meet newer security standards. The hardware in question are GPUs, if you pit the newest generation of GPUs like the GTX 10 series, or specifically the GTX 1080 Ti against older algorithms. You can see how much it blows the older gen. GPUs out of the waters. However, there are other ways to crack the hashes, which means that brute force is not necessarily the best option. The driving message behind the blog post and the title is, to secure your platform, you must first try to break into your own safeguards to patch holes in the system that you created before it’s too late.

The reason I decided to read up on this blog post regarding security would be the latest breach of the company Equifax which affected hundreds of millions of people who used their service. This subject is not entirely new to myself because of a previous CS Course that dealt with Computer Networking, Security, & Databases. Which means this blog does reinforce the idea that no security network is entirely fixed of holes and they must be improved to counteract newer technology that could pose as a threat.

One thing, that stood out to me from the blog post would be the statement that many users do not treat their email address as an important asset. I wholeheartedly agree that many users do not entirely understand the risks of having an unknown individual gain access to their email account. It is not entirely wrong to say that many users only use a single email, which means that every account on many websites that are connected to that account is susceptible to being accessed. Thinking ahead, this is a serious problem which could be prevented if they use a stronger password and newer security measures such as two-factor authentication. For myself, I use all the security measures available in each service, as well as my own. For example, every account has a different randomly generated password using as many characters allowed, with all assortments of randomization while tending to the restrictions that might apply upon creation. Which begs the question of why some services restrict certain characters from being used in a password?

From the blog CS@Worcester – Progression through Computer Science and Beyond… by Johnny To and used with permission of the author. All other rights reserved by the author.

On Exploratory Testing and ‘Playing About’

A thought that occurred to me recently while following procedures for testing using the boundary value testing method is, “What would happen if I tried values for inputs of an incorrect type rather than whatever values the particular testing method called for?” While simple test procedures such as normal boundary value testing clearly leave much to be desired, more comprehensive testing methods such as robust equivalence class testing seem to cover most of the potential sources of input errors, right? I think not. It was often difficult to fight my intuition and desire to choose test values that did not necessarily line up with the testing procedures covered in boundary value or equivalence class testing procedures. This desire to choose what to test and how to test it based simply on experience and intuition is whats known in the software quality assurance field as exploratory testing, and it is an extremely powerful method of testing when used properly and appropriately.

In a Let’s Talk About Tests podcast titled “Players gonna play play play play play,” from September 21, 2017, Gem Hills talks about the benefits of getting familiar and gaining a better understanding of a program simply by “playing about,” with the program itself. Hills argues that sometimes simply using the program and applying knowledge from previous experiences with similar programs or with the development team itself can often provide a software tester with potentially revealing test cases that would be missed if the tester was relying solely on a testing framework. In her post, Hills references Richard Bradshaw, perhaps better known as the “Friendly Tester.” Specifically, Hills talks about attending one of Bradshaw’s talks at the BBC in August where he spoke about how “having a play” with a program can become far more impactful by simply recording the results and tests, effectively turning this play into exploratory testing.

One of the reasons that Hills cites for playing with a program with no real agenda is that, “[She] is not confident that [she’s] tested everything but [she’s] not sure what [she’s] missing.” I found this point especially telling. This is exactly how I felt when I was writing test cases for the boundary value testing assignment, as if I was sure that I was missing something, but unsure as to exactly what it was that I was missing. It would therefore seem to make sense to me that I should begin playing around in an attempt to discover what it is that I am missing. Perhaps it is simply that I am lacking the appropriate testing method, and performing some exploratory testing provides insight into an effective method. It is possible, however, that a bug exists in the program that cannot be found by applying any number of testing procedures. In these cases, exploratory testing, or “playing about,” is the only effective testing tool.

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

WSU Blog #2 for CS-343

URL: http://blog.gatherspace.com/2011/08/10-tips-a-use-case-template/

This blog provides ten approaches to common tasks when using UML based design.

From the blog Rick W Phillips - CS@Worcester by rickwphillips and used with permission of the author. All other rights reserved by the author.