How “Clean Code” by Robert C. Martin helped me to get my automation tests going

Even if I am a pretty decent bookworm, it took me months to finish “Clean Code”! It definitely was not an easy evening read for me (even though I do know some people who read it overnight) and it was the very first book I have read on programming.

In the first years of my testing career my tasks were limited to setting up my own testing environment and manual testing (very often with manual test scripts). No wonder it started making me feel like a monkey and bored to death!

When I changed my job to being the lone tester in a startup, my time resources became very limited. Manual routine tasks started to hurt a lot, so automated UI tests became a long term plan. Luckily I have wonderful colleagues who gave me a lot of needed support to get going.

In the very start as a very beginner programmer (never done it before except in university basic classes) and a practical person, I just created some automated tests based on examples I found. My main purpose there was to make it work. If it works – then I move on to the next thing I want to automate, google, find a solution, modify and move on.

Then, the fun began. We did want my automated tests to be actually used and scheduled. For this purpose GitHub was chosen to store it and for that I had to start creating pull-requests and get them reviewed by a senior Java developer. It was definitely terrifying. First pull request I made got 30 comments in one review session.

The comments were super useful, but it made me realize so well that to make it work is not enough – we need to make it maintainable, readable not only to me, but others, and scalable for the future. There were so many things I did not know about programming. And there came an advice from the developer for me to read “Clean Code” by Robert C. Martin.

I did read it and I realized how important it is to actually write clean code. It definitely should be a long term goal of everyone.

Some very important points mentioned in the book which I loved:

  • Meaningful names: Code has to be readable and understandable to others as well, so use intention-revealing names without disinformation.
  • The single responsibility principle (SRP): there should be only one reason (responsibility) for class or module to change.
  • Tests should be clean: readable! One assert per time if possible and single concept per test.

“Clean Code” is full of useful advice on how to make your code cleaner. It includes some easy tips like the ones I listed above, but it also goes in depth and looks into code examples and tries to make the code cleaner hands-on.

Getting software to work and making software clean are two very different activities.

I think the quote above sums up the main idea of the book. Very often whoever is doing programming forget this very important aspect: clean code can make your life way easier in the long run and even help you to avoid making mistakes (or bugs!).

Months later, I finally finished this book (reading bit by bit) and my automated tests are now scheduled for nightly runs. I am far from being a great programmer, but, due to a lot of useful code reviews and information obtained from “Clean Code”, I have improved my code quality a lot and can make changes way easier than before.

Even if you are a not a full time programmer, but have to do some programming, do not underestimate the power of clean code. It is not only about making it work, it’s about making it work in the long run, too. It will scale, get used and be easy to maintain if you work on writing cleaner code. 

Advertisements

Why phrase “pass the QA” makes me cringe

Today I heard someone say “pass the QA” and in this post I will share why I believe that we should cross out this phrase from all dictionaries where it is included because it is just wrong use of definitions.

Let’s break this phrase into two parts: QA and pass.

What is QA?
I am talking here in a sense of quality assurance. Okay, that sounds clear, however, what is quality assurance?

A lot of people mix up QA and testing on a daily basis. There have been various discussions about it and I mostly lean towards the point of Michael Bolton in his post Testers: Get Out of the Quality Assurance Business. It was an eye opener blog post for me: my first job as a tester even had it in the title “Software Quality Assurance Analyst”. Later on, I turned into QA Engineer. However, I am a tester.

Michael Bolton in that blog post gives so many valid points, it’s like a gold mine. It is one of my favorite ever posts about testing. It basically stresses that as a tester you cannot really assure quality. You just inspect it and help to improve it. You test.

QA is not a person or the department of certain type of professionals. It is a task of everyone in the company to work towards assuring quality. Tester may play a huge part in it, but the actual “action” assurers of quality usually are programmers because they actually are making changes to the quality level. And, let’s not forget the main part:

Assuring quality is an ongoing task/goal of the company.

