Setting up Istanbul on a Node project for Mac and Windows

When I took on this new role, one of my tasks was to ensure that we deliver high quality products.  In order to get an estimate of where we were currently at, I decided to look at implementing code coverage tools into the build processes so that we can gauge the level of quality we have on each product after each  successful build.

After watching the Testing JavaScript for Node.js with Mocha Pluralsight course (which I recommend for any .Net C# newbie to Mocha), I felt like I gained a good understanding of unit testing within node applications. And as an added bonus, the course even bolted on a short demo of a tool that I had been meaning to investigate. This was Istanbul.

Code Coverage with Istanbul

Istanbul is a Javascript code coverage tool that outputs the amount of code covered by unit tests in your project. It is an open source tool which is available on GitHub.

Setting Up

Whilst watching the video, I installed Istanbul into my small node project that I had been using throughout the course using npm install -g istanbul. This installed Istanbul globally to my Mac.

Next, I entered the command:

istanbul cover node_modules/.bin/_mocha -- tests/**/* (on Mac)

This is the command when trying to execute on a Windows machine:

istanbul cover node_modules/mocha/bin/_mocha -- tests/**/* (on Windows)

The Reports

After doing this, Mocha should run your tests. Appended onto the end, you’ll see a short output of the level of code coverage in the command line window that has been helpfully coloured in green or red (if other colours exist I haven’t seen them yet).

You will also now have a new directory within your project named “coverage”. In this directory, you’ll find a coverage report directory that contains a detailed HTML version of your application’s code coverage.

And that’s it!

I was very surprised how easy this was to set up and get running. The next step is to get this running on Team City! So that we can read the code coverage levels after every build and hopefully enforce a minimum level of code coverage so that whenever new features are written, if the amount of unit tests covering those new lines of code don’t increase, then we can fail the build to encourage developers to write more tests and increase the quality of their code.
<!–
Setting up for TC

  1. add to the artifacts path under general  settings the path where the html reports are output.

–>

Ways to keep up your development skills as a Test Engineer

Earlier this year I made the decision to switch back to being a QA Engineer. Due to the nature of the tech that I was now being exposed to, I wasn’t able to flex my coding muscles everyday like my previous role. I started to think that my programming skills would slowly dwindle if I didn’t do something about it, particularly the C# and .NET skills I’d spent the last two and a half years developing.

So, I endeavored to take up activities that would encourage, keep active and stretch my development skills. I have tried and keep them aligned somewhat with my new role so that I continue to improve in the field of testing as well.

If you find yourself in a similar position, here’s how you can do the same.

Before You Begin

Make sure you know what skills you’re going to be building. Have a list ready to work on or a certain project that you’re going to create so that at the end of your learning you have produced a tangible result. I use a Trello board to manage the tasks on my projects, but good old fashioned lists work just as well. Just make sure that they work for you.

Identify Your Free Time

Everyone has some time where they’re free. That morning commute where you’re sitting for 30 minutes, that walk to the bus stop that takes 15 minutes or even your lunch hour. See what I’m getting at? You just need to identify where your free time slots are, then find an appropriate action to do within that time.

Take your weekly calendar and block of these times. Seeing it highlighted in chunks can really open your eyes. Then figure out what you want to do to further your learning and what action would suit that time slot best.

Got a topic but don’t know how to progress? Having a varied selection of learning resources across different formats will mean that you can you easily slip in a bit of learning during any type of free time you have.

What You Can Do

Here’s some tasks that I recommend you try.

1. Read other developer’s code

Reading others developer’s code, especially those that are more experienced than you, can help you see how to write cleaner code.

The best thing you can do when reading others code is to try and understand why they have used the methods and patterns that they have. If after reading the code you can’t figure out the reason, why not ask them? Discussing a developer’s thought process when tackling a problem is a great way to gain insight into how you should approach a technical challenge.

Learning by yourself may take a long time. Talking with someone more experienced that have overcome the same issue could save you hours, months or even years or trial and error. So take advantage!

2. Get your work code reviewed

The feedback you get from someone external to the project (and especially those more experienced) can yield some valuable tips. You could learn how to improve your code to make it more efficient, readable, testable and durable over time.

3. Watch Pluralsight videos

Pluralsight is a online library of technical videos. I’ll be amazed if you can’t find a video here on any technical subject that you can Google.

The vast amount of videos on Pluralsight are being continually added to by professionals in their fields. Pluralsight also vets any new submissions from existing and new authors to ensure they keep the quality of their videos high.

I enjoy using Pluralsight because sometimes watching videos is easier to digest and concentrate on than reading a book cover to cover. And, when you read a technical book, you may not need every part of that book to understand the topic. Pluralsight videos are broken down into digestible chunks so you can consume short videos in small areas of your chosen topic quickly and easily.

Updating videos is also a lot easier than updating books, so you’re more likely to get up-to-date content in your topic on this platform. They also offer a download service so you can take your courses on the go and watch offline on any smartphone or tablet device.

Ok, so Pluralsight isn’t free no. But they do offer a ten day free trial to see whether you’d like it. And they have different subscription methods to ensure that you always have an option.

Why not take the free trial and see how you do. Pick a topic and see how much you can learn during your free trial.

4. Read technical books, news sites and technical blogs

Watching technical resources is great, but sometimes the information is only available in a text only.

Reading technical books that are timeless like Clean Code by Robert Martin aren’t available on any other format currently, so you have to read the book. Choose wisely what you spend your time reading as books usually take a lot more of your time than anything else to consume.

News sites are good because they offer the latest information to keep your skills and knowledge sharp and up-to-date in small articles.

Technical blogs are good at getting the opinions of those in the industry but make sure the content you read is good quality. Anyone can write a blog nowadays. I’m not saying good articles can’t be written by those less experienced in a subject. I suggest that if you are working from the advice of someone new to the area you’re studying, work through what they suggest to verify their work.

5. Listen to coding or development podcasts

Utilising the time you spend traveling from one location to another is the most overlooked part of your day to use to learn.

During this time, providing you know where you’re going and aren’t talking to someone or doing something else at the same time, you can listen to coding and/or development podcasts to help you improve your skills. I find most of these aren’t too coding heavy but more often discuss high level concepts, technical updates, short code-based questions (that require short answers) or soft skills for software developers. Some coding/development podcasts I listen to are the Xamarin podcast, Simple Programmer and Hanselminutes.

6. Write different types of test automation e.g. Unit, integration, UI

You should understand the different types of tests that you can create for different stages of development. But, I would also recommend trying to learn how to develop these tests as well within your company’s tech stack.

Being able to apply what you have learned is more important than just saying you know how to do it.

Regardless of your job role, you may find that you have the opportunity to add some unit tests or write an integration test. Unfortunately, I’ve found that this is completely dependant on the attitude of your company and the developers in your team. You are a developer too, so if you want to contribute to these types of tests, make sure your team are aware of your interest and figure out how to get started.

At the end of the day, being well versed in different types of automation testing will make you invaluable to any team and any company.

7. Attend conferences and events

These can be free or not. The cost of the event doesn’t necessarily correlate to what you’ll learn from the event.

If you don’t know where to start, check your local meetups for events.

Early in September, I attended the ASOS QA meetup event in London where Simon Stewart spoke about the future of Selenium. It was great. I learned a lot about the history of how Selenium came to be one of the most common automation testing frameworks. I also spoke with some really nice, passionate people about their roles in the field of testing.

You can learn lots from conferences and events, not only from the scheduled talks, but from the people also attending. If you do decide to go, try and speak to at least one new person and find out about them.

People going to conferences usually have the same goals, to network and learn. The problem is that many who attend are usually shy, so why not be the first one to be brave and start a conversation.

Also, don’t limit yourself to only testing events. Make sure you go to both testing and development ones. You have skills in both fields so it makes sense that you might get something out of both types of events.

Don’t put a limit on your learning resources or experiences. You don’t grow if you’re not stretched.

8. Write a blog about testing while you learn

John Sonmez says in his 10 steps to learn anything quickly course, that the best way to solidify what you’ve learned is to teach it to others. The fastest, lowest barrier and least intimidating way to teach people is to start a blog detailing what you’re learning.

First, start by picking your blog topic and ensure you pick something niche. For example, don’t write about video games, write about the presence of females in video games between 1990 to 2000 within the role-playing (RPG) genre (if anyone had started a blog about this I would definitely subscribe!).

Next, commit to a schedule. I know it’s hard to stick to schedules because you do so much in life, but this is where identifying the free gaps in your week can help. Pick one of those gaps and dedicate it to writing articles for your blog.

Most new blogs fail within the first three months. Having a schedule will make sure you keep your blog content fresh and interesting to encourage new and returning readers to keep visiting.

A clear focus for your blog will help you to filter out any ideas for posts that may divide your decisions about what you write about. Having a clear focus also helps your audience as they’ll know if they have a problem or want to learn about the most well-known female RPG character in 1995, then your blog is what they need to be reading.

It can be hard to continually think of subjects to write about whenever your schedule dictates. Why not keep a list of your topics so you can regularly pick from it so you don’t have to think about what you’re writing about next? This is what I do. I keep a Trello board because it’s easy to access from a desktop or my mobile when I’m planning my daily tasks on a commute. And it’s very simple to use and tailor to my workflows. It’s also free, so there’s no reason why you can’t give it a try.

9. Write your own code

Practice makes perfect. Figure out what you want to learn or what side project to be focusing on to help you progress in your goals. Then, you can start planning the classes or methods you’ll need. If you’re practicing test-driven development, you may want to start writing unit tests but if not you can start crafting a class and basic method and go from there. Being able to refactor your code is a skill that writing code a lot can build. So the faster you begin the faster your skills grow.

Don’t have a goal? Get one. Do anything even if it’s small so you can practice writing code. The hardest part is starting.

Start With Just One

Try to build a habit of doing this so it’s second nature and you feel like you’ve missed something if you don’t complete your task. Once you’re happy you’ve successfully worked it into your routine, start adding another into your schedule.

Even if you’re only able to enforce and keep up one new habit you’ll soon notice results. I can’t guarantee perfect results fast but I can tell you that when you start doing these things regularly, it will make to think differently about how you approach a task so that you apply what you have learned.

For more ways of keeping up your coding skills, John Sonnez has written a similar post that you may want to read.

And that’s the secret to keeping up your skills. To keep learning a little at a time and applying what you learn in practical ways.

This post was imported into WordPress in one click using Wordable.

Creating a Test Strategy from Scratch

Five months ago, I was tasked with probably my biggest challenge to date in my development career. I was asked to create and implement a test strategy for my company. The previous projects were tested before being released, but there were no dedicated members of the team whose specialty would to ensure a high level of quality. I was brought in to fill this gap.

Although I knew I was up to the challenge, I had to admit, I didn’t know where to begin. Various emotions from excitement to anxiety filled me. I was excited because I had the freedom to shape the practices and processes that will be used across the business and projects for the foreseeable future. I wasn’t answering to anyone, no one was second guessing me. Once I had researched the tools or processes I needed and came to my conclusion, that was it. I was being trusted to make the correct decisions to ensure that the level of quality across the projects internally and externally was high.

Determining the scope and challenges

During my first week I made it my main goal to get a good understanding of the systems and tech stack we were using. One thing that was helpful to me (and others that joined later), was when I spoke to the developers to get an overview of the systems that we were creating, I made easy to follow diagrams. These helped me better understand what I needed to test and which systems communicated with each other. Once I knew this I was able to  highlight what tests were needed, where they were needed and if we already had any tests in place.

After a few days of taking to the developers, finding out their wants and needs in terms of testing, figuring out what parts of the projects were being unit tested, what test runners, test frameworks etc were being used, I put together a current state of testing overview.

This outlined where we were, the challenges we were or would face if we continued with that and possible solutions.

Some challenges highlighted were:

  • Limited testing resources

I was only one person managing all the testing and QA efforts of the company.

  • New technology

Another was I had moved from a completely different tech stack. Although I had some background in this new tech stack, there would be a learning curve implementing a number of things.

  • New types of testing to learn

The product would require load testing, which I was interested in pursuing but again had no hands on experience with to date.

Devising my test strategy

So now that I knew where we were at and where we wanted to be I began crafting my test strategy document.

Googling led me to a few very key posts which helped me create the bare bones of my test strategy.

These are the ones that I found quite useful:

I began reading through each page and picking out the key points that would become the skeleton of my strategy document.

I started by dividing my strategy into the following sections:

  • Scope And Overview
  • Test Approach
  • Test Environment
  • Testing Tools
  • Release Control
  • Risk Analysis
  • Review and Approvals

With the document clearly divided up. I set about trying to fill in what I knew so far within each section. Then I could clearly see what was missing, what sections needed a lot more work and if any other supporting documents needed to be made in order to create a complete guide. Where there were already documents made I chose to either update or reused them if the information was still valid. There’s no point in making more work for yourself if you don’t have to!

How long did it take to write?

I had a deadline of getting this done by 28th April so I guess writing this document took me about six weeks to complete. Although, I wasn’t working on this all day everyday as I was trying to learn the tool and tech that I needed to test. I also had to hire another tester within my third week so going through the recruitment process, interview and managing this person was now embedded into my daily activities as well as daily manual testing, Scrum meetings and researching tools and processes. So I think despite it all, I didn’t do too badly to get it all written within that time.

Once the document was complete I had produced a Test Strategy document with the following sections:

  • Scope And Overview
    • What is Quality Assurance?
    • How should this Strategy be used?
    • Mission Statement
    • Testing activities carried out with timelines
  • Test Approach
    • Approaches
    • User Stories
    • No Acceptance/BDD Tests
    • Dashboards
    • Test Process
    • Test Workflow
    • Testing Levels
    • Roles and responsibilities of each team member
    • Types of Testing
    • API / Service (Integration) Testing
    • Acceptance Testing (BDD Tests)
    • System Testing/Regression Testing/User Acceptance Testing
    • Smoke Tests
    • Defect Raising and Fixing process
    • Internal
    • External
    • Automation Strategy
    • Test Schedule
    • Test Plans
    • Test Coverage Minimum Targets
    • Challenges to Consider
    • How can we test a virtual reality application?
    • How do we run the Unity unit tests on builds?
    • Scheduling
    • How will we manage other quality considerations?
  • Test Environment
    • Environments
      • Prism
      • I-Pass
    • Load Balancers – Immerse platform.
    • Service Locations
    • Product Domains
    • Backup of Test Data
    • Restore Strategy
      • Sign Off
      • Rollback Tools
  • Testing Tools
    • Automation
    • Manual
  • Release Control
    • Build Management Process
      • From Development to Production
      • Steps
    • Release Windows
    • Versioning
  • Risk Analysis
    • Likelihood
    • Impact
    • Potential Risks
    • Monitoring and Logging
  • Review and Approvals
    • Sign Off Process
    • Release Notes
    • Done Criteria

This document also spiralled off the following standalone pages:

  • Bug Template
  • Sign Off Process Template
  • Release Notes Template
  • Defect Submission Process – External
  • Defect Submission Process – Internal

So you can see, this was no small task!

How has this document helped?

With this document now in place, the company has a level of quality to strive towards and something concrete that everyone can refer back to if there are any queries about why we are using certain processes or tech.

What have I learned so far?

Building something from nothing is always going to be hard work. It will always take you longer than expected. So it’s important that you:

  • Have a clear deadline for you to work towards
  • Break things down into manageable chunks
  • Have a team or people that you can go to for help when you may need it

Once the test strategy was complete I took a short break. This was to let my mind relax so that when I went back to try and enforce the strategy I was refreshed and ready to tackle any new challenges that may arise.

Next steps

The test strategy is not a document that you write only once. It must be evaluated and reviewed to ensure that it still stays relevant and useful to your company. What I intend to do is to mark out dates on my calendar where I can sit down and update the original document to keep it in line with the developments of the business.

Another good idea that I think is working well, is to create a short overview documents that I and other members of the team can refer to regularly without having to search the entire strategy for the information.

This can list consists of basic goals for the next 3 months like code coverage levels to achieve or processes to put in place buy certain dates.

Make sure your overview document captures the short term goals and highlights where that puts you in the long term so that you can clearly see how you and your team are progressing.

This post was imported into WordPress in one click using Wordable.

Why Testing Could Be the Most Important Stage When Developing

Here’s my next post which appeared first on Simple Programmer..

Testing is an area of development where, at different stages of the development cycle, the product or service to be tested is measured against set criteria. These criteria check that the product or service fulfils the original spec, goal, or intended use.

Testing can be carried out manually by individuals, or automatically by computer systems. If a feature fails testing, it needs to be reworked, then retested.

Features fail testing when the actual results of tests don’t match up with the expected outcomes. The more safety-critical the system under test, the more important it is to adhere to a well-defined approach to testing.

However, just because your system doesn’t carry health or safety risks, doesn’t mean you should skimp on professional test efforts. Your end user invests their money and precious time into your product, so it’s up to you to deliver the most robust version possible.

Why “any old” Testing won’t do

The general view of testers on projects has improved considerably in the last 10 years, as the testing role has become more technical. But besides being technically skilled, great testers are highly analytical, methodical, logical, and thorough; they are investigative by nature and good communicators.

Especially in the case of video games testing, those external to the industry and field underestimate the skills needed to test projects. Because games are seen as recreational activities, those outside of the games industry assume a tester’s job is to play games all day. That couldn’t be further from the truth.

Although games testing may not employ more technical types of testing, such as automated, performance, load, or security testing, good games testers use multiple other skills to help them solve problems.

For example, on one game project I tested, I had to perform graphical checks on an area. The area was divided into squares, but the boundaries of that square weren’t visible. I could only check where I was by inputting a command. So I wrote a small script to help me perform the checks. I set the square coordinates to test so that whenever I moved out of the area, the on-screen character would shout, alerting me I had gone too far. This type of thinking—finding ways to ensure your task gets done more effectively—is what professional testing can provide.

Professional testing takes into account different test techniques and strategies. For example, test techniques can be reactive or proactive. Reactive testing aims to quickly resolve defects as they happen, to ensure the minimum negative impact on customers. Proactive techniques aim to implement testing as early on in development as possible, in order to catch and fix bugs before they become a problem.

Another test strategy could be one using risk-based testing. This is where the approach of the project is determined by the level of risk that could occur.

What makes these test strategies professional is that they are known about and intentionally used in a project. Sure, a non-professional tester could also decide to plan out their test cases based on the impact of the project, but they wouldn’t necessarily be aware of why that would be better than other approaches, or that it even is a test approach.

Professional testing will:

  • Increase the quality of your product
  • Decrease the likelihood of production bugs
  • Increase the likelihood bugs will be caught in pre-production environments

Good testing ensures that the number of defects your target audience comes across is very low.

Professional testers, developers, and even those on the product team know testing should occur throughout the development life cycle. This constant review ensures that critical and major bugs are caught early on, when they are cheapest to fix.

It’s Wise to Invest in Great Testing Resources

Investing in great resources may mean investing in great tools or people.

Putting your money into people, whether that’s offering a salary that will attract more experienced candidates, increasing the salary, or offering training to your currently employed testers, is worthwhile. When people are shown respect and given chances to excel, they give back with dedication, loyalty, and hard work.

Providing the proper tools to help support your team to uphold the quality of testing is also a good idea. There’s no point in having a great team if they will be limited by their tools. I know there are lots of great free and open source tools out there (like Selenium and NUnit), but sometimes spending that little bit more can move you forward tremendously.

Testing is the Gatekeeper of Quality

The buck stops with testing. The people on the testing team need to know their part to play and that they sign off on the level of quality with which the product ships. Your team needs to understand that the quality of the brand is determined by the product that is shipped and not by what it was intended to be. The time and money a customer invests in your project should be paid back by making sure you release only the highest quality product.

Your Efforts are in the Public eye

The public doesn’t know about the difference between the waterfall and agile development life cycles, or other technical strategies. You may have testing efforts taking place throughout your entire development cycle, but this will be known only to your team.

The public and your customers are probably aware, however, that products have testers. So if products ship with bugs, they are likely to blame the testing effort over anything else.

Testing Helps Uphold Brand Image

Having a high-quality product is beneficial to any brand. It suggests a commitment to quality throughout your processes and company, whether a high level of quality is specifically spelled out within your brand guidelines or not.

Your brand image is fragile. Negative press from a buggy product can shatter your solid, high-quality image in a much shorter time than it took to build. For example, as much as I love Windows and Visual Studio, historically, Microsoft is known to release buggy software. I know people who update to the latest major version of Windows only after the first patch is released, because they don’t want to deal with the inevitable bugs that will unfold (I must say that since Windows 10 and the release of Visual Studio 2017, Microsoft’s image has improved, at least in my perception).

Rebuilding your brand’s image will take twice as long and be twice as hard if you let it slip.

Make Time and Budget for Good Testing

The quality of a product is determined by a lot of factors. A quality experience is created not only by the design, user experience, and functionality of a product, but by the amount of bugs users don’t encounter. Bugs hinder users’ progress and give them a bad experience with your product.

Basic testing can be done by anyone, but professional testing is needed to ensure a high level of quality, which will in turn uphold your brand’s image. Don’t skimp on testing with your project; it could be your downfall!

Adding Reports and Screenshots to Your Protractor Tests

If you fancy sticking it out with Protractor (unlike I did), I highly suggest you add jasmine  2 html reporter to your test projects.

The Jasmine part

Adding Jasmine will give you a little report in the command window listing all tests that have been run, including which have passed and which have failed.

To add this to your project run this command via npm:

npm install protractor-jasmine2-html-reporter --save (--save will save to project dependencies in package.json)

Note: Make sure you have a package.json file in your project. This details the packages required for your project. If you built your project from scratch you may not have it yet.

The HTML-Reporter part

This produces HTML reports of your test results. You can state the save path of these files within the conf.js file as a parameter in the Jasmine2HtmlReporter.

Add this to your conf.js file to register protractor-jasmine2-html-reporter in jasmine:

exports.config = {
// ...
onPrepare: function () {
// output HTML page and creates screenshots
let Jasmine2HtmlReporter = require('protractor-jasmine2-html-reporter');
jasmine.getEnv().addReporter(
new Jasmine2HtmlReporter({
savePath: 'target/'+ + '/Screenshots'
})
);
}
}

Overall, using Jasmine defintely makes it easier to interpret the results from your tests. And, although pretty basic, the HTML reporter can be styled to produce great looking results in case they need to be shown to anyone unable to run the tests via commandline or used in larger reports.

How does Protractor compare to Selenium WebDriver?

My experience so far in development roles has been with the .NET stack so when I was asked to pick a tool to implement UI automation, I had using Selenium and C# in mind. However, due to the technology of the systems I was automating, I decided to investigate Protractor.

Things To Consider

I must admit, I was pretty hesitant about trying Protractor. But, I had a number of factors to consider which meant that I had to give Protractor a chance.

I needed to make sure that the tool that we selected fulfilled the following criteria:

  • Setup and writing the tests needs to be implemented quickly
  • Needs to be able to implement a good and extendable project structure
  • Needs small learning curve as the team are both new to the company and will have enough new tech to learn
  • The tests need to run faster than it takes to run them manually
  • Developers need to run these tests via command line
  • Results need to be displayed clearly

Setup and writing the tests needs to be implemented quickly

This was important because we are only a small team and we have a lot of work to do now and in the future. Being able to set up the test frameworks quickly will means we can get this done and be confident the areas tested by the frameworks is covered leaving us with the manual tests and exploratory.

Setting up a Protractor project

Luckily, setting up Protractor was extremely simple. Using the following 3 lines sets up Protractor easily (you do need to have npm installed first but if you don’t, that’s another quick installation).

npm install -g protractor
webdriver-manager update
webdriver-manager start

Installing Selenium into a project

Thanks to Nuget Package Manager, installing Selenium is now a lot easier than when I first started automation.

You just need to install the Nuget packages, Selenium Webdriver, Selenium Support and WebDriver.ChromeDriver into your project. Once you have these, you are ready to go!

Needs to be able to implement a good and extendable project structure

At this early stage in the company, we’re not sure how many more that’ll be added to the team. However, it’s important to create a framework that can be extended and easily maintained.

I’ve been using the Page Object Model design pattern to structure my project. I’ve done this because it’s easy to read, easy to replace classes and methods, and everything is contained and broken down into small bite-sized chunks. So this is (basically) the structure I have been using for my project. I’ve got a few minor objections to making the Page classes static, so I haven’t followed this to the letter, but the principle is there.

Creating a good Protractor project structure

I found that the examples of using the Page Object Model design pattern  were a bit misleading.

The point of using this pattern is to separate the functions into different files so that everything is less dependent and extendable. However, the examples of this had all the code to run a test in one file. So it was good if you wanted to learn the basics of the page object pattern but not if you wanted to use it properly.

I set about implementing this in the way that I am used to and then I ran into some issues when trying to separate these out into different files.

After I overcame these issues, I learned that if you want to use functions from one file in another, you need to add this into the main function of the file that’s referencing the function:

var homePage = require('../Pages/HomePage');

You can also add this at the top:

require('../Pages/HomePage');

Then you need to add this at the end of the file that contains those functions:

module.exports = new HomePage();

This allows you to use the “require” command to call that file and enable it’s functions to be used in other files.

Once I got my head around this, I used the examples of locators on the Protractor website to quickly write the bulk of my tests.

Page object model and Selenium

Because of my experience with C#, setting up the Page Object Model in a C# project was a lot easier. Plus, there are a lot of experienced automated testers out there with video tutorials to help if I ever got stuck. needless to say, there was no issues putting this together.

Needs a small learning curve

As our team is new to company and will have enough new tech to learn, it’s important to make sure the tool isn’t too complex to learn or it’ll eat into the time we need to spend doing other things.

Struggles with Protractor and JavaScript

The team were all unfamiliar with JavaScript so progress was slow to say the least. I got tripped up a few times with the unusual syntax, as I haven’t used it for years.

Using the protractor commands, like locators was also new. So even though the framework was built on Selenium and locators looked familiar, implementing them still want straight forward. Despite knowing what i wanted to do with a locator, I had to keep looking up the correct syntax to add them to my test.

Using asserts that aren’t standard to MSTest or NUnit was also took some getting used to and lots of searching on Google.

There’s no doubt a steep learning curve here. Not complex, but just time consuming. And I’m not certain whether I or my team, have enough time to learn all of this as well as all the other parts of the system and tools in this new company.

Learning curve with C# for my team

Putting my own selfish reasons aside, my team is used to using object-orientated programming languages. So picking C# to carry out the automation, was a lot easier for them to pick up and progress using.

This smaller learning curve also made this switch a much more enjoyable experience for my team.

The tests need to run faster than it takes to run them manually

The reason why we automate some tests is because these tests are run repetitively, they’re setup is rather complex to carry out every time or they take a long time to run. So, making sure the tests that we write run faster than if they were carried out manually is highly important. If not, we’re wasting time, not saving it.

Speed of Protractor tests compared to Selenium

I must say, the small amount of tests that I have written are run very fast using Protractor. Unfortunately, out of the box, Selenium is a lot slower.

For this comparison I ran the same amount of tests for each project. The Protractor tests ran for approximately 13 seconds while the Selenium tests were running for over 40 seconds 🙁 There are ways around this like that I have investigated like, running the tests in parallel (which reduced the test time to around 16 seconds) and other ways to refactor the code to improve the performance, but clearly Protractor wins by miles in this aspect.

The Choice I Have to Make

The decision that I have to make is whether being able to implement tests faster, but slower running tests is more important than implementing tests slower but that will run faster.

Using Protractor has been a roller coaster ride so far that I think will only get progressively more difficult before it gets better the more I use it. I did get through it though.

There’ll always a little nagging voice at the back of my mind telling me that this will be so much easier with Selenium and C#. However, learning how to implement Protractor has expanded my testing capabilities already. And although the tech of the project shouldn’t dictate the testing tools you use, I think trialing this was beneficial to at least consider the potential benefits.

Overall, I’m leaning more towards sticking to what I know. Performance improvements are always being made to tools. Selenium tests may get faster in the future and if not, there are a lot of performance improvements and code refactoring that I can implement to help with this.

What Do We Mean By Testing?

Testing is an area of development. A product or service is measured against a number of criteria at different stages of the development cycle. This is measured against the original spec, goal or intended use. Testing can be carried out manually by individuals or automated by computer systems. The automated scripts that run the systems are written and also maintained by individuals.

Why Choose Automation?

It may take longer to set up initially, but automated testing may save a lot of time and money in the long term. There are various arguments for and against automated versus manual testing. It will just depend on the task needed to be carried out and the industry as to which method is more suitable.

When I was at university not a lot of emphasis was placed on testing and the roles within this field. More attention was on the career path of the developer. But, the roles within testing can be as technical as that of the developer and just as important.

Depending on the company you work in, the job of a developer and tester may blur. You may need skills useful for either role in order to do your job effectively.

What Qualities Make You A Good Tester?

These aren’t all the qualities that you need to be a good tester but they’re certainly highly important.

  • The ability to communicate efficiently and effectively

This includes between technical (developers and other testers) and non-technical (business) members of your team. Both written and verbal communication skills are important to improve and perfect.

  • High attention to detail

You should be able to pick up minor issues as well as the glaringly obvious ones and be able to reproduce them correctly. The more issues you find and help fix, the higher level of quality the product you ship has.

  • Being able to pick up new software and languages quickly

Like most areas in IT, the tools that testers use are updated and change very quickly. As well as the tools you will use on a daily basis you may need to be able to use the tools that the developers in your team utilise.

Why Specialise In Testing?

The field of testing is extremely varied. As I mentioned, an automation role in testing can be just as technical as a role as a developer. But if you’re not into technical jobs you can still be a valuable manual tester. Manual testers frequently carry out exploratory testing which is extremely essential and something that automation can’t replicate.

As testing is the last stage in development before the product is released to the customer or to production, testers are responsible for identifying issues that could impact the reliability and use of the product. When these issues are found testers work with developers to get the issue fixed and retested to ensure the problem is solved and that nothing else is broken. Testers are the gatekeepers of quality.

Is Testing For You?

If you enjoy ensuring that something is of the highest level of quality, testing could be for you. You need to be willing to carry out some tasks that may be long and repetitive. However, others may give you a unique perspective into the development cycle and could expose you to different fields. For example, you could get more exposure to business analysis when you’re trying to determine the expected results for test cases. Or, exposure to software development when you’re writing automation or other technical tests if you’re utilising test-driven development or behaviour-driven development.

Ultimately, it’s a very satisfying role knowing that you’re the one upholding your brand’s image by ensuring a high level of quality.

The Difference Between Games and Software Testing

Here’s my guest post which appeared first on Simple Programmer.

When I was going through the process of transitioning from a games tester to a software tester, I couldn’t find any material on it.

So, to save others from the headache I endured, I decided to create a guide to doing just that.

In this guide, I want to highlight the difference between the two paths in testing, what I did to prepare for this sideways career move, and what I had already done that made the transition easier.

To clarify, in this post I’ll use the term software testing to distinguish the difference between games testing and testing done outside the games industry. Although this could mean testing software, it could also mean testing desktop and mobile websites, web-based applications, or mobile apps.

My Life as a Games Tester

When I worked as a games tester and told someone what I did for a living, they almost always said, “So, do you just play games all day?”

“I wish!” I thought.

Being a games tester is one of the most challenging jobs that I’ve had in my life (and I’ve been working for 15 of the 31 years I’ve been alive!). It challenges your perseverance, your attention to detail, the attention to your job, and your love of games.

After eight hours of driving the same Honda Civic-style car in doughnuts, watching to see if it spontaneously combusts after the 14th loop, you may start to feel your passion ebbing.

Yes, this means you may have to test the same part of a game for days on end (depending on the complexity). It’s clearly not all fun and games.

Games testing is only now utilising small amounts of automation, but it is project, team, and company specific—not an industry standard. Most of games testing is done manually. When you test manually, it means you have to work through the test without aid from programmed automation scripts. Often, an experienced (maybe a lead or senior) tester will write out a test plan and distribute the work to their team.

A single test is referred to as a test case. Working through a test case is also known as running a test case. The length of a test case depends on the project, but they are generally short, and test one section of the game at a time. This helps to isolate issues within specific areas of the game.

What Is Different About Software Testing?

Unlike games testing, software testing greatly utilizes automation scripts, and yes, you test software, not games. These scripts can be created before or after producing written test cases, as either can be used to supplement the testing of the other. A number of tools and frameworks have been developed to make automation quicker, as setting up automation scripts can initially be very time consuming.

As software testing makes greater use of automation scripts, this generally means that the job of a software tester is more technical than a games tester. For example, being a software tester, you may need to be able to use tools to query databases. Still, it depends on the testing methodologies used by each company and what they’re testing.

The field of software testing is usually seen as a more skilled profession than games testing, even though the skills required to be a games tester are exactly the same as those needed as a manual software tester.

Qualifications Needed

So what background and experience do you need to get a job in each?

For software testing, you usually need a degree in computer science, software engineering, math, or anything technical, really.

For games testing, a degree may be useful, but it’s not always necessary. A love of games, attention to detail, and a strong work ethic can usually get you into the field.

Testing Platforms

For games testing, the platforms you can test on are:

  • PC (including Steam), and desktop
  • Consoles
  • Web – online games like MMOs, HTML5, and Facebook
  • Mobile

For software testing, you have:

  • Web
  • Software
  • Mobile

Types and Specialities

The platforms and content you test are the most obvious differences between the roles of a software and games tester.

These differences across the different platforms and between the content lead to diverse specialties within each role.

Games Testing

Manual

This involves going through every test case by hand (no matter how many times you need to run it).

Performance

This ensures that the game runs at or above the required frames per second.

Compatibility

If you’re testing a browser game, you may need to test the game’s functionality, usability, and accessibility across different browsers. This ensures players have the same quality of experience, no matter what browser they use to play.

Exploratory

This is where you can show your real skill. Exploratory testing is where you’re doing whatever you can to come across flaws and issues in the game. Once you’ve found an issue, you need to make sure you can recall the exact steps to reproduce it, so the developers can fix it.

Certifications

In games testing, you may work across a number of different platforms like the latest consoles from Nintendo, Sony, or Microsoft. Each of these have different certification standards tests that games on their consoles are required to pass.

Software Testing

Compatibility

In software testing, specifically web testing, you may have to test whether the product is compatible with all the current versions of web browsers. In this situation, you would be classified as a specialist at compatibility testing.

Performance

With performance testing, you’re trying to determine how a system performs in terms of responsiveness and stability under a particular workload. Performance testing is a field that has a number of specialities within itself.

Automation

Automation involves creating test scripts that can be used repeatedly to allow testers to devote time to other tasks.

Functional

Functionality focuses on the inputs and outputs of the system and its behaviour. It can also be known as black box testing.

Non-Functional

Any non-functional tests focus on how the system operates, rather than how it behaves. It can also be known as white box testing.

Regression

When you perform regression testing, you run through the entire functionality of a product to ensure that nothing has changed since a new feature was introduced.

Integration Testing

Integration testing requires testing more than one component of the system at once, and making sure the way they are interacting is as expected.

Unit Testing

This is testing individual components of the system. You must make sure their inputs and outputs are as expected.

Sanity Testing

Sanity testing is sometimes known as smoke testing. This is doing the bare minimum over a cross section of the product to ensure all the functionality is still intact.

Systems Testing

When you perform systems testing, you work to ensure that all the components of the system work together at once and as expected.

End-to-End Testing

Finally, end-to-end testing requires a test of the full cycle of the system from when the first object is produced or when the first customer interacts with it until the end state.

Automation Tools in Software Testing

I’ve learned that a task can only be as fun as the tool you’re using to perform it.

When I first started automation it was painful—we used WaTiN. I look back now and realize that if we didn’t begin with this tool, I might not have learned C# as deeply as I did, so silver linings and all that. But I let out a little scream of joy when our team was finally authorised to use Selenium. It’s the most popular automation tool—at the time of writing—for web and mobile testing (with plugins).

Selenium offers two ways to automate: IDE and WebDriver.

IDE is a desktop app that allows the user to create automated scripts using simple commands to detail the command, the target, and the value. No knowledge of programming is required, just how to navigate the Direct Object Model (DOM) of websites.

In contrast to IDE, Selenium WebDriver is a library that you install and use within your testing project. Utilizing several languages like Java, C#, Python, JavaScript, PHP, Perl, and Ruby, you can create automation scripts. Programming knowledge is needed for this tool, but you don’t need to be an expert. Once you get used to the methods of Selenium, writing tests is a lot more enjoyable.

Training and Certifications

Certifications from Foundation to Advanced level exist to extend and show your knowledge within software testing.

There’s currently no equivalent within games testing, although there’s nothing stopping a games tester from gaining a software testing certificate. In fact, it will probably help to strengthen the skills of that individual.

These certifications are currently offered by the BCS, Microsoft MTA, and MCSD.

Games testing courses are available, but aren’t recognised as a necessary qualification for entry into the field.

Points to Consider When Moving from Games to Software Testing

When you decide to move from games testing to software testing you should consider the following:

Positives

More Money

Generally, software testers earn more money than games testers because, as I mentioned, the role could be more technical.

Better Quality of Life

The deadlines you work to aren’t usually as high pressured as games industry projects. Although there may be some overtime, there’s generally less of it, and it’s often compensated. With less overtime, you have more time to be you and enjoy life, so you can work to live—not the other way around.

Improvement in Technical Expertise

Your programming skills will improve depending on how much automation you perform, but your exposure to tools that are used in the backend will also increase. You may work on a daily basis with databases improving your SQL skills, working closely with developers so you’ll learn how to speak ‘dev talk’, and also debugging problems to a certain degree.

Negatives

Get Technical

You’ll have to make the time to learn automation, or demonstrate some technical ability, if you want a good chance at getting a role. If you want to get more technical, this could be a positive!

Starting from the Bottom

No matter where you were as a games tester, you’ll have to start from the beginning as a software tester. This can hurt your pride a bit, but remember, juniors get a lot more leniency when it comes to making mistakes. It’s best to revel in this time, make your mistakes, learn lots, find your niche, then work your way up.

There may be more points to consider as the decision to switch careers is a personal one and your motivations are not something I can account for, but these were my main ones.

When I looked at the pros and cons, the pros definitely outweigh the cons, so I switched.

Making the Transition Smoother

In order to make switching career paths as easy as possible, I created small automated tools to assist me during the mundane testing tasks. I also bought and began reading the book, Software Testing: An ISTQB-BCS Certified Tester Foundation. To help you as you explore, I’d suggest doing these things:

Read the Foundation Software Testing Book

This book covers all the basics of software testing and prepares you for any questions you may be asked about testing during your interview.

Learn the Basics of Any Programming Language

By picking up a programming language, you will make the hurdle of automation a slightly shorter jump. As you read earlier, Selenium can be programmed in a wide range of languages, so I’d recommend choosing one of these.

Play Around with Selenium

To be honest, you don’t need a vast knowledge of a programming language to be able to understand the basics of Selenium. The commands are written in a readable way, so what you read is basically what you’re telling the browser to execute. For example:

driver.Navigate().GoToUrl("https://simpleprogrammer.com");

What do you think that means?

Move Forward One Percent at a Time

Start doing small things. Anything to build up your knowledge one step at a time, one day at a time.

After 30 days of doing this, you’ll find that you have gained a lot more knowledge than you would’ve thought. Try reading a page from a book like the ISEB Foundation Software Testing, complete a small Selenium problem a day, or execute a small C# tutorial.

Whatever you choose, make sure it moves you forward towards your goal of building your software testing knowledge.

So What’s Your Next Step?

Moving from games to software testing can seem very daunting, but if that’s what you’re considering, then you should jump in with both feet.

Learning alongside your current job will be tough, but it’s definitely worth it. The benefits of this career move outweigh the short term drawbacks. You only need to have patience, be self motivated, and believe you can do it.

Good luck!