Showing posts with label tools. Show all posts
Showing posts with label tools. Show all posts

Wednesday, March 11, 2020

Tracking functional coverage from your api / functional UI (e2e) tests

Tracking and having a high coverage of your product code via automated tests is an important way of building a quality product.

It is easy to measure code coverage when running unit tests. You will find a plethora of tools (free & commercial) with a variety of features for any programming language you may be using. You can integrate these tools as part of your pre-commit hooks (i.e. you will not be able to push your code to version control if the limits set for code coverage fall below the minimum limit set), and also as part of your CI builds (i.e. fail the build if the code coverage limit falls below the expected limit).

The reason capturing code coverage works easily for unit tests, and maybe integration tests, is that these tests run in isolation, directly on the code. You do not need to have the product deployed to any environment to run the tests to measure the coverage. I found these great resources you can check out to understand more about how code coverage works:
http://www.semdesigns.com/Company/Publications/TestCoverage.pdf
https://confluence.atlassian.com/clover/about-code-coverage-71599496.html

However, very frequently this question comes up - how can we measure code coverage of the API tests, or of the functional UI (e2e / end-2-end) tests? I remember this question coming up since the past 8-10 years at least. Every time, I have given the same answer because I have not come across, nor seen any better way of answering this question. It is time I wrote it down for easier access to others as well.

Solution #1

Preconditions:

A big criteria for the above strategy to work is to ensure the environment is isolated - i.e. NO ONE is using the environment (for navigating through the product, testing of any kind other than the tests being triggered to measure coverage).
  • Deploy the product-under-test to an isolated environment, and start measuring code coverage. 
  • Then trigger the API / UI tests, 
  • That will tell you how much code coverage is achieved by these tests.
The above answer has some big gaps though:
  • What are you trying to understand from the code coverage of your API / UI tests? What value will it bring to the team? How will it make the product better?
  • Do you expect the code coverage of your API / UI tests to be similar / identical / better than the unit tests? IF yes, we need to have a different conversation about the Test Pyramid


 

Solution #2

However, I believe there is a better approach to this. 

Based on the Test Automation Pyramid shown above, the API / Web Service tests and UI tests are business facing tests. In this case, it will add more value to measure what functional / component coverage the tests have. 

With this approach, the code coverage from the Technology Facing Tests (Unit / Integration / ...) will focus on technical aspects of coverage, and the Business Facing Tests (API / UI) will focus on functional aspects of coverage. 

When looked at together, this will give a better sense of understanding of the overall quality of the product.

Tracking Functional Coverage

So, how can we track functional coverage? 

Unfortunately, there does not seem to be an out-of-the-box way to do this. But below is how I have implemented this before:
  • I used cucumber-jvm in my test framework
  • For each (end-2-end Test) Scenario, in addition to the tags required for the test (as per the test framework design), I added the following types of tags to the test:
    • functional areas touched by the test
    • components / modules touched by the test
  • I used cucumber-reporting plugin to generate rich, html reports
    • The beauty of the reports generated by cucumber-reporting reports is that I can now see for my test execution the different statistics of the tags when the tests ran. 
    • Below is an example for the cucumber-reporting github page:
 
    • With this report, you can now get to know:
      • the overall tag execution state for the complete test run
      • the number of times the tag was run as part of how many test scenarios
      • drill down into tag-specific reports as well

Why is the above report important?

As mentioned above, I am adding custom tags to each scenario - based on module / functionality / etc. If there is any critical functionality of my product, I would want to have more concentration of tests covering that feature / module, compared to others. 

Another way to visualize the tag statistics is in form of tag heat maps. You want your critical functionality to have a good sized bubble in the heat map. Also, any small bubbles, or non-existing bubbles would mean you do not have coverage for that feature / module.

The above example is one of the easiest ways to implement feature coverage for API / UI tests. But it is very likely you are not using cucumber-jvm, and cucumber-reporting plugin. But if this approach makes sense to you, then you could very easily implement it in your test framework, using the constructs and features of that programming language and tools.

Monday, February 11, 2019

Test Automation in the World of AI and ML

My article on "Test Automation in the World of AI & ML" recently got published on InfoQ.