What does it mean to pass?

In testing passing the test means that the test has passed based on its acceptance criteria.

Test may be built from multiple specific test cases or lead by charters. However, the defined acceptance criteria should be clear.

Passing of tests could be related to the common question in testing: how much is it enough to test? Sometimes the answer is not that obvious. There may be various scenarios, explorations to be made and a common standard should be discussed with product management team on what are the requirements and if edge cases should be addressed for the initial release/iteration.

Why don’t I like the phrase “pass the QA”?

After explaining both parts of this phrase, I can say that for me saying “pass the quality assurance” makes almost no sense.

Quality assuring is an ongoing task, so it is never going to end. You cannot pass the quality assurance as it is, but you can pass the test.

I do understand the intent of this phrase and why it was used: it was meant to say that testing will be completed with no show-stopper issues and will pass the acceptance criteria.

Let’s not underestimate the power of wording. Saying “pass the QA” can definitely be misleading. However, sad news are that this term is quite popular to describe the teams of testers. In this case, let’s spread the awareness of the differences between QA and testing – we all are doing QA in the company, but only testers do testing as their full time job (programmers do a fair deal of testing as well, but it is not their main responsibility usually).

 

 

 

Learnings from “Explore It!” by Elisabeth Hendrickson

Exploratory testing is mentioned quite often in the testing world and I believe that the best book to start learning about it is Explore It! Reduce Risk and Increase Confidence with Exploratory Testing by Elisabeth Hendrickson.

This book is pretty short (186 pages), written in a wonderfully smooth and easy to read style, and, it is full of practical tips and tricks for testers. I felt that a lot of things I’ve read in the book I always wanted to express myself, but never found the right words.

Elisabeth starts with foundations about exploring and why it is important. What I liked a lot in the first part of the book was the definition of testing which allowed me to finally know how to clearly answer what’s the difference between testing and checking:

Testing = Checking + Exploring

You’re not done testing until you’ve checked that the software meets expextations and you’ve explored whether there are additional risks.

Very often some colleagues may not understand that testing is more than checking the requirements – there are many silent risks which may cause problems and to find them we need to explore. I also loved Elisabeth’s example of a net: you can imagine software covered in a net and the better coverage there is of the checks, the finer the weave is. However, checks may not cover some spots, so we must explore to find areas where we should improve the net weave.

After some foundations, this book provides many practical tips on how to explore. It teaches you how not to get overwhelmed with the areas to explore, how to create charters and lists many helpful methods for exploration. They are explained in a clear manner and their summary is added in an Appendix 2 of the book. You may have heard of same author’s Test Heuristics Cheat Sheet which is pretty similar to the one in the book.

One more thing that I found especially useful and right on point was the last part of the book called “Putting It in Context”. Not only does it have a lot of useful information on testing itself, but also Elisabeth includes several valuable tips on the communication part of the tester’s job (and.. I love this topic!).

What struck me the most was that very often testers end up “creating” new requirements which may cause some tension in a team. This is very common in a life of a tester as the more you use the product – the more areas you uncover and some of them may not have their requirements specified. In this situation, programmers may get a bit hurt that the tester is coming up with never mentioned scenarios. Here Elisabeth gives a great tip for testers: try to get into requirements meetings. Testers must be present when the requirements are being created together with a programmer and a product manager. In this way, risks can be discussed and clarified together avoiding silent requirements popping up in the late stages of the product which may expand the scope. And, Elisabeth gives a brilliant tip on how to get into those meetings:

Bring cookies. The other people involved are less likely to kick you out of the meeting if you come bearing chocolate.

In conclusion, “Explore It!” was a pleasure to read. It is a very helpful book on how to express yourself better and how to do that sometimes overwhelming job of a tester more systematically. I feel like I have gained confidence as a tester after reading this great book. Nevertheless, I recommended it to some of my non-tester colleagues as I am sure that it gives a good and easy to understand insight to testing.

 

 

