Building test tool – Setup Ruby on Rails in windows through ubnutu

You always need an easy way to develop simple web tools to assist on your testing.  Ruby on Rails provide that simple framework.  Not too much overhead of installation and deployment, as well as simple setup to get your local webpages running.  Today, I will walk through  how you can set this up in window 10.

  1. First, you need to setup Ubuntu in your PC. (Read here to see how you can do it)
  2. Open up a Ubuntu shell
  3. Check if your ruby is install.  If not, do #apt install ruby
  4. I usually install the rvm on top so I can manage my ruby version and gemsets: #
    curl -sSL https://get.rvm.io | bash -s stable --rails
  5. Get the nodejs, sqlite3 # apt install sqlite3
  6. #sudo apt-get install -y nodejs
  7. incase if step 4 didn’t install your rails, do the #gem install rails
  8. Create your new rails app #rails new app
  9. cd app
  10. rails server

Now open browser, and go to localhost:3000

you will see:

Notes:

#1 You need to shutdown your IIS, if localhost is taken and you will not able to start your rails server.

#2 Git your changes!

How to test application that uses machine learning?

When working with application that uses machine learning to drive decision. Testing becomes very challenging.  For examples, systems like review spam detection, images categorization applications and etc.  So as a testers, how do you write your tests for these applications?   What kind of automation framework we should use?

I recall that I tested one application which using machine learning algo to detect spam reviews from user submissions.  The way I constructed my test plan, I broke down into 3 parts:

  1. Technical functionalities: all the test cases/automation which check the most basic technical functionalities. (if all these test passed, means the application runs and have some output, but it won’t tell you if the review spam is catching the right stuff.)
  2. Established baseline reviews for both spam/not spam: Manually create 50 reviews that are “spammy” and 50 legit reviews.  Run through the application to make sure they did it correctly.  We automated using a simple PHP program to run through this step
  3. Established an on going process (what I call AI for testing) to automatically feed more spam/not spam reviews from the output of the application and feed it back to step #2.

This framework did help us to find a few regression bugs.  Not perfect, but yet it works.

 

How to make a QA team full of manual testers into automation engineers

 

This is a real question from one of my interviewers…

Hi Dickson,

Currently, I have a team full of manual QA testers, how do you convert them and change them into Automation test Engineers?

What’s in my head…

  1. Fire all and re hire real automation QA engineers
  2. No, you can’t, but what you can do is have them work 16 more hours a day overtime unpaid to complete all the test scenarios.
  3. I automated everything myself, while all manual QA testers are enhancing their foos ball skills

That’s great, my potential hiring manger shakes my hand good bye.  The recruiter blacklisted me everywhere, linkedin, glassdoor, ziprecruiter, monster …

Okay, without even get an offer, you are fired!

After more serious revising my draft (joking aside)  Here are the steps on as a QA manager, how you can help turn a team into Automation engineers

  1. Provide them ALL the necessary trainings that to get them started.  Meaning, you have to be their personal trainer.  Every QA tester has technical background and level.  You need to find a right training program for each of them.  For example, some of them already have basic knowledge, like setup DB, git, some sort of coding/script skill.  Some, might even don’t have those.  You will have to make different trainings and mentoring programs for each of your team members.
  2. Show them you can port a example case.  Simple fact, for the folks that have kids.  If your kids see you wash your hand every time before a meal, eventually, they will do the same thing after a few meals/days/weeks.  You as a leader, show that you can, and WANT to do it yourself.  Then good things will follow.
  3. Provide a good starting automation framework.  this has to be simple, easy to use and easy to pick up by anyone.  Look at all the current BDD test frameworks and discuss with all your QAs as a group.  Learning it together.
  4. Encourage and praise on their progress and results.  Always measures each QA testers their automation progress and provide feedbacks on where they might need more refinement.

Trust me, all manual QAs doesn’t want to just be that manual QA.  By doing this, you are providing them a grow path and something more exciting then just replaying same test steps over and over again.

Step by Step automation guide – Selenium using Ruby Mini-Test framework

Setup Automation using Selenium/Ruby Mini-Test in 10 minutes (step by step) The assumption is that you are using a MAC…. (sorry PC users)

      1. Download a webdriver (in this case, I am getting a chrome driver: https://sites.google.com/a/chromium.org/chromedriver/downloads . Make sure you set the PATH which you where your webdriver was install to.
      2. get rvm (which is to set your ruby version, and get different gems (ruby libraries) https://rvm.io/rvm/install
      3. install the following gem libraries:
        1. gem install minitest (Mini Test framework for all the assert)
        2. gem install selenium-webdriver (this is pretty obvious)
      4. Now create a test_login_file.rb like the following code, then run: ruby test_login_file.rb
    require "minitest/autorun"
    require "selenium-webdriver"
    
    class TestLogin < Minitest::Test
     def setup
       @driver=Selenium::WebDriver.for :chrome
       @driver.navigate.to "http://yoursite.com/login"      
     end
    
     def test_login_correct
           @driver.find_element(:id,"login").send_keys "username" 
           @driver.find_element(:id,"password").send_keys "password"
           @driver.find_element(:id,"submit").click
           sleep (1)
           if @driver.find_elements(:id,"logins").size <= 0 
    	   assert false, "Bad Login"
           else
           	   assert_match "success",ps, "Page Failed"
           end
     end
    end
    

    Now there you go with your first automation test! easy?
    Okay, I guess I still own you some explaination

    The setup function basically tells your program to start chrome browser and go to url “yourlogin.com”.  find_element is part of the function within the webdriver class, which do different thing within your browser window (you can find all the reference here: https://gist.github.com/huangzhichong/3284966)

Each Minitest class represents 1 test case.

Hello world! to software testing – to become a QA Engineer

be different

Dear CS Students

For all the computer science new grads trying to search for your first dream job, you should consider to be a software QA engineer (software testing 101!).    To be a great and successful software QA engineer, beside that you need to be good in coding and algorithms (MUST), you also need to have the following skills:

  1. good at writing “test” to test your own code.
  2. know how to increase your personal throughput by creating a lot of “automation“.
  3. know how to build relationships within different organizations of the entire company.
  4. willing to take blame when even when you didn’t make a mistake.
  5. communication, soft skills, and dealing with people in general.
  6. know how to ASK the right questions.
  7. you need to be very organized.  All other engineers depend on your help to get things in order.
  8. know how to put your own thinking into product requirements.
  9. know how to manage quality, timeline and deliverable of a software product.
  10. FINALLY, more about communication, which I don’t mean by writing good grammatically correct documentation.  But know how to get your thoughts across to other people that are NOT engineers.

Being an QA engineer will allows you to learn to expert on items above.   Now, along with your superior coding skill, it will get you to the top of the engineering world.

I really like this short film “Alike” directed byDaniel Martinez Lara and Rafa Cano Mendez.  It teaches everyone in order for you stand out of a packed group of people, you need to be different, like this short film: