Ben Weese

What is Unit Testing? Part 1 of 2

So I have mentioned Unit Test quite a few times but what are unit test? According to a quick google search  “unit testing is a software testing method by which individual units of source code, sets of one or more computer program modules together with associated control data, usage procedures, and operating procedures, are tested to determine whether they are fit for use.” Wow that is quite wordy so lets break it down.

I am just now learning how to write unit test for my company. A lot of developers do not use unit test or TDD. Also it is fairly new to the Apple world as Xcode just added testing in Xcode 6 which was released September of last year. So back to our original question. What is Unit test? Well it is testing  the basics of a code of you want to test an add function how will you do it. Well you input values then run them through the add function and compare the answer to the correct answer. That is what a unit test does it implements the function and then test if it has the correct output. This is for basic test so that your qa can focus or bigger bugs when usability testing.

Picture

Next week I will go over how to write a unit test in the second part of this blog post. Also last week Test Reactor went over Zombies and Zombies in the Code. Talking about what zombies are in pop-culture as well as what QA will need to know about Zombies in the code. This week we will be going over story boarding and what QA needs to know as story-boarding is part of the agile environment. So check it out at TestReactor.com. You can also find us on iTunes and most podcast apps.

5 QA Gifs

Picture

When QA is alerted of a new build or project

Picture

How QA feels about new builds

Picture

When the Developers say their code is perfect

Picture

When you finally nail the cause of the bug

Picture

When you hit a crash you knew would be missed

Test Reactor Online

Joe and I have just released our first podcast of Test Reactor. You can find it at testreactor.com or for iTunes people at https://itunes.apple.com/us/podcast/test-reactor/id990641984 . The first episode does not have much test related stuff but the future podcast will.

How Testing Can Be used In Everyday Life

So you are a Software tester by trade but how does that affect the rest of your life. Well weather you know it or not you test everything you are given to see if it meets your standards. Personally every time i get a new item or software I test it out for Quality. That is how I am wired but I only do Ad-hoc testing. Ad-hoc testing anything you get is good to prove you got what you paid for but when is it important to run a test plan and a thorough test. This is important in major purchases and life saving devices. Like buy a car seat or a car you will need to test them thoroughly. 

With a big purchase you may even want to run preliminary testing. Such a s a test drive with a car or researching with reviews. You want to understand everything about what you are going to purchase. My dad drilled this into me in a early age and it seems to me that all testers would want to do the same. This is testing for your purchases and not just the purchases of your clients. Why don’t you demand Quality in the things you buy? Also I am sure when you make something you will test it as well. This is just our nature but knowing that maybe you can test your life and figure out how to make it a quality life. 

This is a basis my co-worker Joe and I are working on and we hope to get a podcast up. We will be testing all nerd things. Bring 2 worlds together. Check out www.testreactor.com in the future for podcast. 

The Future of Testing

So I started out and still work today testing desktop software using no coding. There are still jobs out there that require you to be a user and test their desktop apps. With an ever growing and changing industry is this still viable? Currently it is viable but with everything changing into apps and websites how much longer will desktop apps last? When going through freelance testing the majority of jobs are in websites and mobile apps. Testing blogs are even turning to them as well. Even a company I am familiar with that has grown as a desktop app is soon be moving to a web app in order to stay alive.

Another thing is that automation is becoming bigger and bigger and in a desktop society this is not viable. The application can move which means the UI recorder is hard to keep up with something that can be moved around the screen. However websites and mobile apps are locked into their screens and so you can use automation to test the sites and apps. Testers are now being expected to know how to write these automation test. They are also expected to write and know unit test. This is nice to know but your developer should be using TDD therefore the developers should be writing test first and coding to meet the test they wrote but a lot of Dev are still against TDD. 

So for your future in testing I suggest you pick up how to test websites, mobile apps, and writing automation. Who knows what the future of QA will need in the future.

Exploratory Testing Misconception

