Category Archives: Week 11

Types of Testing

There was an article I found the other day that took a different approach on types of testing.  The article is from ITpro, a site based out of the United Kingdom (http://www.itpro.co.uk/software-development/29994/types-of-software-testing).  The author breaks down nine different types of testing.  The article doesn’t try to state that the types are exclusive and that you should pick one or two and use those types.  Instead it just breaks down the different types, the different times they are carried out, and who carries out these tests.  Some are performed by the software testers during development and some are performed by the user to test different aspects.  For example alpha testing is performed by the software tester before release to search for all possible issues and errors.  Whereas beta testing is performed by the user in a deployed environment.  It can be as controlled and closed off to as group of a desired size in order to test for real time failures.  The control group is to ensure that it is not widely deployed across an environment and causing business failures.  Beta testing is similar to acceptance testing which is performed by the customer to ensure the product meets all requirements and expectations set by the user and the developer.  There is also a type of testing called security testing.  This type is performed by a special team outside of the standard testing team and usually performed by security consultants.  It is usually done to find out if there are flaws in the software that can allow it to gain access to computers or networks that it shouldn’t be able to and could cause damage to these networks.  Another specialized type is stress testing.  This is performed to push the software to its limits and usually beyond the normal operation that the standard user will put it through.  This is used and needed to get a clearer picture of what your software can do and what the limits are.  The one type that stood out to me the most and struck my interest was smoke testing.  This is done when a new build is sent to the testing team.  Simple tests are performed to find out if it crashes the program indicating bigger issues.  It makes sense to do, before digging deep into tests to just run quick simple tests to see if it can even pass that stage.  It just never occurred to me to make sure to do this step first before fully jumping into alpha testing.  I think that reviewing the different types of tests every once in a while to remember that there is a full spectrum of testing and how important the testing process is to software development.

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

A SOLID Foundation

https://softwaredelivered.wordpress.com/2013/06/03/way-to-patterns-even-more-solid/

Linked above is the article I used for this week’s professional development blog post.

 

This week, in a continued effort to improve my fundamentals with Object orientated programming, I reviewed the five principles of SOLID.  In doing so, I found a popular resource.  The reason I chose this one for review though is that it cover’s every principle.  And, each principle comes with examples in code and explanations of how the principles should be applied to programming.

Having all of the SOLID principles explained in a single place was attractive because I had no exposer to them before this class.  This also means that nearly all the information within the web page was new to me.

Similar to the principles of GRASP, SOLID is fundamental to designing and writing code.  It’s five principles (Single-Responsibility principle, Open-Closed principle, Liskov substitution principle, interface segregation principle, and Dependency Inversion principle) all contribute to making code much easier to refactor.  Adhering to these principles means the subsequent software will be easier to maintain and extend.  This is vital because all software I produce will need to be refactored.  Both before and after it’s “finished.”  So, for both my sake, and any other developer, it’s worth making sure I’ve understood these principles well.  After reviewing and learning what each principle was, again just like GRASP, I was able to see how my past projects have embodied these principles.  In fact, many times I was working with towards achieving these principles with my projects or working with them in mind without knowing they had a pneumonic device.  In fact, many of the mottos of Object Orientated design are expressed in SOLID.  Take the first principle of SOLID, Single-Responsibility.  Simply put, it means any class or module should be only concerned with a singe part of the program’s functionality and that the functionality should be encapsulated. This immediately reminds me of “encapsulate what varies.”  Adhering to this principle makes the code a lot friendlier to refactoring since a class would only be concerned with a single function or behavior.

Just like the first, all of the principles are the foundations to good code practices and many common design patterns.  With this being the case, I can see that this is a subject I know in my sleep.

 

 

From the blog CS@Worcester – W.I.P. (Something catchy) by aguillardcsblog and used with permission of the author. All other rights reserved by the author.

Encapsulation, More Than Data Hiding.

For my last blog, I revisited the important concept of polymorphism. For this post, I decided to revisit another important concept, encapsulation. I wanted to find a similarly formatted article/blog post to the one I found for polymorphism, but wanted to get a different perspective from a different resource. I wanted a source that still mixes in code examples,

Let’s start with the definition of encapsulation. Encapsulation is the ability to package data and related behaviors, in an object. This also includes the access permissions for the behaviors within the object. Encapsulation is often used a synonym for data hiding, but it’s important to acknowledge that while encapsulation includes data hiding, this isn’t all that encapsulation is. Everyone thinks of encapsulation as the concept of public versus private variable types. The concept of encapsulation does include this concept, but this is only one area that relates to encapsulation. When creating a new class, encapsulation should be a top priority. This is because with encapsulation, maintainability is drastically increased.

To further explain that encapsulation is not only data hiding, the article uses a classic coding example, an animal class. The class contains several attributes (name, type, height, color) and behaviors (hunt, run, mate, getName). Encapsulation is more than just making sure the attributes are private, it is about bundling the attributes and the related behaviors within one class. We could have the hunt, run, mate, and getName behaviors all in separate classes theoretically, but this would just be poor design. The article also notes that encapsulation is not about getters and setters. While these behaviors are related to the attributes, the authors wanted to make sure readers didn’t confuse encapsulation with this concept. Encapsulation does include getters and setters, but they are not the focus, instead we should focus on the behaviors that return a different value depending on the attribute, instead of just returning the attribute or setting a new value for the attribute.

To explain how I would use this in the future, why not explain how I would expand upon the code example used in the article? This code example in the article only includes hunt, run, mate, and getName for behaviors. If we wanted to add a speak functionality to our animal, we would use encapsulation. This might mean adding a new private variable, but also would include adding a new method that depends on an attribute or several. This behavior and additional attribute(s) would be added to our animal class to encapsulate the data and behaviors, and ensure the best maintainability for our codebase.

I found this article to be simple but powerful. It’s easy to forget that encapsulation is more than data hiding. Encapsulation is one of the major concepts of object oriented programming and complete understanding is necessary for success. I’m sure I’ll get interview questions regarding this topic in the future.

The original article: https://javapapers.com/core-java/java-encapsulation/

From the blog CS@Worcester – Learning Software Development by Stephen Burke and used with permission of the author. All other rights reserved by the author.

Approaching Complex Code

So for this week, I have decided to read “Code Smells: Too Many Problems” from the Jet Brains and Intellij Idea blog. The reason I have chosen this blog is because while I have my experience of parsing codes, I do need another way to approach complexity. It will help in figuring out the simplest step to take first when there is complexity in coding and not be overwhelmed by it.

This blog post basically goes over three approaches that is figuring out how to tackle complex code. Each of the approaches have their pros and cons. The first approach is simple but effective to do and that is break down the method into smaller sessions. While it might help for methods with multi responsibilities, it does not make some other smells more approachable to work with. However, it also does help in determining when is the right time to refactor.  Second approach is to work on one smell at a time. It is a variety of steps that the author has showed to get this point for the series of code smells. This is the less risky and easier to reason approach that gives simpler code. The third approach is to step back and try to model the problem. Instead of looking at individual smells or individual lines of code, this approach introduces new domain objects to model what is happening in the code. It encourages a bit of redesign and may lead to new classes that can help with other areas of code, but be aware that it will have the same problems as the other two approaches if not used carefully.

Based on the contents of this blog, I would say this was a pleasant read on getting started in tackling complex code. The author was able to show how the approaches work with a sample code and addressed the drawbacks from it. It was easy to understand and has the What I did to getting started is to write down one method at a time and try to refactor it based on the design it has been used on. Sometimes I would try to write down comments if I do need to have a clear reminder of what I’m trying to do while refactoring.

What I learned from this blog is that if breaking down the methods and refactoring happens to lead to an inconvenient end, then perhaps undoing a few steps back is not a bad idea. The idea I have gotten from this blog is that all the tests should pass, and commits should be small, but very frequent. This helps in making sure that it is easy to stay back and not having to be in a place that can lead to a complete halt. For future practice, I shall try to use the rule of three that will help in determining if a method is needed to be broken down into smaller pieces.

Link to the blog: https://blog.jetbrains.com/idea/2017/09/code-smells-too-many-problems/

From the blog CS@Worcester – Onwards to becoming an expert developer by dtran365 and used with permission of the author. All other rights reserved by the author.

Video Game Career Tips

I love video games and the prospect of making a career out of them has always been a dream that I believed too good to be true. However, the game industry has been on the rise for decades and increasingly proves to be a real career choice with the added benefit that even a small team can produce something that stands out. With this dream in mind, I’ve read the following article on how to get started in the game industry with advice and interviews from current game developers.

https://www.theguardian.com/technology/2014/mar/20/how-to-get-into-the-games-industry-an-insiders-guide

The first question asked to the panel is “What is the best way to start making game?” To which many emphasized the importance of learning the basics of coding. While some game development tools allow you to get started with little coding knowledge, its unavoidable that you eventually learn a programming language or two, C++ is recommended specifically. Game developments tools such as unity, RPG maker, and game maker studio help significantly with transferable concepts of what goes into making a game.

Another question was “If someone is looking to set up a small studio themselves – what advice would you give them?” A few panelists strongly advised not starting a studio early on and that a better choice would be getting experience in an already established studio before gaining the confidence to branch off on your own. However, if you were to start a studio you absolutely need a great programmer as well as an artist. Also it is very important that you have a team member who knows the business of the industry. Byron Atkinson-Jones shares that “the making of the game, that’s actually the easiest part. Managing things like business finances, making sure you can all eat regularly, marketing, PR, legal stuff, QA and selling the game once it’s done are the hardest.”

The next question asked was “Are there any key skills that people should have or things they should know that aren’t obvious or aren’t taught on design/coding courses?” To which many of the panelists stressed the importance of communication within a team. Learning to be a nice person while being open to criticism for the sake of the project are invaluable traits that cannot be taught in schools. You could be very skilled and experienced but if you don’t get along with group members and refuse to communicate effectively, your project will suffer greatly.

The last question ill go over in this post is “Is a degree in computer games programming or design a necessity?” The short answer from most of the panelists is no, you can go a long way with passion and devotion to video games as long as you have the portfolio to back it up. Aj Grand-Scrutton expresses that “a degree is effectively gravy compared to an actual portfolio” emphasizing that real experience dominates over just having a degree.

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

Re: Angular, TypeScript and Final Project

My teammate and I are currently working on a Blackjack card game, which we will present to our class during finals week. I’ve spent the last few weeks trying to become more familiar with Angular and TypeScript for this project, and I believe I am starting to make some good progress. For instance, I have figured out how to build a card deck, shuffle it, and display images of these cards to the user.

There is a great online instructor named Mosh Hamedani with a series of tutorial videos for both Angular and TypeScript. I’ve already watched several of his videos and found them extremely useful and informative. The instructor has a personal blog as well. I would like to discuss one of his blog entries in particular, entitled Angular 4 in 20 minutes.

First, a disclaimer. I certainly did not learn Angular in 20 minutes, but Mosh’s insight and clear explanations are helping me understand Angular and TypeScript concepts more than any other tutorial I’ve tried so far. 

Mosh’s blog entry is a synopsis of one of his free tutorial videos, which is approximately two hours long. I’ve watched the entire video twice already and I believe it is definitely worthwhile to anyone who is trying to learn Angular and TypeScript. Here are a few important points that Mosh brings up in his video synopsis:

He explains that Angular is a framework for building applications in HTML, CSS and TypeScript/JavaScript. He also answers the question of why a developer would want to use Angular rather than other alternative methods. I have to agree with Mosh here that learning TypeScript with the Angular Framework seems a whole lot easier than, as he puts it, “vanilla JavaScript.” I believe this is due to the “IntelliSense” offered within Angular and TypeScript which is currently unavailable in JavaScript alone. When comparing TypeScript code side by side with JavaScript, in my opinion, the former is much easier to understand than the latter.

Mosh also goes through a step-by-step process on how to install everything needed to run the Angular framework, including how to create a new application project from the terminal. Next, he uses MS Visual Studio to go through the project layout and explains every single file that was created, including their functions and purposes. He then demonstrates how to generate new components within the project and how to connect them with the main application module.

The free video posted in Mosh’s synopsis blog entry is part of a 30+ hour long Udemy course video compilation that typically costs at least $200. Fortunately, there is a great “Black Friday” sale going on where I was able to purchase this entire course for just ten dollars. I feel I am making great progress in learning Angular and TypeScript; I honestly believe it would have not been possible without his videos and blogs. I am certain I will continue to reference Mosh’s insightful blog entries and tutorial videos, and apply what I’ve learned from him during my professional career.

 

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

#7_343

From the blog CS@Worcester – Not just another CS blog by osworup007 and used with permission of the author. All other rights reserved by the author.

#7_443

From the blog CS@Worcester – Not just another CS blog by osworup007 and used with permission of the author. All other rights reserved by the author.

Web App Testing

Since we (Me and Dan) are working as a team to build a web app (Remote Team Builder) for our final project in 343 class, I thought to learn how to test web apps would be essential. So, this week I read an article on Software Testing Help site, which was a guide about testing web applications.

As per the author, these are the most common web testing checklists:

1) Functionality Testing

