Chuan Chuan Law

DevOps | Software Automation | Continuous Integration

Category: General (page 1 of 3)

General Guideline To Take While Doing System Upgrade

Upgrading system and applications are important and major part of a DevOps role. Below are the general guideline to take while performing an upgrade.

Take a snapshot

Take a snapshot, create a backup, or image before an upgrade is very important in case we need to rollback.

Practice the upgrade process

Work out the process on a development environment, staging or test box before doing the actual upgrade, especially if it is for production environment.

Automate as much as you can

Try to automate the upgrade as much as you can, so we can repeat the process on other boxes or environment.

Make notes

Take notes especially on things that we cannot automate .

Have a runbook

List all the automation and manual steps to run in a runbook, which we can follow during the upgrade process

Prepare a rollback strategy

Ensure we know the steps to rollback if needed

Have peer reviews

Get peers or seniors to review the automated steps and runbook.

Have a helpline or support ready

Have a helpline or support ready during upgrade in case things go south during upgrade

Hello from New York!

G’day!

I haven’t been blogging for a while. This is because I have been busy settling in the Big Apple!

It was a big move and I have been very blessed to have the opportunity to explore the other side of the world.

I look forward to continue sharing what I have learned here. 🙂

 

Getting Selenium Test Running On Gradle Framework

Gradle + Selenium is probably not a popular framework yet when I was developing it as I find it difficult to look for relevant resources online. There were bits and pieces of information here and there which I then glue then up together.

My build.gradle contains the following implementations:

(1) Add cucumberRuntime under Configurations

configurations {
cucumberRuntime {
extendsFrom testRuntime
}

}

(2) Source sets

sourceSets{
test{
groovy{
srcDirs ‘src/test’
}
}

}

(3) Compile test output

task testJar(type: Jar){
from(sourceSets.test.output){
include ‘**/*.class’
exclude ‘**/*StepDef*.class’
}

}

(4) Glue everything together

task cucumber() {
    dependsOn assemble, compileTestJava
    doLast {
        javaexec {
            main = "cucumber.api.cli.Main"
            classpath = configurations.cucumberRuntime + sourceSets.main.output + sourceSets.test.output
            args = ['-f', 'json:target/cucumber-report.json','--plugin','pretty', '--glue', 'src/test/groovy/au/com/story/steps', 'src/test/groovy/au/com/story/features']
        }
    }
}

Happy 2015!

My last blog stops during December 2014, after the MeetUp @ Carsales. I mentioned that I try to blog once a month, but I have not been able to do that this year.
2015 is a beginning of a great year. I resigned from my position at PageUp at the end of January 2015. Then I was away for holiday during the entire month of February. In Chinese sayings, “taking a break is to get prepared for a longer journey”. I had quite a bit of adventures during the break, including my first roller coaster ride @ Legoland Malaysia.

 

At one point, I reached to a point where I wonder where I want to be in terms of career, continue in the technical path or more towards leadership. I guess job satisfaction and self happiness matters the most to me. I have always been passionate to learn about the latest technology and best testing practices. Learning, learning, and keep learning is what that could drive me forward. And I love hands on job!
Therefore, I have decided to choose the technical path. I commenced my new role as Senior Automation Test Engineer at UniSuper right after my break in Malaysia.
My Testing Resolutions for 2015 are:
  • Do as much hands on job as possible!
  • Do better in every thing that I have already  knew (not just learning new stuff). For e.g. use more CSS selectors compared to XPath as it is faster. 🙂
  • Meet more and learn more from knowledgeable peers and colleagues
  • Continue learning…and learning……!
  • More balanced work & life……more exercise and charity work 🙂
I have also been doing testing for over 11 years. Throughout the journey, I considered myself as the lucky girl as I have met many good and helpful bosses and colleagues since my first job. I am thankful to them in many ways.
  • Kalai Murugiah, my direct manager from BMM who has given me lots of learning opportunity. Anna Fernando, the general manager who has made the 21 year old girl feel confident and comfortable at her first job.
  • Malcolm Webster, my manager at REA who has been a great leader helping me grow in many aspects
  • Lots of great colleagues and peers whom I keep in touch till today…….where we share our ups and downs of work and also support during tough times (Andri).