So not to long ago James Bach posted these 2 blogs, Exploratory Testing 3.0 and History Definitions of ET. If you have not read them you should. They tell of the history of Exploratory Testing from the beginning to the now and how the meaning has changed over the years. So the misconception is that most people still believe that ET is ad-hoc or the same as it was when first defined. It has changes definitions over the year and that is why you should check out the articles. Think of 1.0 as you are in a search for Waldo but you don’t know where he is so you look for him. At first you might not have a plan you just want to find him. So your eyes are exploring the page for him and you might find him. In the case of bugs you are sure to hit one or two you haven’t hit before his way because it is a different way to look for bugs but it is not that efficient.
So now we are looking for Waldo and guess what happens after you explore for him for so long. You develop a pattern you may not be running a scripted test but you mind is now running it’s own. With this test you find Waldo as well as other bugs. but you thought you were practicing ET when in reality you just scripted your own brain. So what is ET 3.0 how should we be testing?
Well all testing is exploratory, it is defined to be all testing now. If you are looking for a bug or Waldo weather looking using a script or looking in the woods with a flashlight you are exploring for him. So what should you be practicing if you want to exploratory test. Well think or ET as a mind set you write your script and as you are running your script think outside the box. Use the 2 in conjunction with each other. This will allow you to be a better tester. You write the script so you test what yo need and you also use that script to remind you to think outside the box. The script can remind you of things you might not have thought of and it can also point out the things that may need ET. Use all your tools available to you and you will find those Waldos.

5 GIFs for QA

Picture

When you get a new build and it crashes on login

Picture

Exploratory testing when you hit a new bug

Picture

When you hit a new bug that was not there before

Picture

Testing a new feature without unit test

Picture

When you get a new feature to test

Context Driven Testing

James Bach stated “Obviously, CDT is not the only paradigm. There are others. Obviously, I think CDT is the only reasonable one,” on twitter during UTest’s Tweets from James Bach. He also said “Context-Driven Testing means learning your craft, so that you know how to solve problems that arise in it.” When asked about other schools he stated “Yes. The Analytical and Agile Schools are real testing, in my opinion. I think CDT is better, though.” So what is CDT?
The Seven Basic Principles of the Context-Driven School

  1. The value of any practice depends on its context.
  2. There are good practices in context, but there are no best practices.
  3. People, working together, are the most important part of any project’s context.
  4. Projects unfold over time in ways that are often not predictable.
  5. The product is a solution. If the problem isn’t solved, the product doesn’t work.
  6. Good software testing is a challenging intellectual process.
  7. Only through judgment and skill, exercised cooperatively throughout the entire project, are we able to do the right things at the right times to effectively test our products.
I know there is not much to this week’s blog but defiantly check out Context Driven Testing for yourself. Is your company using it? Are you? Should you be? Ask your self these questions and see where they take you. I myself will be trying what I can to use it and to become a better tester as that is my mission. 

Nebraska.Code() Day 3

So I have 12 pages of notes I was going to go over and then for Monday I was going to go over ATDD. However a lot is going on so this will be my Monday post and I will not be regaling you with every awesome moment I had. Instead I will cover the Testing Breakouts I got to attend and any other thing that maybe a tester would like to know. The weekend was awesome and I would defiantly recommend going next year. So after the keynote by Pete Brown about the Internet of Things I went to my first break of the day ATDD, or Acceptance Test Driven Development.
So in the last article I explained TDD. ATDD is very similar as you can guess but it adds some steps. First you are going to start out with your user story or what the user is asking for. Then you are going to meet with your team to create acceptance criteria which then get converted to scenarios. This is what the developer will be using to write his unit test. So as a QA person your job is to make sure the right scenarios are created. Now the developer has to use what is called Red Green Refactor. This is where they create a test that will fail, why because there is nothing coded. Then they make the test turn green by coding the software then they refactor the code or clean it up.This makes sure they build the right code and it does what we want it to. This is also where they might add in automation. Now this again is not bad for QA as it gives us time to find the big bugs. When the code is does we will want to go over the user story again in order to check for any missing items. The story is broken out to role, goal, and reason. You also don’t want to have to much acceptance criteria as you will need to break down the problem into several unit test that are simple. When converting the Scenarios to unit test you will want to break them down to these components, given, when, and then. The hole point is developing test to develop the code. You can always add in a test to prevent a bug coming back. For the example they used Test Management in Visual Studio.
Next breakout was Automated Releases, so what does that have to do with QA? Well the basic concept didn’t other then they had the QA server updated every night with the newest so the software could be tested. They also would download some of the production databases so the updates could be tested on live data. This is genius and really helps catch bugs but when they get bigger they will no longer be able to get production data as there will be to much to grab. 

Next was a class on running a software conference so nothing to QA based. At the end though I found that he runs Code PaLOUsa in Kentucky and they are going to try to have a track for everyone including software testers this year. So save April 29-30 and about $550 + air fair and hotel and go check it out. I doubt I will have the money to go but I sure would love to. 

