Ludwig Van Beethoven

Don’t only practice your art,
But force your way into its secrets,
For it and knowledge can
Raise men to the divine.
— Ludwig Van Beethoven.

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

Song of the Open Road

Afoot and light-hearted I take to the open road,
Healthy, free, the world before me,
The long brown path before me leading wherever I chose.
Henceforth I ask not good-fortune, I myself am good-fortune,
Henceforth I whimper no more, postpone no more, need nothing,
Strong and content I travel the open road.

 

You road I enter upon and look around, I believe you are not all that is here,
I believe that much unseen is also here.
Here is realization,
Here is a man tallied — he realizes here what he has in him,
The past, the future, majesty, love — if they are vacant of you, you are vacant of them.

 

Gently, but with undeniable will, divesting myself of the holds that would hold me.
I inhale great draughts of space,
The east and the west are mine, and the north and the south are mine.
I am larger, better than I thought,
I did not know I held so much goodness.
All seems beautiful to me.
— Song of the Open Road, by Walt Whitman.

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

Understanding the Simple Factory Idiom

The goal of the simple factory idiom is to separate the process of creating concrete objects to reduce the dependency of the client from the concrete implementations.

To implement the simple factory we need three things:

  1. A factory, the pizza factory.
  2. The products the factory makes which are the pizza objects.
  3. The client that uses the factory, which is the pizza store.

So, let’s take our pizza creation code, encapsulate it, separate it. And we’ll encapsulate it in a class called Factory.

1

Why a Factory? Because this is a class whose sole responsibility is creating pizzas — it’s a pizza factory.

To do that we’re going to take this conditional code for creating pizzas and put it into a separate class, in a method name createPizza. Each time we want a pizza, we’ll call the method, pass it a type, and the method will make a pizza for us and return an object that implements the pizza interface.

Capture.PNG

Now all this creation will be in a separate class, nicely separated form the restaurant code. So, let’s integrate this with our client code or restaurant code. Let’s assume that we’ve created a factory object already. And call it to create the pizza, passing it the type variable.

1.png

Our order pizza method no longer has to worry about the concrete type of the pizza. It could be a veggie pizza, a cheese pizza, or a pizza we haven’t even heard of yet. We know whatever type gets returned by the factory, it implements the pizza interface. And that’s all we care about.

So we call this object design the simple factory idiom.

1.png

We start we the client of the restaurant, the pizza store. And then we have our factory. The factory is the only place the concrete types of pizzas are known.  And then we have the products, what the factory makes or pizzas, and there could be many concrete types of those.

To generalize this a bit, we could look at the same diagram without pizzas.

1.png

And here we have the client, a factory, and a set of products that implement a common interface.

Now, one thing to note. This is not a full fledged official pattern. It is more of an idiom that’s commonly used. That said it is the first step to understanding some of the more common design patterns.

And now we’ll put everything together in a main class called the pizza test drive  which will create a pizza store and use it to create pizzas.

Capture.PNG

 

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

Using Old Test Documentation

When a new feature needs to be tested on a program sometimes testers will use old test documentation of a similar feature to help create tests. This is not an ideal way to create tests. I was unaware people did this and I thought it was a good idea until I did some more research.

Old test documentation gets out dated very fast. Testing is improving and changing constantly so using an set of tests might not be the best way to create a test. Also the program and environment may have changed, if this is true the old tests will not be helpful. So I’ve found that in most situations tests should be created from scratch to avoid any issues and also use technology that’s up to date.

http://www.testthisblog.com/2016/03/start-from-scratch-vs-old-test.html

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

Testing vs Checking

What is the difference between testing and checking? Some people may say it is the same thing, but there are some large differences. For example a human cannot perform checking, only a tool or machine can do that.

I did not realize there was a difference between testing and checking but upon reading this blog post and doing some research I found that there is one main difference. Testing is something humans do, when we analyze a program and create tests based off what we have learned, this is testing. Checking is something that a tool does to check a program. Checking is done one way by using algorithms to run through a program and perform checks based on the algorithm. That is the most important difference between the two, they both cannot be the same.

http://www.satisfice.com/blog/archives/856

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

Debugging (Week 3)

Debugging is something that has been used in my studies, but some have not been properly introduced to this topic. So this post is meant to share some basic information on debugging and some techniques that can be implemented to help exterminate those pesky bugs.

Technopedia.com gives a formal definition of debugging as “The routine process of locating and removing computer program bugs, errors or abnormalities. Debugging checks, detects and corrects errors or bugs to allow proper program operation according to set specifications.”