I had a great journey….2014 marked the end of an era, and 2015 is the beginning of the next! 🙂

 

Evolution Of Software Testing

I was lucky enough to be able to present in the Melbourne Selenium Meetup which was held at Carsales.com.au on the 11th of December, 2014. 
Below is the script of my speech with the title Evolution Of Software Testing.

Introduction

Thanks to Ray for inviting me to the MeetUp. I am definitely not the most experienced here, just to share with everybody the changes in testing that I have observed in the past 10 years, which you may be experiencing too and my personal experiences in the journey.

Agenda

I would like to share my experience in terms of these 4 areas.
(1) Transition from traditional to Agile
(2) Importance of automation 
(3) Battling between time and quality in a world when we need to deploy fast 
(4) What do we need to do to keep up in a rapid changing industry

Waterfall to Agile

Most of our changes started after the adoption of Agile SDLC over Waterfall

Testing is part of software engineering

Testing no longer is a phase in SDLC. It is part of software engineering. What does that mean?

Bug catching at every phase

Bug catching is not done at the final phase before deployment. Testing starts at early phase, during planning or design, before development starts.

Real Life Scenario

My experience with the transition from Traditional to Agile is that it helps to deliver better quality results and on time as it eliminates the back and forth bug catching and fixing which will cost more towards the end of a development phase. Testing bit by bit is gives a much better result than testing in a big chunk. This also helps to ensure that the product is what the stakeholder wants.
I heard about a real life scenario where Company X invested in a 4 year traditional software project. When the stakeholder 1st time sees it, it was a shock as it was not the product they expected.
During Waterfall, testing is the final phase before production and testers are always being pressured to test fast in order to deliver on time. My worst experience is to receive a project that would need a few days of testing at 3pm and needs to be deployed the next day. As a result of that, we have to work overtime, or take out features that have show stopper bugs. PMs tend to give a lot of pressure to the testers back in those days.

Get rid of the documentations

We no longer need to write piles of test cases or test plans.

Automation is the key

Automation is our documentation. Yes, we need to learn to code. Test cases or test plans are converted into automated tests.
No technology is perfect without a testing framework. Every new technology or language comes with a way to test it.
Examples.
Web applications: Selenium
Mobile: Calabash, Appium, Robotium
.NET: Nunit, Xunit
Java: Junit
Angular JS: Protractor

Choosing the right tool

How to choose the right automation tool? These are the key criteria to consider. 
Most popular used
Large community support
Open source vs Commercial
Skills of the team
Personally I prefer Open Source tools as they are more fun to work on. 🙂 Or even custom built. For example, we use .NET library Web Client to test API and Web services

Real Life Scenario

So how do we start from doing manual testing to automation? Take baby steps. Start writing BDD scenarios instead of test cases. Then learn how to use Selenium to drive web browser. Then try more complex code manipulation before moving on to the framework level in making sure the test framework is reusable, scalable, maintainable. 
As you expand your Selenium usage, you’ll realize that we will face some challenges in certain areas such as pages with lots of AJAX calls. In that case we will need to have workaround these scenarios, like checking that all jQuery has been loaded.
Another Selenium problem is Element No Longer Attached To DOM. In this case, we will need to have a while loop and try to find the element with a catch for StaleElementException.

Test = User + Design

We need to use the product as a user and also understand the design to be able to think of the possible loop holes 
In the older days there is less emphasize on tester to be know the software design architecture. But in Agile, as we are involved since the earliest phase of SDLC, we will are expected to know to pick up not merely software bugs, but also requirements and design issues.
Knowing the software design helps to pick up edge cases. For example:
If we know that the database field has a size of 50 varchar, we can try to input >50 chars into it and see what happens. Will it crash or truncated?
If we know that a CSS file is used in multiple location, we will need to test multiple locations if it is changed