Testing challenge was amazing! – Day 31 of 30 Days of Testing

When I decided to join 30 Days of Testing challenge, I did not have much expectations. Now, after a month of sticking to it honestly and sincerely every single day, I can admit that I have learned a lot and met some wonderful people on the way!

Here is the list of all challenges with links to the posts I wrote about them:

  1. BUY ONE TESTING RELATED BOOK AND READ IT BY DAY 30:
    Bought and read “Explore It!” by Elisabeth Hendrickson
  2. TAKE A PHOTO OF SOMETHING YOU ARE DOING AT WORK:
    What I’m doing at work
  3. LISTEN TO A TESTING PODCAST:
    Testcast Podcast “Testing is Dead”
  4. SHARE A TESTING BLOG POST WITH A NON-TESTER:

  5. READ AND COMMENT ON ONE BLOG POST:

  6. PERFORM A CRAZY TEST:

  7. FIND AN ACCESSIBILITY BUG:

  8. DOWNLOAD A MOBILE APP, FIND 5 BUGS AND SEND THE FEEDBACK TO THE CREATOR:

  9. CREATE A MINDMAP:

  10. FIND AN EVENT TO ATTEND (ONLINE OR FACE TO FACE):

  11. TAKE A PICTURE OF YOUR TEAM:

  12. DOODLE A PROBLEM:

  13. FIND A USER EXPERIENCE PROBLEM:

  14. STEP OUTSIDE OF YOUR COMFORT ZONE:

  15. FIND A PROBLEM WITH AN E-COMMERCE WEBSITE:

  16. GO TO A NON-TESTING EVENT:

  17. FIND AND SHARE A QUOTE THAT INSPIRES YOU:

  18. FIND A BROKEN LINK. AND REPORT IT:

  19. FIND AND USE A NEW TOOL:

  20. FIND A GOOD PLACE TO PERFORM SOME SECURITY TESTS:

  21. PAIR TEST WITH SOMEONE:

  22. SHARE YOUR FAVOURITE TESTING TOOL:

  23. HELP SOMEONE TEST BETTER:

  24. CONNECT WITH A TESTER WHO YOU HAVEN’T PREVIOUSLY CONNECTED WITH:

  25. CONTRIBUTE TO A TESTING DISCUSSION:

  26. INVITE A NON-TESTER TO A TEST EVENT:

  27. SAY SOMETHING NICE ABOUT THE THING YOU JUST TESTED:

  28. SUMMARISE AN ISSUE IN 140 CHARACTERS OR LESS:

  29. FIND AN OUT BY ONE ERROR:
    Off-by-one error hunt

  30. GIVE SOMEONE POSITIVE FEEDBACK:
    Give someone positive feedback

     

     

Give someone positive feedback – Day 30 of 30 Days of Testing

GIVE SOMEONE POSITIVE FEEDBACK

I couldn’t imagine of a better way to end an amazing journey of 30 Days of Testing. After all days filled with various testing tasks the final touch is personal, positive and related to people around us.

One of previous challenges was rather work-based- to say something nice about product you tested. It is closely related to today’s challenge as you may say it to a developer who made the product, but today it’s time to say something personal!

In my company, every three months we have personal feedback sessions with our CTO and VP of Engineering. Not only that we get feedback about ourselves, but also we are encouraged to express feedback about everyone in the team (including the people who are in the room). Usually, even if there are some things to improve, positive feedback is a big driving force which calms you down and makes you realize that people value you.

However, I never said positive feedback on purpose to someone personally, so today I chose a programmer who I greatly value, but maybe do not express that enough, and wrote that to him.

The experience was pretty rewarding! I had some struggles to formulate the words and it took a while to click  “Send”, but I feel that he really deserved it and hope that it will make his day. It would make mine.

In the end, I believe that it would be nice to give (and receive!) positive feedback real-time, not on challenges or feedback sessions, but when you feel like it.

 