Test for all the links in web pages, database connection, forms used for submitting or getting information from user in the web pages, Cookie testing etc.

Cookies Testing: Test the application by enabling or disabling the cookies in your browser options. Test if the cookies are encrypted before writing to user machine. If you are testing the session cookies check for login sessions and user stats after session ends.

Validate your HTML/CSS: If you are optimizing your site for Search engines then HTML/CSS validation is the most important one. Mainly validate the site for HTML syntax errors. Check if the site is crawlable to different search engines.

Database testing: Check for data integrity and errors while you edit, delete, modify the forms or do any DB related functionality.

2) Usability testing

Test for navigation: Navigation means how an user surfs the web pages, different controls like buttons, boxes or how the user uses the links on the pages to surf different pages.

Content checking: Check for spelling errors. Usage of dark colours annoys the users and should not be used in the site theme. You can follow some standard colours that are used for web page and content building.

3) Interface testing

Check if all the interactions between these servers are executed and errors are handled properly. If database or web server returns any error message for any query by application server then application server should catch and display these error messages appropriately to the users. Check what happens if user interrupts any transaction in-between? Check what happens if connection to the web server is reset in between?

4) Compatibility testing

Compatibility of your website is a very important testing aspect. See which compatibility test to be executed such as Browser compatibility, Operating system compatibility, Mobile browsing, Printing options.