Here are the key takeaways mentioned in the article -

  • There are many criteria to be considered before building framework / selecting tools for Functional Test Automation
  • It is very important to prioritise framework / tools capabilities needed for the software-under-test
  • A good, scalable Test Automation Framework that provides fast and reliable feedback to the team enables collaboration and CI/CD
  • Debugging / RCA (root cause analysis) and support for libraries / tools used is an afterthought in most cases. Do not fall in that trap.
  • There are some promising commercial tools that fit seamlessly in the Agile way of working. Depending on the complete context, these tools may be a good choice over building your own framework for Functional Automation.

You can read the full article from here

Looking forward to comments on the same!


.

Friday, November 30, 2018

Recording from webinar on The Missing Feedback Loop now available

On 21st Nov, TestCraft.io hosted me in a webinar where I spoke about - "The Missing Feedback Loop - The Tools, Techniques, and Automation to Solve It". 

You can get the recording from here (https://hubs.ly/H0fBDN50).






Tuesday, November 6, 2018

Is the Future of Test Automation I predicted already here?

Today, almost at the end of 2018, I have come across many tools focused on making Test Automation, easier, faster, reliable and more valuable to the teams & the product - like testim.iotestcraft.iokataloncypress.iomabltest.ai, etc. These tools are very interesting and very promising for the value proposition they are bringing to the table. 

As I reflect on these shiny new tools, my mind wanders back to 2009 / 2010 when I was toying with the idea of what would be next in Test Automation Tools & Infrastructure space. I had penned my thoughts and published an article on ThoughtWorks Insights with the title - "Future of Test Automation Tools & Infrastructure" (https://www.thoughtworks.com/insights/blog/future-test-automation-tools-infrastructure). 

If we look deeper in my post, the tools I mentioned above (and many others that I probably am unaware of), are conceptually on the lines of what I had sort-of thought in 2009 / 2010. They are using a very interesting blend of past experiences, in some cases advanced technology like AI & ML, in some cases leveraging cloud / SaaS model, and more importantly - pushing the boundaries to do things differently! I am personally very happy to see this happen.

That gets another set of questions in my mind now - if what I had thought of back then is now true, and a reality, then what is next? What will the next generation of new, interesting, shiny tools look like in the next 5 years?


Monday, November 5, 2018

Upcoming webinar - The Missing Feedback Loop

I am very excited to share that I am going to conduct a webinar hosted by testcraft.io on "The Missing Feedback Loop - The Tools, Techniques, and Automation to Solve It". 

You can register for the webinar from here (https://hubs.ly/H0fp4by0).





Date & Time:
Thursday, November 21, 2018 at 02:00 PM New-York (EDT), 11:00 AM San-Francisco (PDT) and 08:00 PM Amsterdam (UTC+2)


Friday, October 26, 2018

Agile Testing, Analytics Testing and Measuring Consumer Quality from Poland and USA

The last few weeks have been very hectic for me. In between my consulting assignments, I traveled to Krakow, Poland for Agile & Automation Days 2018, and then to Arlington, Virginia in USA for STPCon Fall 2018.

In the Agile & Automation Days 2018 conference, I spoke about "Measuring Consumer Quality - The Missing Feedback Loop" and conducted a 1/2 day workshop on "Analytics Rebooted - A Workshop".

In STPCon Fall 2018, I conducted 2 workshops - 1/2 day each - "Practical Agile Testing Workshop" and "Analytics Rebooted - A Workshop" and also spoke about "Measuring Consumer Quality - The Missing Feedback Loop"

Overall, I had a very good trip, amazing conversations and interactions with the attendees and the speakers. I would be lying if I say I am not tired and my throat has gone sore. But, would I do this again? Absolutely! Going to conferences and meeting people, sharing my experiences with them, and learning from their experiences gives me a lot of happiness and satisfaction.

Below are the abstracts of the workshops and the talk. 

Contact me via LinkedIn, or twitter, or my site - essenceoftesting.com if you need any additional information, or if you want help in learning / implementing these or other topics related to Quality / Testing / Automation.



Practical Agile Testing Workshop

Workshop Description:

The Agile Manifesto was published in 2001. It took the software industry a good few years to truly understand what the manifesto means, and the principles behind it. However, choosing and implementing the right set of practices to get the true value from working the Agile way has been the biggest challenge for most!

While Agile is now mainstream, and as we get better at the development practices to “being Agile”, Testing has still been lagging behind in most cases. A lot of teams are still working in the staggered fashion (a.k.a. Iterative waterfall way of working). Here teams may be testing after development completes, or Automation is done in the next Iteration / Sprint, etc.

In this workshop, we will learn and share various principles and practices which teams should adopt to be successful in testing (in-cycle) in Agile projects.

Workshop Agenda:
  • What is Agile testing? - Learn what does it mean to Test on Agile Projects
  • Effective strategies for Distributed Testing - Learn practices that help bridge the Distributed Testing gap!
  • Test Automation in Agile Projects - Why? What? How? - Why is Test Automation important, and how do we implement a good, robust, scalable and maintainable Test Automation framework!
  • Build the "right" regression suite using Behavior Driven Testing (BDT) - Behavior Driven Testing (BDT) is an evolved way of thinking about Testing. It helps in identifying the 'correct' scenarios, in form of user journeys, to build a good and effective (manual & automation) regression suite that validates the Business Goals. 
Key learning for participants in this workshop:
  • Understand the Agile Testing Manifesto.
  • Learn the essential Testing practices and activities essential for teams to adopt to work in Agile way of working.
  • Discover techniques to do effective testing in distributed teams.
  • Find out how Automation plays a crucial role in Agile projects.
  • Learn how to build a good, robust, scalable and maintainable Functional Automation framework.
  • Learn, by practice, how to identify the right types of tests to automate as UI functional tests - to get quick and effective feedback.




Analytics Rebooted – A Workshop

Workshop Description:

I have come across some extreme examples of Business / Organizations who have all their eggs in one basket - in terms of # understand their Consumers (engagement / usage / patterns / etc.), # understand usage of product features, and, # do all revenue-related book-keeping

This is all done purely on Analytics! Hence, to say “Business runs on Analytics, and it may be OK for some product / user features to not work correctly, but Analytics should always work” - is not a myth!

What this means is Analytics is more important now, than before.

In this workshop, we will not assume anything. We will discuss and learn by example and practice, the following:
  • How does Analytics works (for Web & Mobile)? 
  • Test Analytics manually in different ways 
  • Test Analytics via the final reports
  • Why some Automation strategies will work, and some WILL NOT WORK (based on my experience)!
  • We will see demo of the Automation running for the same.
  • Time permitting, we will setup running some Automation scripts on your machine to validate the same



Measuring Consumer Quality – The Missing Feedback Loop

Session Description:

How to build a good quality product is not a new topic. Proper usage of methodologies, processes, practices, collaboration techniques can yield amazing results for the team, the organization, and for the end-users of your product.

While there is a lot of emphasis on the processes and practices side, one aspect that is still spoken about “loosely” - is the feedback loop from your end-users to making better decisions.

SO, what is this feedback loop? Is it a myth? How do you measure it? Is there a “magic” formula to understand this data received? How to you add value to your product using this data?

In this interactive session, we will use a case study of a B2C entertainment-domain product (having millions of consumers) as an example to understand and also answer the following questions:
  • The importance of knowing your Consumers
  • How do you know your product is working well?
  • How do you know your Consumers are engaged with your product?
  • Can you draw inferences and patterns from the data to reach of point of being able to make predictions on Consumer behavior, before making any code change?

Attendees will have deeper understanding and appreciation of the following:
  • What is Consumer Quality and how does it help shape your business!
  • Ways to measure Consumer Quality
  • Why is understanding Consumer Engagement vital to the success of your product


Wednesday, July 25, 2018

Converting JSON into usable objects

JSON is a great way to specify data / information and, off late, it is the format of my choice to specify test data.


I find it to be -
  • light weight 
  • easy to understand 
  • almost very intuitive to know if you have made an error in the syntax 
  • easy to read into code and parse 
  • easy create meaningful custom objects and use in code 

Recently, thanks to a friend - Abhijeet Vaikar, I came across a tool - quicktype.io - that helps in transforming the raw JSON (from various sources) directly into custom objects, in a variety of languages.

Site: https://quicktype.io/

The tool: https://app.quicktype.io/

I got to know about this tool at perfect time as I am building a new tool for dynamic logging in Java - AutoLogJ (but more about AutoLogJ later). quicktype.io does what it promises - and it saved me a lot of time to build the custom POJOs for the same.

Thanks Abhijeet Vaikar and the quicktype team!