The number one technique that can be used is print statements. Inserting a print statement into a segment of code that could be the problem would give a fast response letting the coder know what part of the code wasn’t executing correctly. Print statements are one of the easiest and fastest ways to find what is wrong with a program. When there are too many print statements a logging system can be implemented.

Another method of debugging is to use a debugger tool. Some environments have these tools built in. This tool allows a programmer to step through the execution step by step. This allows the programmer to see exactly what variable or method is being called and the value before and during and after execution.

A program will never only have one bug. This is why a bug tracker can be useful. When  one bug is fixed it could cause something else to break, and cause a huge avalanche. When the programmer is done cleaning up there could be 100 fixes implemented. If there is no log to show what bugs were fixed that fix could later on cause more problems. This is why it is useful to keep an accurate bug log.

A few other techniques such as proper documentation and code comments are also just as vital to the debugging phase but those are more self explanatory.

This blog post Hackable Projects – Pillar 2: Debuggability explains a few ways that google helps to aid their developers in the debugging experience. The theme of this post is that you need to build the ability to debug into the software you code. They mention debugging on a localhost, on Mobile apps, and on real time systems. Some of the tips they mention are proper logging, monitoring, and statistics.

But after all this by far the technique that has helped me the most is Rubber Duck Debugging. This approach has the programmer explain out loud to someone or an inanimate object, like a rubber duck, step by step how the code should function in simple terms. This technique makes the coder think in a different way about their code. Most likely they will trip up and find the mistake during the explanation.

More information on debugging can be found here or here or here.

From the blog CS@Worcester – Conundrums In Computing by patrickgrahamblog and used with permission of the author. All other rights reserved by the author.

Mutation Testing

What is mutation testing? According to STH team member Swati S,

Mutation testing is a fault based testing technique where variations of a software program are subjected to the test data-set. This is done to determine the effectiveness of the test set in isolating the deviations.

Examples of mutation operators

  • Arithmetic operator replacement
  • Logical connector replacement
  • Statement removal
  • Relational operator replacement
  • Absolute value insertion

How Do You Know If Your Data Set Is Effective?

You know that your data set is effective if it kills all mutants. This means that when you plug in a data set value into your program, you should expect the output to give you an error.

 Mutants To Avoid

Incorrect Syntax: Mutants need to be syntactically correct.

Ex. If age%%14 (incorrect syntax)

Equivalent mutants

Ex.  If age> 14 & age>14 ‘means the same thing as age>14’

Trivial Mutant

Ex. ‘remove the doctor assignment statement’

Read More

 

 

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

Determining how long it will take to test.

When it comes to estimating the amount of time a project will take one must consider the subproblem, how much time will it take to properly test the code. This turns out to be a very difficult task. There are so many variables that influence testing time.

One of the large factors in determining how long it will take to test a particular project is the team. How large is the testing team? How often does the team work together? Do members come and go? What is the skill level of each of the members? Is this the teams only task? All of these questions affect how efficiently a testing team can work together which in turn can help determines how long testing will take.

Another large factor in figuring out testing time is the complexity of the code. Obviously the more complex the code the more complex the testing process. Some programs just need to be tested to show the can take in a set of data and properly process it. Other programs have many possible paths though the code and each one must be tested.

The quality of the code that needs testing plays a role in the testing process as well. If the development team produces high quality code that is not laden with bugs the test process can move faster, but if there are many errors in the code the test team may be held up as the developers work out the bugs or will need to take the time to correct the errors them selves.

You must also keep in mind the importance of an error free program and the consequences of errors. Based on the answers to these questions you can determine what level of coverage is required. If the code is for a piece for medical equipment or part of a flight control system the consequences can be very severe. Cases like these obviously demand much more attention than the code for, say, a video game.

To actually start putting a number on the time for testing, it is a good idea to start logging data for each project. This data can then be looked at to help predict future projects. It can also help to show areas where the process can be bettered which will lead to a more efficient process and shorted estimates.

Original article: https://www.stickyminds.com/article/why-estimating-software-testing-time-so-difficult

From the blog CS@WSU – :(){ :|: & };: by rmurphy12blog and used with permission of the author. All other rights reserved by the author.

What to Do When Chrome Drops Support for Your REST API Testing (Week5 – Oct. 21)

According to Michael Giller’s blog, published on October 5, 2016, Google has announced that it will be terminating support for apps in the Chrome browser on Windows, Mac and Linux. This announcement will affect any user interacting with REST API. I guess this is another approach by the giant tech corporation to sell more of its products by scaring consumers who are using apps like Postman, Advanced REST Client, and Boomerang in the Chrome browser. Google has given July 2017 as the last date to be fully executing this decision. What are some of the alternative options for the users who have been using Chrome browser for apps on Windows, Mac and Linux. It turns out that users have three possible options.