5) Performance testing

Web Load Testing:  You need to test if many users are accessing or requesting the same page. Can system sustain in peak load times? Site should handle many simultaneous user requests, large input data from users, simultaneous connection to DB, heavy load on specific pages etc.

Web Stress Testing: Web stress testing is performed to break the site by giving stress and its checked as how the system reacts to stress and how it recovers from crashes. Stress is generally given on input fields, login and sign up areas.

6) Security testing

Following are some of the test cases for web security testing:

  • Test by pasting internal URL directly onto the browser address bar without login. Internal pages should not open.
  • If you are logged in using username and password and browsing internal pages then try changing URL options directly. I.e. If you are checking some publisher site statistics with publisher site ID= 123. Try directly changing the URL site ID parameter to different site ID which is not related to the logged in user. Access should be denied for this user to view others stats.
  • Try some invalid inputs in input fields like login username, password, input text boxes etc. Check the systems reaction on all invalid inputs.
  • Web directories or files should not be accessible directly unless they are given download option.
  • Test the CAPTCHA for automates script logins.
  • Test if SSL is used for security measures. If used proper message should get displayed when user switch from non-secure http:// pages to secure https:// pages and vice versa.
  • All transactions, error messages, security breach attempts should get logged in log files somewhere on the web server.

Although it was a quite a lengthy article, I enjoyed reading it. We may not get time to test every aspect of our web app, but I will definitely keep on eye on the security aspects. In our web app we have a login in screen for the members of a team. I will test the method as suggested in the article to browse internal pages then try changing URL options directly. I think it would be a fun to include CAPTCHA security measures to prevent automates script logins.

Source: http://www.softwaretestinghelp.com/web-application-testing/

 

 

From the blog CS@Worcester – Not just another CS blog by osworup007 and used with permission of the author. All other rights reserved by the author.

The Software Craftsman 7 & 8 Week 11

The first part of the reading talks about adapting technical practices and getting other developers or managers on board. Just telling developers or a manager that your going to be using something like TDD might make them question that practice because it will end up taking longer. What should be done is ask questions like do we want this to be bug free or do we want the code clean. Then once they see the advantages talk about what technical practices to use.

The second part of the reading goes on to say that the goal of being a software craftsman is to find pleasure in your work. Purpose and mastery are ideal characteristics when looking for a job, but that cannot always be done. The more experienced you become the easier it is to find jobs like this. To find this you need to know where you are in your career and work to where you want to be, nobody else can do this for you.

From the blog CS@Worcester – Software Testing by kyleottblog and used with permission of the author. All other rights reserved by the author.