Time vs Quality

Nowadays we need to deliver software fast. Deliver, get feedback, or fail fast is the best practice. So how can we do that without sacrificing quality? I used to fight with our PM back in he old days in order to get the best quality product out the door. But nowadays that does not work anymore because time = money for business and as a QA, we need to work towards the same goal too (management will like this).
We can deliver software with known bugs. We do this by understanding the critical path of the system usage and ensure that most red route are working correctly, while some bugs can be left in some feature that has minimal usage. We can use data or user analytics to understand which are the most visited pages, most used features, etc to help us make the decision.
My personal experience is when I started at my current job where we do not automation at all and testing happens after deployment. Our product is complex and I am having time pressure to put some automation in place.
How we go about to solve this problem is to find the top 20 pages which equals to 90% of usage. We then analyze the data and pages and put them into a logical user flow. With that we then translate that into BDD language and automate the scenario based on it.

How To Stay Alive

So software testing has changed so much and it is constantly changing just like everything is. How can we keep up with this?
We need to constantly learn. Don’t worry if there isn’t enough training budget (management will like me once more), as learning doesn’t always cost $.
There are many different channels that we can learn which are free. These are some of my personal likes. 
My personal experience with learning are: Examples:
New tool: Appium by Jonathan Lipps at GTAC 2013
New ideas: Take flaky tests from CI. Put is back when they are stable. Critical tests should never be taken out by Ankit Mehta at GTAC 2014
New ideas: Turn off a feature that is buggy by Ankit Mehta at GTAC 2014
I then I like to Blog about what I have learnt. Its not just serves to share with people what I’ve learned, but also to keep a note on what I’ve learnt.
We also need to get our hands dirty and get some hands on experience with what we learned. We can only really learn something when we work on it and gain experience from it. When I face problems I will post questions onto forums like StackOverflow, or Google forums. 
Lastly, share and give back to the community what we learnt. Try to help people out there that are learning just like us.
And most important of all is to love what do! As what Steve Jobs says.Thank you.

Future Of Software Testing

For the past few years there have been a lot of demand for automated testers. Companies are replacing manual regression test checklists with automated scripts, especially the ones written with Open Source tools such as Selenium.

However, I started to see job advertisements with graduate automation testers and developers with knowledge of testing tools.
Therefore, as time goes, software testing job or even automated testing job might be fading away as well, just like manual testers today.
So where do I see the future for software testing? I will see software testing as part of software development. Software testers will be focusing on the impact of the changes to other areas of the systems or edge cases finding. They will find them and fix them as well. They will also be focusing on performance and security aspects. They will also step in as a business analyst, product owner, or even iteration manager when needed.
Basically, what I see the future of software testing is to be a multi-skilled member of a software development team. I urge software testers to start improve their technical, communication, and business skills. Performance testing and security testing knowledge will also be considered as a basic skill of software tester instead of a specialist’s skill.
In this modern day, especially in IT where everything is changing dramatically, changes in a process or role is unavoidable. Therefore, keep learning and keep improving!

Automatically Runs Tests And Email Report From Your PC

I have set up my own PC as a build machine that runs regression tests automatically at night and then emails me the test result upon completion so that I can check it when I get in the morning.

The mechanism I use to do is:

  • Windows Task Sceduler to run the test automatically at certain time

 

  • Bat script to run the tests, generate Specflow report, and email the report. Note that I have included %date% and %time% variables to automatically include the date and time in the email subject

“C:Program Files (x86)NUnit 2.6.2binnunit-console.exe” /labels /out=TestResult.txt /xml=TestResult.xml C:gitPmasterbinDebugTestsRegressionRegression.dll
“C:Program Files (x86)TechTalkSpecFlowspecflow.exe” nunitexecutionreport C:gitPmasterTestsRegressionRegressionRegression.csproj /out:TestResult.html
“c:blat” c:gitPmasterTestsRegressionTestResult.html -s “TestResult at %time% on %date%” -to chuanl@pageuppeople.com

 

  • Blat