Frist, which is the most obvious and no brainer, but costly, is to buy Chromebook. Chromebook has Chrome OS and it is Google’s own product which will come with all these capabilities and users will not have to worry about anything. I believe, this is what Google wants too. I think Google strategy is to market its Chromebook by restricting and providing some feature strictly to Chromebook. We know from history; this is what Microsoft did back in the day when Netscape came out by providing Internet Explorer as a package with Microsoft Windows. This might not be the exact same situation, but the goals are similar.

Second option that consumer has is to move from Chrome apps to corresponding standalone app for testing REST APIs. Right now, Postman is the only one who provides a standalone app for Mac and Windows, but Advanced REST Client has promised to publish its own standalone version soon. So, this can be another possible options for the consumers who are depending on Chrome apps for testing their REST APIs. By going with this option you might have to go through some hassles and that would be that previously everything that were handled by Chrome your standalone app has to provide all those functionalities. For example, the standalone app has to manage its own authentication and connectivity, Proxy auto-detection, web form authentication, cookie handling, support for IPv6 and HTTP 2.0 protocols.

Third option is to switch to another API testing. There are plenty of free and open source tool like SoapUI and Ready! API both of them are great alternatives to Chrome apps that can increase your API testing experience. Here are some of benefits you can get from SoapUI:

  • TestCases in SoapUI (same as Collections in Postman) allow you to string together calls for REST APIs, JDBC and SOAP. This will let you validate the backend data and any SOAP to REST migrations
  • Convert your SoapUI TestCases to a load test in a few clicks

Set up security tests against your API

  • Easily mock up / stub out / virtualize an API to get particular responses or start API interactions before a real API is available
  • SoapUI is available across all operating systems and your projects can be shared and run in any major operating system (Giller)

These functionalities can be even taken one step further by adapting Ready! API. This platform has more functionality and tools than SoapUI. Here are some of the extra tools that Ready! API includes:

  • Configuring your tests against external data sources
  • Advanced reporting
  • Load testing, security testing, and service virtualization
  • Professional support and other enterprise features (Giller)

Google’s decision of limiting Chrome apps functionality to Chrome OS is an inconvenience for many users who are using REST APIs and Chrome apps for a long time. It will not be easy to make a quick adaption to another API or tool, but the good news is that we have alternative options that are in some cases better and free. We should definitely at least consider those options and if possible adopt them.

 

For actual article read please visit:

What To Do When Chrome Drops Support For Your REST API Testing

 

 


From the blog CS443 Software Quality Assurance & Testing – Computer Science World by Haider Hussain and used with permission of the author. All other rights reserved by the author.

Week 5 – 6 Tips For Making Time to Test

Here are 6 tips to make sure that you have enough time to properly test your code as provided by Swati S. in her blog What To Do When There Isn’t Enough Time To Test.

  1. ESTIMATE ACCURATELY – Overestimate the amount of time each step is going to take.  Do not forget to take into account your team, tools, and processes.
  2. HISTORICAL DATA – Swati suggests asking the following questions:
  • How long did the earlier release test cycles take?
  • What kind of issues caused interruptions to the previous test cycle?
  • How many runs did most test cases take before they passed?
  • What defects were reported?
  • What defects caused the testing to be interrupted?

3. ASK THESE QUESTIONS – Swati suggests asking the following questions:

  • Find out Important functionality is your project?
  • Find out High-risk module of the project?
  • Which functionality is most visible to the user?
  • Which functionality has the largest safety impact?
  • Which functionality has the largest financial impact on users?
  • Which aspects of the application are most important to the customer?
  • Which parts of the code are most complex, and thus most subject to errors?
  • Which parts of the application were developed in rush or panic mode?
  • What do the developers think are the highest-risk aspects of the application?
  • What kinds of problems would cause the worst publicity?
  • What kinds of problems would cause the most customer service complaints?
  • What kinds of tests could easily cover multiple functionalities?

4. USE A TEST MANAGEMENT TOOL – This will reduce the amount of time testing takes             at every stage of the process.

5. DON’T REINVENT THE WHEEL – Make sure to look at the Unit test results to                            determine whether or not the build was a success and to see which tests failed.                        Reviewing the results will ensure that the same errors are not repeated.

6. MEASURE YOUR PRODUCTIVITY – Pay attention to the goals that you set and make                sure they are obtained.  If your goals are not being achieved, reevaluate the time                      allotted for those goals.  Consequently, if you are achieving goals at an accelerated                  rate, reevaluate the time allotted for those goals.

From the blog cs443 – TayNock's Blog by taynock and used with permission of the author. All other rights reserved by the author.