Off-by-one error hunt – Day 29 of 30 Days of Testing

FIND AN OUT BY ONE ERROR

I did not know where to start with this challenge: what is an out by one error?

After some googling, I decided to stick to off-by-one error and its definition from Wikipedia:
An off-by-one error is a logic error involving the discrete equivalent of a boundary condition. It often occurs in computer programming when an iterative loop iterates one time too many or too few. This problem could arise when a programmer makes mistakes such as using “is less than or equal to” where “is less than” should have been used in a comparison or fails to take into account that a sequence starts at zero rather than one (as with array indices in many languages).

I did discuss this with some friends and they confirmed that it must be the same as “an out by one error”. They gave some more practical examples as well:

  • an array has 10 elements and you want the fifth one, so you do arr[5], but since arrays might be indexed from 0, the fifth element is arr[4] and you’re off-by-one;
  • Vitruvius fencepost error: if you build a straight fence 30 meters long with posts spaced 3 meters apart, how many posts do you need? You may think that you need 10, but to make 10 sections, you need 11 posts.

I am super grateful for wonderful friends as one of them doubting that I will be able to find any of these errors as they are quite easy to check and rare in production, created my own broken counter! If you write a number to which this little program should count – it will start counting with 0 (intentional programmer’s error):
counter

I did not want to give up this easily, so I invested some time checking other sites.I was thinking of where any kind of counting would be done, and, ended up checking e-commerce sites: their searches and price filtering (searching for < instead of =<).

I went to Vero Moda’s Day Dresses category. I decided to check if price filters are working as they say: if there is a price filter “10-20” I expect that it would include both 10 and 20. So, I checked first 10-20 filter and filtered results by High to Low price:
until20
As you can see, there are no 20 pounds dresses. I may guess here that there is less than 20 filter (which user doesn’t know), not less or equal as you may assume. However, maybe site simply does not have dresses which are worth 20 pounds? So, I checked filter 20-30 and filtered prices from low to high to see if there are 20 pounds dresses:

30

And it turns out that there are dresses which are worth 20 pounds. This means that I found an off-by-one error:

In Vero Moda’s price range filter, upper bound is not included: it is < instead of =<.

This is definitely not a huge mistake, but may cost a lot: if user’s budget is up to 20 pounds after filtering to 10-20 price range she may not find what she wants, thus she may end up not buying anything. Maybe some of the dresses which were costing equally 20 dollars would have been most attractive to the user, but there was no chance to see them with the filter on.

30 Days of Testing is moving towards the end and I am so grateful that I need to google some of the definitions because I did encounter off-by-one errors before (especially with strict bounds), but never knew the exact name. Now I do and it feels great to have a term which describes a specific type of a problem!

Summarizing an issue in 130 (originally 89) characters – Day 28 of 30 Days of Testing

SUMMARISE AN ISSUE IN 140 CHARACTERS OR LESS

Most of testers have to do this every day: we don’t write tweets about bugs, but the title of it definitely has a character limit and should be as short as possible.

My issue summary is a real-life example I’ve encountered today. I wanted to buy train tickets in Lithuania. I went to the site for buying train tickets.

The very main page has a very basic UI for buying tickets: one way, round trip radio buttons; two selects for the cities you are traveling between, passengers number field and Search button.

I am not traveling alone, so I wanted to change passengers number to 2. This is where I encountered a problem that even if I changed it in opened selector – number of passengers did not change. So here is a short summary of this bug:

User cannot select more than 1 passenger buying an online ticket with Lithuanian Railways

Here you go. 89 characters summarizing the problem! And, well, I must include a screenshot to depict that there is no change in Passengers field after selecting more passengers:

traukinys

Update: my issue summary just expanded! And, issue turned out to be the UX issue. Prashant just pointed out that there actually is Save Changes button! I did not see it because my computer’s screen resolution is smaller. Looking at the same site with bigger resolution site looks like this:
Screen Shot 2016-07-28 at 9.43.17 AM
Save the changes actually does work and changes passenger number. So, second shot to my issue summary:

User with resolution height less than 666, cannot see “Save the changes” button which prevents them from changing passenger number

Screen Shot 2016-07-28 at 9.49.06 AM

Now the character count is 130, but still challenge completed. 😉

Say nice things about what you test – Day 27 of 30 Days of Testing

SAY SOMETHING NICE ABOUT THE THING YOU JUST TESTED

Usually testers are the ones who report the bad news. This is a professional behavior in a way: we need to spot mistakes and let the team know about it as soon as possible so they would get fixed. The positive feedback often is left unspoken because we are concentrated on finding the negatives.

Being the lone tester, I work very closely with people whose work I have to test. Be it a product manager or a developer – I ask them questions, we collaborate and clarify the requirements and implementation. This allows me to feel closer to the team and as well get happy when something reaches final implementation. Sometimes when my verification is done I express positivity about what I tested: usually it is rather a “well done!” comment in JIRA, but there are also cases when we discuss the new feature’s “superpower” together with the programmer.

In general, my long-term aspiration is to soothe the pain of bad news with acts of appreciation and interest, so I try to say nice things about what I tested. Nevertheless, today I tried to do that even more!

I talked about the new feature with the programmer who has been working on it for a few months now. I really do believe that it’s a great investment in the long-run and I have noticed an amazing improvement in quality of his work. It was great to test a stable and pretty version of the product with no surprises except from a few cosmetic UI issues. As the result of this conversation, mood was lifted for both sides and the programmer shared his own nice thoughts about the same feature.

The greatest part of saying nice things about what you tested is that the programmer will get appreciation and even may explain more about the internals of the feature which helps you to test better.

Positivity is a win-win situation: helps to build a strong team with members who respect each other, share not only their problems, but wins as well. 

 

 

Non-tester, come to testing meetups! – Day 26 of 30 Days of Testing

INVITE A NON-TESTER TO A TEST EVENT

In one of previous challenges I created a post on how to find testing events. Today’s challenge is half done knowing which event you’d like to invite people to.

So, to any of non-testers reading this, I would like to kindly invite you to come to Budapest’s QA meetup’s palinQA events! Upcoming one will happen in September.

Great part about this meetup is that each time we have some non-testers joining us. A lot of topics are very interesting even if you’re not a tester. A great example of this is the latest meetup we had on Making a QA Career. Not only that the audience had testers who wanted to know more about job opportunities, but also people who are interested in the QA career, or, even non-testers (who possibly won’t change their career) come to listen to what qualities should testers have and how it feels to start a career as a tester.

Join a testing meetup and come to get to know the breed of testers: how they feel, what challenges they face and it will definitely give some insight to their work. The more insight there is – the better team we can create.

50bugsevery

My top 3 online spots for testing discussions – Day 25 of 30 Days of Testing

CONTRIBUTE TO A TESTING DISCUSSION

Some time ago I wouldn’t have guessed that there are so many forums and places to talk about testing. However, now I know a few and these are my 3 favorite online spots for testing discussions:

  1. uTest forums
    Recently I have become a more active uTester. It’s a great place to meet all kinds of testers: from beginners to advanced. Not only that it is a testing platform, but as well uTest has a strong community section and aims to be “twitter for testers“. There I can share knowledge, meet people who are interested in testing and are able to contribute to testing discussions.
  2. Software Testing Club
    I found Software Testing Club via Ministry of Testing. What I like a lot about it is that discussions are more “moderated” than in uTest. They are not as frequent, but at the same time more professional and it’s easier to find valuable content.
  3. Twitter/blogs
    This point is rather an obvious one – following testing professionals on Twitter you can read a lot of interesting testing discussions and be a part of it. Same goes for blogs.

Today I contributed to a testing discussion on uTest forums!