The last breakout I will go over is TDD misconception even though the one about procrastination was great it is not QA related. This was about how developers make excuses not do practice TDD. Remember TDD is not testing for the sake of testing that is my job. It is not a replacement for QA, nor the primary testing task. Test before you Code to ensure the correct code so you don’t code more then necessary. This helps with the design so it is not over done. So what were some of the motivations the speaker stated; you avoid syllabus shock, you code a little at a time and are not overwhelmed. You admit you are fallible as you know the test will break. This breaks up the problem making it easier to tackle. You get to focus on refactoring and keeping your code concise. You write less code and clean code. This is about production code and not about testing code. For more about it check out Uncle Bob’s Blog.

Nebraska.Code() Day 1 & 2

This is blog is happening because I have went to Nebraska Code Conference the last couple days and will go again tomorrow. There is just so much to cover that it had to be posted as I was there and while it is all fresh rather then waiting a and posting everything on Monday. Don’t worry I hope to get a blog up Monday as well. 

Thursday
So day one they had all kinds of workshops you could go to. I choose to go to “Mobile Dev Boot Camp” as it all that was needed was knowing object oriented programing(Java, C, C++) and have a mac. Plus he was going to cover unit test, X-Code Instruments, and automation testing as well as how to use Mac OS sever to help with automation. We went over making a simple Jeopardy app and it went really well until I fell behind on coding. Now since I am not a developer, I was ok with this and still learned a lot. Then we had a good lunch and resumed. The second part of the day I downloaded the code from github and was good to go. However people got lost in the complexity of part of the app. Everything I wanted was covered briefly so people could get the app built and the server automation was left out. Again this is a developer conference not a QA one so I was ok with this happening.

Friday
Today started off with Richard Campbell from .Net Rocks giving an amazing speech about how technology has changed over the years, moved to the tablet, and how the tablet is changing things with a war against the mouse. This got me thinking now that kids are raised on tablets they will never no the joy of how much technology has changed over the years. They will just expect it to happen and it will. Richard told a great story about a 400 pound hard drive Goliath and a lamp named David. If you have not heard the story you should. Soon that whole story had us reliving the advancement of technology, and how things we grew up with will no longer be relevant to this new generation. What does this have to do with testing? Technology is always changing, change with it.

Next I went to a breakout on podcasting since Joe from GC Gamers Connect, and I want to kick of Test Reactor to be a testing/geek podcast. It was hosted by Kevin Harvell, a host of The Tech Informist. This was very informative and a good place for us to learn how to kick off our podcast. The first thing they stated was that you need to focus on sound quality and content. We have our content ready so we need to focus on sound quality and performance. Next we will need to figure on how often will we record and release? Will we have guest? These are things Joe and I will need to decide. They then went over various equipment and prices which I will not go over here. They talked about when having guest using google + hangouts as you can do a live and recorded show with your guest. They also told the importance of a good album art. They also gave several sites to help out such as DVDVideoSoftAudacityCast Feed Validator, and Podcast 411. They also mentioned podcast hosting sights such as libsyn, blubrry, and soundcloud. They also went over various ways to make money such as plugging sponsors and paypal. It was an amazing breakout. I then stayed for the episode of .net rocks which I am sure you can find on their site.

Then I went to one about HTML5 which was over web components which seem amazing to me. It was changing the way we could site to use templates which would make it very easy to debug and figure out what went wrong which is good for QA. I would also check out plunker. The thought to name custom elements for easier read blew my mind and the Shadow DOM to hide could was pretty neat.

The next 2 we went to were about ReST API. Both teachers were very good but it did not have to do with testing and I am not sure I fully grasped it all. 

TEST DRIVEN DEVELOPMENT

Finally I came to the one I had been waiting for “Getting Started with Test Driven Development”. This was amazing and highly recommended. Instead of get the specification > code > test you switch coding and testing. This means you make the test made before the code, as a manual tester who has never seen this my mind was blown. So you have 3 steps red- you write your failing test, green- you code to pass your test, then you refactor and optimize your code. You create test for bugs so they don’t come back. Instead of using a database with your unit test you will use a mock database so that you can’t blame the database for the fault in the code. Later if you want to test both database and code you use integration test. With the unit test you want to write them in 3 steps as well, you arrange your test, then you act, then you assert. You write your test to drive your code, and you use the drive principle of not repeating yourself.  As I thought about all these, and took these mind blowing things in I wondered where QA would fit in this TDD world. Then James said that QA will always be needed to find the bugs only they can find. This was just to get rid of simple preventable bugs. This also saves time on dev. What I would like to see is a TDD that is driven by Pair testing. The developer uses his QA to help him develop test, and they work together to make amazing code. This sounds like a world I want to live in! This breakout was presented by James Bender