As you can see in the Bat script, I have used a 3rd party open source tool Blat to send email. This blog gives comprehensive information on how to set up Blat.

Unable To Build After Upgrade To MVC4 Targeting 4.0 and VS2010

If you have upgraded your MVC3 project to MVC4 running in VS2010, and still targeting the 4.0 framework, you will have problem while running your build as below:

To fix this problem, you need to do the following:

  1. Unload the project in Visual Studio
    2.  Edit the .csproj file

3. Comment out the lines as below:

 

  4. Reload the project
  5. Re-build and you should see a success build!

 

What Does A QA Do?

I held a learning session with my team a couple of weeks ago about this topic “What Does A QA Do?” The reason is because I think as we are so much driven into the daily tasks and responsibilities to deliver projects and hitting deadlines, sometimes its good to take a pause and rethink, “What are you actually supposed to be doing?”
Who are we?
 
There are many definitions of the role. QA, tester, test analyst, test engineer. Regardless of what our official title is, I think we are simply part of the development team that help the team to deliver a quality and successful product.
What do we do?
 
Most would say we find bugs and raise them. Correct, but not just that. We link business requirements with technical design, into a quality end user product.
How do we do our job?
 
There are many technical terms for this, manual, exploratory, automation, regression, performance, security, etc. Firstly, we need to have the knowledge of a product manager to know what product are we building. Secondly, we need to have the knowledge of a business analyst to understand the detailed business rules behind each piece of functionality built. Thirdly, we need to have the knowledge of a developer to understand the system design,  and technical solution such as what does the code do, the data flow into the database, etc. Lastly, we need to be able to use the product as an experienced end user.
What type of bugs we find?
Most would think that bugs are software bugs, careless mistakes by the developers. This is only a minor part of it. Bugs can be:

 

  • Product bug – building the wrong product from the very beginning, wrong idea
  • Requirement bug – caused by lack of understanding of the business rules and outside the square thinking
  • Software bug – caused by wrong implementation
  • Environment bug – caused by the way the software interacts with an operating system, system configuration, database version, etc
  • Deployment bug – caused by sequence of deploying (e.g.: running a script prior update of code might break a system), code merge mistake, database backward compatibility issues
  • Performance bug – all the above bugs are eliminated, but we forgot to take into account that the system might break down under peak usage
  • Security bug – all the above bugs are eliminated, but we forgot that there are back doors or windows opened that allow intruders in to break the system and do nasty stuff!
Conclusion
I am not trying to over complicate things. Many would think QA only test. Yes, but a good QA does not only test. A good QA should have the following skill sets:
  • Good understanding of business knowledge
  • Able to think outside the square
  • Good communication skill with technical and non-technical stakeholders
  • Good team player
  • Good technical skills

 

 
 

Principles Of Regression Test

I guess I have posted a lot of technical stuff in my blog. However, I would like to go into a more theoritical side of things about software testing today – how to write a regression test.
So, what is regression test? Everyone knows that it is a set of test to make sure that existing functionality still works after new functionalities are added.
But how to write a good regression test? Most would think that the more tests you add into a regression test suite the better it is. This is a wrong view about regression test.
There are rules to follow in order to write an effective and efficient regression test suite. These rules are:

 

  • Test all the core functions of the system (not the little help screen)
  • Test the happy path and user would follow (not edge cases)
  • Partition it logically based on system or core modules so that it is easily readable and accessible
  • Partition a set of tests that will be run before every release (very important core modules) and others that will only be run when necessary (changes occur)
  • Keep it as simple and short as possible
  • Avoid repetitive steps
However, please bear in mind that I am not trying to say we do not want to test more in regression test. I simply mean that most edge cases and low level tests should be in the unit test level instead of functional regression test.
« Older posts

© 2019 Chuan Chuan Law

Theme by Anders NorenUp ↑